[wasm][coreclr] Put generated callhelpers into libcoreclr_gen_static library#128248
[wasm][coreclr] Put generated callhelpers into libcoreclr_gen_static library#128248radekdoulik wants to merge 2 commits into
Conversation
Move callhelpers-interp-to-managed.cpp, callhelpers-reverse.cpp, and callhelpers-pinvoke.cpp out of cee_wks_core/coreclr_static into a new cee_wks_gen object library and coreclr_gen_static static library. This allows relinking with just libcoreclr_static plus newly generated callhelper sources, without rebuilding the entire coreclr. The new library is linked in all WASM/coreclr consumers: corerun, browserhost, and installed alongside coreclr_static. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…separate-generated-lib
There was a problem hiding this comment.
Pull request overview
This PR separates the auto-generated WASM callhelpers (callhelpers-interp-to-managed.cpp, callhelpers-reverse.cpp, and optionally callhelpers-pinvoke.cpp) out of libcoreclr_static.a and into a new libcoreclr_gen_static.a archive. This avoids duplicate symbol errors when the app-level WASM build compiles its own generated reverse-pinvoke-table.cpp: previously the default reverse-thunk table was already embedded in libcoreclr_static.a, forcing the app build to skip recompiling it. With the generated objects split into a separate archive that the app can choose not to link against the default version of, the app can now compile and use its own reverse-pinvoke table.
Changes:
- Introduce a new
cee_wks_genOBJECT target andcoreclr_gen_staticSTATIC library for WASM only, holding the generated callhelpers. - Re-enable compilation of the app-generated
reverse-pinvoke-table.cppinBrowserWasmApp.CoreCLR.targetsand link the new archive into corerun/browserhost. - Register
libcoreclr_gen_static.ain the Microsoft.NETCore.App platform manifest.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/CMakeLists.txt | Moves generated callhelpers sources from VM_SOURCES_WKS_ARCH into new VM_SOURCES_WKS_GEN list and absolute-path-converts it. |
| src/coreclr/vm/wks/CMakeLists.txt | Creates the cee_wks_gen OBJECT target on WASM with PCH and the same dependency wiring as the other wks targets. |
| src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt | Defines the coreclr_gen_static STATIC library from cee_wks_gen objects and installs it for WASM/mobile destinations. |
| src/coreclr/hosts/corerun/CMakeLists.txt | Links coreclr_gen_static into corerun when available. |
| src/native/corehost/browserhost/CMakeLists.txt | Adds libcoreclr_gen_static.a to the browserhost native link list. |
| src/mono/browser/build/BrowserWasmApp.CoreCLR.targets | Re-enables compiling the app-generated reverse-pinvoke-table.cpp and removes the now-stale duplicate-symbol comment. |
| src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props | Registers the new static archive in the platform manifest. |
Move callhelpers-interp-to-managed.cpp, callhelpers-reverse.cpp, and
callhelpers-pinvoke.cpp out of cee_wks_core/coreclr_static into a new
cee_wks_gen object library and coreclr_gen_static static library.
This allows relinking with just libcoreclr_static plus newly generated
callhelper sources, without rebuilding the entire coreclr.
The new library is linked in all WASM/coreclr consumers: corerun,
browserhost, and installed alongside coreclr_static.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com