Skip to content
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