diff --git a/emscripten.py b/emscripten.py index 124848d6e7af2..01b1d6d3d23cb 100644 --- a/emscripten.py +++ b/emscripten.py @@ -484,10 +484,6 @@ def finalize_wasm(infile, memfile, DEBUG): # if we don't need to modify the wasm, don't tell finalize to emit a wasm file modify_wasm = False - # C++ exceptions and longjmp require invoke processing, - # https://github.com/WebAssembly/binaryen/issues/3081 - if shared.Settings.SUPPORT_LONGJMP or shared.Settings.DISABLE_EXCEPTION_CATCHING != 1: - modify_wasm = True if shared.Settings.WASM2JS: # wasm2js requires full legalization (and will do extra wasm binary # later processing later anyhow) diff --git a/src/deps_info.json b/src/deps_info.json index 0632abdc97153..3daaffa4a78ea 100644 --- a/src/deps_info.json +++ b/src/deps_info.json @@ -124,7 +124,6 @@ "longjmp": ["setThrew", "realloc", "testSetjmp", "saveSetjmp"], "siglongjmp": ["setThrew", "realloc", "testSetjmp", "saveSetjmp"], "emscripten_longjmp": ["setThrew", "realloc", "testSetjmp", "saveSetjmp"], - "emscripten_longjmp_jmpbuf": ["setThrew", "realloc", "testSetjmp", "saveSetjmp"], "emscripten_websocket_new": ["malloc", "free"], "emscripten_websocket_set_onmessage_callback_on_thread": ["malloc", "free"], "emscripten_websocket_set_onclose_callback_on_thread": ["malloc", "free"], diff --git a/src/library.js b/src/library.js index 7b1e7463814e0..225241ebe937a 100644 --- a/src/library.js +++ b/src/library.js @@ -1794,7 +1794,6 @@ LibraryManager.library = { // they each have a different signature - it is only at the wasm level that // they become identical). emscripten_longjmp: 'longjmp', - emscripten_longjmp_jmpbuf: 'longjmp', // ========================================================================== // sys/wait.h diff --git a/tests/test_other.py b/tests/test_other.py index 4e311f2f892d8..bd8d2e74b361f 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -9000,9 +9000,8 @@ def ok(args, filename='hello_world.cpp', expected='hello, world!'): self.run_process([EMCC, path_from_root('tests', filename)] + args) self.assertContained(expected, self.run_js('a.out.js')) - # -O0 with BigInt support (to avoid the need for legalization) and without - # longjmp - required_flags = ['-sWASM_BIGINT', '-sSUPPORT_LONGJMP=0'] + # -O0 with BigInt support (to avoid the need for legalization) + required_flags = ['-sWASM_BIGINT'] ok(required_flags) # Same with DWARF ok(required_flags + ['-g']) @@ -9021,16 +9020,11 @@ def fail(args, details): # plain -O0 legalization_message = 'to disable int64 legalization (which requires changes after link) use -s WASM_BIGINT' - longjmp_message = 'to disable longjmp support (which requires changes after link) use -s SUPPORT_LONGJMP=0' fail([], legalization_message) - fail(['-sWASM_BIGINT'], longjmp_message) - fail(['-sSUPPORT_LONGJMP=0'], legalization_message) # optimized builds even without legalization optimization_message = '-O2+ optimizations always require changes, build with -O0 or -O1 instead' fail(required_flags + ['-O2'], optimization_message) fail(required_flags + ['-O3'], optimization_message) - # exceptions fails until invokes are fixed - fail(required_flags + ['-fexceptions'], 'C++ exceptions always require changes') def test_output_to_nowhere(self): self.run_process([EMCC, path_from_root('tests', 'hello_world.cpp'), '-o', os.devnull, '-c']) diff --git a/tools/building.py b/tools/building.py index a028ad4d5da82..c82f8a73a20ed 100644 --- a/tools/building.py +++ b/tools/building.py @@ -1574,16 +1574,12 @@ def run_binaryen_command(tool, infile, outfile=None, args=[], debug=False, stdou # emit some extra helpful text for common issues extra = '' # a plain -O0 build *almost* doesn't need post-link changes, except for - # legalization and longjmp. show a clear error for those (as the flags - # the user passed in are not enough to see what went wrong) + # legalization. show a clear error for those (as the flags the user passed + # in are not enough to see what went wrong) if shared.Settings.LEGALIZE_JS_FFI: extra += '\nnote: to disable int64 legalization (which requires changes after link) use -s WASM_BIGINT' - if shared.Settings.SUPPORT_LONGJMP: - extra += '\nnote: to disable longjmp support (which requires changes after link) use -s SUPPORT_LONGJMP=0' if shared.Settings.OPT_LEVEL > 0: extra += '\nnote: -O2+ optimizations always require changes, build with -O0 or -O1 instead' - if shared.Settings.DISABLE_EXCEPTION_CATCHING != 1: - extra += '\nnote: C++ exceptions always require changes' exit_with_error('changes to the wasm are required after link, but disallowed by ERROR_ON_WASM_CHANGES_AFTER_LINK: ' + str(cmd) + extra) if debug: cmd += ['-g'] # preserve the debug info diff --git a/tools/wasm2c/base.c b/tools/wasm2c/base.c index 8d639bc4de459..c88450686c25b 100644 --- a/tools/wasm2c/base.c +++ b/tools/wasm2c/base.c @@ -131,10 +131,6 @@ IMPORT_IMPL(void, Z_envZ_emscripten_longjmpZ_vii, (u32 buf, u32 value), { longjmp(setjmp_stack[next_setjmp - 1], 1); }); -IMPORT_IMPL(void, Z_envZ_emscripten_longjmp_jmpbufZ_vii, (u32 buf, u32 value), { - return Z_envZ_emscripten_longjmpZ_vii(buf, value); -}); - IMPORT_IMPL(void, Z_envZ_emscripten_notify_memory_growthZ_vi, (u32 size), {}); static u32 tempRet0 = 0;