Skip to content

[wasm] Bump to Emsdk 5.0.6 / LLVM 23 (linux-x64)#127771

Draft
pavelsavara wants to merge 3 commits intodotnet:mainfrom
pavelsavara:dotnet/bump-llvm23-emsdk506
Draft

[wasm] Bump to Emsdk 5.0.6 / LLVM 23 (linux-x64)#127771
pavelsavara wants to merge 3 commits intodotnet:mainfrom
pavelsavara:dotnet/bump-llvm23-emsdk506

Conversation

@pavelsavara
Copy link
Copy Markdown
Member

@pavelsavara pavelsavara commented May 4, 2026

Contributes to #113786

Summary

Bumps dotnet/runtime to consume Emsdk 5.0.6 + LLVM 23 + Node 22.16.0 + ICU transports (linux-x64 packages only for now).

Branch contents

https://github.com/pavelsavara/runtime/commits/dotnet/bump-llvm23-emsdk506/

Commit 1: Bump LLVM 23 + Emsdk 5.0.6 + Node 22.16.0 + ICU transports

  • eng/Version.Details.xml + eng/Version.Details.props: ICU, LLVM, Node package versions -> 23.1.0 / 11.0.0-alpha.1.26253.2
  • eng/Versions.props: EmsdkVersion=5.0.6, EmsdkPackageVersion=11.0.0-preview.4.26253.2
  • src/mono/browser/emscripten-version.txt: 3.1.56 -> 5.0.6
  • src/mono/CMakeLists.txt: LLVM 23 lib lists + version check 2300
  • src/mono/mono/mini/mini-llvm.c: deprecation pragma covering whole file
  • src/mono/mono/mini/mini-llvm-cpp.cpp: getOrInsertDeclaration guard (#if LLVM_API_VERSION >= 2000)

Commit 2: Eliminate deprecated LLVMGetGlobalContext/LLVMVoidType usage

  • Derive context from module/function/instruction objects instead of global context
  • mono_llvm_create_constant_data_array and mono_llvm_get_ptr_type take LLVMContextRef parameter
  • Fixes -Wdeprecated-declarations warnings with LLVM 23

Commit 3: fix sample

Validation

  • Smoke build: ./build.sh mono -os browser -arch wasm -c Release compiles and links successfully
  • 10 deprecation warnings remain (non-fatal) in mini-llvm.c — covered by pragma
  • libSystem.Native.a missing in link step — requires libs subset, not a toolchain issue

Related

  • Deprecation fix also available as standalone PR for independent merge: see dotnet/fix-llvm23-deprecations branch

…x-x64)

- LLVM: 19.1.0-alpha.1.26173.1 → 23.1.0-alpha.1.26253.2 (linux-x64)
- Node: 11.0.0-alpha.1.26173.2 → 11.0.0-alpha.1.26253.2 (linux-x64)
- ICU: 11.0.0-alpha.1.26181.1 → 11.0.0-alpha.1.26253.2
- emscripten-version.txt: 3.1.56 → 5.0.6
- src/mono/CMakeLists.txt: LLVM 23 lib lists + version check 2300
- src/mono/mono/mini/mini-llvm.c: deprecation pragma for LLVM 23
- src/mono/mono/mini/mini-llvm-cpp.cpp: getOrInsertDeclaration guard
- NuGet.config: local package sources for smoke build
…ge in mini-llvm-cpp.cpp

Replace deprecated LLVM C API calls that use the global context with
context derived from available objects (module, function, instruction):

- mono_llvm_create_constant_data_array: takes LLVMContextRef parameter
- mono_llvm_get_ptr_type: takes LLVMContextRef parameter
- mono_llvm_add_param_attr_with_type: use func->getContext()
- mono_llvm_add_param_byval_attr: use func->getContext()
- mono_llvm_add_instr_attr_with_type: use CallBase->getContext()
- mono_llvm_add_instr_byval_attr: use CallBase->getContext()
- mono_llvm_di_create_location: use MDNode->getContext()
- mono_llvm_get_or_insert_gc_safepoint_poll: use Module->getContext()
- mono_llvm_register_intrinsic: use Module->getContext()
- mono_llvm_register_overloaded_intrinsic: use Module->getContext()

