Skip to content

[EH] Deprecate EXPORT_EXCEPTION_HANDLING_HELPERS - #26499

Merged
aheejin merged 2 commits into
emscripten-core:mainfrom
aheejin:remove_export_exception_handling_helpers
Mar 20, 2026
Merged

[EH] Deprecate EXPORT_EXCEPTION_HANDLING_HELPERS#26499
aheejin merged 2 commits into
emscripten-core:mainfrom
aheejin:remove_export_exception_handling_helpers

Conversation

@aheejin

@aheejin aheejin commented Mar 20, 2026

Copy link
Copy Markdown
Member

This effectively removes EXPORT_EXCEPTION_HANDLING_HELPERS setting. This marks the setting as deprecated not to crash users' builds right away in case they are using it. Even though it still exists as a deprecated setting, setting it to true will not change anything.

It used to export getExceptionMessage and a few more functions (in/decrementexceptionRefCount), but after #26493, getExceptionMessage is exported anyway when exceptions are used and either -sASSERTIONS or -sEXCEPTION_STACK_TRACES is set, which are set by default at -O0. For Wasm EH, the dependency is automatically detected. For Emscripten EH, we had to add getExceptionMessage to deps of __cxa_throw.

This adds in/decrementexceptionRefCount to deps of __cxa_throw (for Emscripten EH) and __throw_exception_with_stack_trace (for Wasm EH) and removes EXPORT_EXCEPTION_HANDLING_HELPERS. (You can use it but it won't do anything additionally)

This effectively removes `EXPORT_EXCEPTION_HANDLING_HELPERS` setting.
This marks the setting as deprecated not to crash users' builds right
away in case they are using it. Even though it still exists as a
deprecated setting, setting it to true will not change anything.

It used to export `getExceptionMessage` and a few more functions
(`in/decrementexceptionRefCount`), but after emscripten-core#26493,
`getExceptionMessage` is exported anyway when exceptions are used and
either `-sASSERTIONS` or `-sEXCEPTION_STACK_TRACES` is set, which are
set by default at `-O0`. For Wasm EH, the dependency is automatically
detected. For Emscripten EH, we had to add `getExceptionMessage` to deps
of `__cxa_throw`.

This adds `in/decrementexceptionRefCount` to deps of `__cxa_throw` (for
Emscripten EH) and `__throw_exception_with_stack_trace` (for Wasm EH)
and removes `EXPORT_EXCEPTION_HANDLING_HELPERS`. (You can use it but it
won't do anything additionally)
@aheejin

aheejin commented Mar 20, 2026

Copy link
Copy Markdown
Member Author

This does not remove the setting not to crash users. When can we actually remove a setting? https://github.com/emscripten-core/emscripten/blob/main/tools/settings.py seems to say we can move deprecated settings to legacy settings later. Then do those settings live in the legacy settings forever? Or can we actually remove a setting some time after it's depcreated?

@sbc100

sbc100 commented Mar 20, 2026

Copy link
Copy Markdown
Collaborator

This does not remove the setting not to crash users. When can we actually remove a setting? https://github.com/emscripten-core/emscripten/blob/main/tools/settings.py seems to say we can move deprecated settings to legacy settings later. Then do those settings live in the legacy settings forever? Or can we actually remove a setting some time after it's depcreated?

The setting that go into LEGACY_SETTINGS basically stay there forever. You can choose the valid values in LEGACY_SETTINGS, for this settings if you specify [0, 1] as valid values then basicaly no users will see any error when using the settings. If you use [0] as the valid values then any user trying to enable the setting with =1 would see an error.

@sbc100 sbc100 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice!

@aheejin
aheejin merged commit 4f40164 into emscripten-core:main Mar 20, 2026
38 checks passed
@aheejin
aheejin deleted the remove_export_exception_handling_helpers branch March 20, 2026 22:07
sbc100 pushed a commit that referenced this pull request Mar 21, 2026
sbc100 added a commit to WebAssembly/binaryen that referenced this pull request Mar 21, 2026
sbc100 added a commit to WebAssembly/binaryen that referenced this pull request Mar 21, 2026
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