Skip to content

Commit a67283f

Browse files
authored
Use legacy pass manager when wasm EH is enabled (#14181)
This is a temporary measure for our clients who are experimenting with this new feature. See #14180.
1 parent 301b842 commit a67283f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

emcc.py

+7
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,13 @@ def get_cflags(options, user_args):
865865
'-D__unix',
866866
'-D__unix__']
867867

868+
# When wasm EH is enabled, we use the legacy pass manager because the new pass
869+
# manager + wasm EH has some known bugs. See
870+
# https://github.com/emscripten-core/emscripten/issues/14180.
871+
# TODO Switch to the new pass manager.
872+
if settings.EXCEPTION_HANDLING:
873+
cflags += ['-flegacy-pass-manager']
874+
868875
# Changes to default clang behavior
869876

870877
# Implicit functions can cause horribly confusing function pointer type errors, see #2175

tools/building.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,12 @@ def link_lld(args, target, external_symbols=None):
457457

458458
# Wasm exception handling. This is a CodeGen option for the LLVM backend, so
459459
# wasm-ld needs to take this for the LTO mode.
460+
# When wasm EH is enabled, we use the legacy pass manager because the new pass
461+
# manager + wasm EH has some known bugs. See
462+
# https://github.com/emscripten-core/emscripten/issues/14180.
463+
# TODO Switch to the new pass manager.
460464
if settings.EXCEPTION_HANDLING:
461-
cmd += ['-mllvm', '-exception-model=wasm']
465+
cmd += ['-mllvm', '-exception-model=wasm', '--lto-legacy-pass-manager']
462466

463467
# For relocatable output (generating an object file) we don't pass any of the
464468
# normal linker flags that are used when building and exectuable

0 commit comments

Comments
 (0)