Skip to content

[EH] Apply coop threading fix from LLVM - #27753

Open
aheejin wants to merge 1 commit into
emscripten-core:mainfrom
aheejin:wasi_coop_thread_lib_fix
Open

aheejin wants to merge 1 commit into
emscripten-core:mainfrom
aheejin:wasi_coop_thread_lib_fix

Conversation

@aheejin

@aheejin aheejin commented Sep 20, 2026

Copy link
Copy Markdown
Member

After llvm/llvm-project#222747, user code will not directly access __was_lpad_context but instead get its address via _Unwind_GetWasmLPadContext function call. This is done for WASIp3 cooperative threading + dynamic library support, but doing this unconditionally in all cases is simple and does not have any downsides.

Because we update our LLVM libraries perodically, to make llvm/llvm-project#222747 pass our autorollers, this applies its library side changes here first to match its codegen changes.

After llvm/llvm-project#222747, user code will
not directly access `__was_lpad_context` but instead get its address via
`_Unwind_GetWasmLPadContext` function call. This is done for WASIp3
cooperative threading + dynamic library support, but doing this
unconditionally in all cases is simple and does not have any downsides.

Because we update our LLVM libraries perodically, to make
llvm/llvm-project#222747 pass our autorollers,
this applies its library side changes here first to match its codegen
changes.
Comment thread tools/system_libs.py
name = 'libunwind'
# Because calls to _Unwind_CallPersonality are generated during LTO, libunwind
# can't currently be part of LTO.
# Because calls to _Unwind_GetWasmLPadContext are generated during LTO,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Drive-by fix: _Unwind_CallPersonality was deleted from the library in #27445 but I forgot to remove this, but now we have a new function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant