[wasm] Bump to Emsdk 5.0.6 / LLVM 23 (linux-x64)#127771
Draft
pavelsavara wants to merge 3 commits intodotnet:mainfrom
Draft
[wasm] Bump to Emsdk 5.0.6 / LLVM 23 (linux-x64)#127771pavelsavara wants to merge 3 commits intodotnet:mainfrom
pavelsavara wants to merge 3 commits intodotnet:mainfrom
Conversation
…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.
Contributor
|
Tagging subscribers to this area: @steveisok, @vitek-karas |
Contributor
There was a problem hiding this comment.
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
LLVMContextRefinstead of relying onLLVMGetGlobalContext(). - 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 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 on lines
5
to
11
| "coverlet.console": { | ||
| "version": "6.0.4", | ||
| "commands": [ | ||
| "coverlet" | ||
| ] | ||
| ], | ||
| "rollForward": false | ||
| }, |
Comment on lines
+33
to
39
| "dotnet-serve": { | ||
| "version": "1.10.194", | ||
| "commands": [ | ||
| "dotnet-serve" | ||
| ], | ||
| "rollForward": false | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributes to #113786
Summary
Bumps
dotnet/runtimeto 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.2eng/Versions.props: EmsdkVersion=5.0.6, EmsdkPackageVersion=11.0.0-preview.4.26253.2src/mono/browser/emscripten-version.txt: 3.1.56 -> 5.0.6src/mono/CMakeLists.txt: LLVM 23 lib lists + version check 2300src/mono/mono/mini/mini-llvm.c: deprecation pragma covering whole filesrc/mono/mono/mini/mini-llvm-cpp.cpp:getOrInsertDeclarationguard (#if LLVM_API_VERSION >= 2000)Commit 2: Eliminate deprecated LLVMGetGlobalContext/LLVMVoidType usage
mono_llvm_create_constant_data_arrayandmono_llvm_get_ptr_typetakeLLVMContextRefparameterCommit 3: fix sample
Validation
./build.sh mono -os browser -arch wasm -c Releasecompiles and links successfullymini-llvm.c— covered by pragmalibSystem.Native.amissing in link step — requireslibssubset, not a toolchain issueRelated
dotnet/fix-llvm23-deprecationsbranch