Skip to content

Force __cxa_can_catch in LTO with exceptions - #27578

Open
brendandahl wants to merge 1 commit into
emscripten-core:mainfrom
brendandahl:lto-exceptions
Open

Force __cxa_can_catch in LTO with exceptions#27578
brendandahl wants to merge 1 commit into
emscripten-core:mainfrom
brendandahl:lto-exceptions

Conversation

@brendandahl

Copy link
Copy Markdown
Collaborator

During LTO code generation, the LLVM backend lowers Emscripten exception handling into calls to __cxa_find_matching_catch_N, which is provided by JS library code and requires __cxa_can_catch from libc++abi.

Because libc++abi is an archive of bitcode files in LTO builds, __cxa_can_catch is not extracted before LTO codegen unless explicitly referenced, leading to undefined symbol errors.

This is needed after the changes to wasm-ld land.

During LTO code generation, the LLVM backend lowers Emscripten
exception handling into calls to __cxa_find_matching_catch_N,
which is provided by JS library code and requires __cxa_can_catch
from libc++abi.

Because libc++abi is an archive of bitcode files in LTO builds,
__cxa_can_catch is not extracted before LTO codegen unless
explicitly referenced, leading to undefined symbol errors.
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.

2 participants