Skip to content

Commit

Permalink
Error on USE_OFFSET_CONVERTER plus WASM=0. fixes #14630
Browse files Browse the repository at this point in the history
  • Loading branch information
kripken committed Jul 13, 2021
1 parent c515787 commit 588f0cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2091,6 +2091,9 @@ def check_memory_setting(setting):
if settings.USE_OFFSET_CONVERTER and settings.USE_PTHREADS:
settings.EXPORTED_RUNTIME_METHODS += ['WasmOffsetConverter']

if settings.USE_OFFSET_CONVERTER and settings.WASM2JS:
exit_with_error('wasm2js is not compatible with USE_OFFSET_CONVERTER (see #14630)')

if sanitize & UBSAN_SANITIZERS:
if '-fsanitize-minimal-runtime' in newargs:
settings.UBSAN_RUNTIME = 1
Expand Down
4 changes: 4 additions & 0 deletions tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -10665,6 +10665,10 @@ def test_bad_export_name(self):
err = self.expect_fail([EMCC, '-sEXPORT_NAME=foo bar', test_file('hello_world.c')])
self.assertContained('error: EXPORT_NAME is not a valid JS identifier: `foo bar`', err)

def test_offset_convertor_plus_wasm2js(self):
err = self.expect_fail([EMCC, '-sUSE_OFFSET_CONVERTER', '-s', 'WASM=0', test_file('hello_world.c')])
self.assertContained('wasm2js is not compatible with USE_OFFSET_CONVERTER', err)

def test_standard_library_mapping(self):
# Test the `-l` flags on the command line get mapped the correct libraries variant
self.run_process([EMBUILDER, 'build', 'libc-mt', 'libcompiler_rt-mt', 'libdlmalloc-mt'])
Expand Down

0 comments on commit 588f0cf

Please sign in to comment.