Skip to content

Fix unresolved symbol in standalone debug build. #24680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions system/lib/standalone/standalone.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include "lock.h"
#include "emscripten_internal.h"
#include "unwind.h"

/*
* WASI support code. These are compiled with the program, and call out
Expand Down Expand Up @@ -308,3 +309,7 @@ weak void _emscripten_get_progname(char* buf, int length) {
}

weak void _emscripten_runtime_keepalive_clear() {}

void __throw_exception_with_stack_trace(_Unwind_Exception* exception_object) {
_Unwind_RaiseException(exception_object);
}
9 changes: 9 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -15182,6 +15182,15 @@ def test_standalone_settings(self):
err = self.expect_fail(base_cmd + ['-sMEMORY_GROWTH_LINEAR_STEP=1mb'])
self.assertContained('error: MEMORY_GROWTH_LINEAR_STEP is not compatible with STANDALONE_WASM', err)

def test_standalone_imports(self):
# Ensure standalone binary will not have __throw_exception_with_stack_trace
# debug helper dependency, caused by exception-related code.
src_path = test_file('core/test_exceptions.cpp')
self.run_process([EMXX, '-O0', '-fwasm-exceptions', '-sSTANDALONE_WASM', src_path])
imports = self.parse_wasm('a.out.wasm')[0]
for name in imports:
self.assertTrue(name.startswith('wasi_'), 'Unexpected import %s' % name)

@is_slow_test
def test_googletest(self):
# TODO(sbc): Should we package gtest as an emscripten "port"? I guess we should if
Expand Down