These APIs were deprecated in LLVM 20 and produce -Wdeprecated-declarations
warnings when building with LLVM 23.
@pavelsavara pavelsavara added this to the 11.0.0 milestone May 4, 2026
@pavelsavara pavelsavara self-assigned this May 4, 2026
Copilot AI review requested due to automatic review settings May 4, 2026 19:56
@pavelsavara pavelsavara added arch-wasm WebAssembly architecture os-browser Browser variant of arch-wasm labels May 4, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @vitek-karas
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Mono/WASM toolchain dependencies to LLVM 23 and Emscripten 5.0.6, and adjusts Mono’s LLVM interop layer and build plumbing accordingly.

Changes:

  • Bump LLVM API expectation to 23.0 (LLVM_API_VERSION 2300) and refresh the CMake link library lists.
  • Update Mono LLVM helper wrappers/callers to pass an explicit LLVMContextRef instead of relying on LLVMGetGlobalContext().
  • Bump Emsdk/Emscripten versions and related transport dependencies; update the local tool manifest.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/mono/mono/mini/mini-llvm.c Adds deprecated-warning suppression and updates constant-data-array callers + ptr type init for new signatures.
src/mono/mono/mini/mini-llvm-cpp.h Updates LLVM helper function signatures to accept LLVMContextRef.
src/mono/mono/mini/mini-llvm-cpp.cpp Implements context-aware helpers and updates several APIs for newer LLVM; adds LLVM>=2000 intrinsic path.
src/mono/CMakeLists.txt Updates expected LLVM API version and refreshes LLVM library link lists for LLVM 23.
src/mono/browser/emscripten-version.txt Updates pinned Emscripten version to 5.0.6.
NuGet.config Adds several local package sources (currently absolute user paths).
eng/Versions.props Updates Emsdk package/version properties and Node package variable.
eng/Version.Details.xml Updates dependency versions/SHAs for ICU, LLVM, and Wasm Node transport packages.
eng/Version.Details.props Updates the corresponding dependency version properties.
.config/dotnet-tools.json Adds dotnet-serve and adds rollForward: false entries to tools.

Comment thread NuGet.config
Comment on lines +15 to +19
<add key="local-llvm" value="/home/pavelsavara/dev/llvm-project/artifacts/packages/Release/Shipping" />
<add key="local-llvm-nonshipping" value="/home/pavelsavara/dev/llvm-project/artifacts/packages/Release/NonShipping" />
<add key="local-icu" value="/home/pavelsavara/dev/icu/artifacts/packages/Release/NonShipping" />
<add key="local-node" value="/home/pavelsavara/dev/node/artifacts/packages/Release/NonShipping" />
<add key="local-emsdk" value="/home/pavelsavara/dev/emsdk/artifacts/packages/Release/Shipping" />
Comment on lines +723 to 735
#if LLVM_API_VERSION >= 2000
Function *f = Intrinsic::getOrInsertDeclaration (unwrap (module), intrins_id);
#else
Function *f = Intrinsic::getDeclaration (unwrap (module), intrins_id);
#endif
if (!f) {
outs () << id << "\n";
g_assert_not_reached ();
}
auto type = Intrinsic::getType (*unwrap(LLVMGetGlobalContext ()), intrins_id);
auto type = Intrinsic::getType (unwrap (module)->getContext (), intrins_id);
*out_type = wrap (type);
return wrap (f);
} else {
Comment on lines +755 to 763
#if LLVM_API_VERSION >= 2000
auto f = Intrinsic::getOrInsertDeclaration (unwrap (module), intrins_id, { arr, (size_t)ntypes });
#else
auto f = Intrinsic::getDeclaration (unwrap (module), intrins_id, { arr, (size_t)ntypes });
auto type = Intrinsic::getType (*unwrap(LLVMGetGlobalContext ()), intrins_id, { arr, (size_t)ntypes });
#endif
auto type = Intrinsic::getType (unwrap (module)->getContext (), intrins_id, { arr, (size_t)ntypes });
*out_type = wrap (type);
return wrap (f);
}
Comment on lines +33 to +35
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"

Comment thread .config/dotnet-tools.json
Comment on lines 5 to 11
"coverlet.console": {
"version": "6.0.4",
"commands": [
"coverlet"
]
],
"rollForward": false
},
Comment thread .config/dotnet-tools.json
Comment on lines +33 to 39
"dotnet-serve": {
"version": "1.10.194",
"commands": [
"dotnet-serve"
],
"rollForward": false
}
@pavelsavara pavelsavara changed the title Dotnet/bump llvm23 emsdk506 [wasm] Bump to Emsdk 5.0.6 / LLVM 23 (linux-x64) May 4, 2026
@pavelsavara pavelsavara requested a review from akoeplinger May 4, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-Codegen-LLVM-mono os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants