Skip to content

[EH] Remove -wasm-enable-eh LLVM flag - #27739

Merged
aheejin merged 3 commits into
emscripten-core:mainfrom
aheejin:remove_wasm_enable_eh
Sep 18, 2026
Merged

aheejin merged 3 commits into
emscripten-core:mainfrom
aheejin:remove_wasm_enable_eh

Conversation

@aheejin

@aheejin aheejin commented Sep 17, 2026

Copy link
Copy Markdown
Member

Previously in LLVM, we had -mllvm -enable-emscripten-cxx-exceptions to enable Emscriten EH, and -mllvm -wasm-enable-eh to enable Wasm EH. These were separate Wasm backend flags.

Also there is a separate -exception-model= LLVM flag used for all LLVM targets. We used wasm for Wasm EH and none for Emscripten EH. This was a common LLVM flag which we didn't directly use but fed LLVM because it was a common flag.

Recently a series of Clang+LLVM EH flag refactoring was done, and now LLVM is using -exception-model to control all EH modes. So Emscripten EH will be enabled by -exception-model=emscripten, and Wasm EH by -exception-model=wasm, and we don't need the Wasm-specific LLVM flags. -enable-emscripten-cxx-exceptions was removed in #27704. This removes -wasm-enable-eh.

This has to land before llvm/llvm-project#224313. This also temporarily disable EH LTO tests, which we will reenable after llvm/llvm-project#224313 lands.

Previously in LLVM, we had `-mllvm -enable-emscripten-cxx-exceptions` to
enable Emscriten EH, and `-mllvm -wasm-enable-eh` to enable Wasm EH.
These were separate Wasm backend flags.

Also there is a separate `-exception-model=` LLVM flag used for all LLVM
targets. We used `wasm` for Wasm EH and `none` for Emscripten EH. This
was a common LLVM flag which we didn't directly use but fed LLVM because
it was a common flag.

Recently a series of Clang+LLVM EH flag refactoring was done, and now
LLVM is using `-exception-model` to control all EH modes. So Emscripten
EH will be enabled by `-exception-model=emscripten`, and Wasm EH by
`-exception-model=wasm`, and we don't need the Wasm-specific LLVM flags.
`-enable-emscripten-cxx-exceptions` was removed in emscripten-core#27704. This removes
`-wasm-enable-eh`.

This has to land before
llvm/llvm-project#224313.
@dschuff

dschuff commented Sep 17, 2026

Copy link
Copy Markdown
Member

Do we need any of the pieces of llvm/llvm-project#224313 to land for this to work, for example the change to CodeGenPassBuilder.cpp and WebAssemblyTargetMachine.h?

@aheejin

aheejin commented Sep 18, 2026

Copy link
Copy Markdown
Member Author

We have to hand this before llvm/llvm-project#224313 lands, because it removes -wasm-enable-eh, and without this PR Emscripten will still feed -wasm-enable-eh. But it turns out we can't land this first either because without llvm/llvm-project#224313 landed first we can't remove -wasm-enable-eh here because LTO EH tests are failing.

I think we should temporarily disable LTO tests here, and land llvm/llvm-project#224313, and re-enable them.

@aheejin
aheejin merged commit b8ffb45 into emscripten-core:main Sep 18, 2026
42 checks passed
@aheejin
aheejin deleted the remove_wasm_enable_eh branch September 18, 2026 05:10
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.

3 participants