Skip to content

Commit

Permalink
Fix for SINGLE_FILE + sync compilation + missing atob
Browse files Browse the repository at this point in the history
In this configuration the `atob` polfill is required but was not being
installed until after `createWasm` which (in the case of SINGLE_FILE)
depends on `atob`.

See emscripten-core#20349
  • Loading branch information
sbc100 committed Nov 1, 2023
1 parent 2feeee6 commit d1ee3b2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/postamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

// === Auto-generated postamble setup entry stuff ===

#if SUPPORT_BASE64_EMBEDDING || FORCE_FILESYSTEM
#include "base64Utils.js"
#endif
#if HEADLESS
if (!ENVIRONMENT_IS_WEB) {
#include "headlessCanvas.js"
Expand Down
4 changes: 4 additions & 0 deletions src/preamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ if (typeof WebAssembly != 'object') {
#include "runtime_asan.js"
#endif
#if SUPPORT_BASE64_EMBEDDING || FORCE_FILESYSTEM
#include "base64Utils.js"
#endif
// Wasm globals
var wasmMemory;
Expand Down
4 changes: 4 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -8917,6 +8917,10 @@ def do_test(cmd):
def test_single_file_shell(self):
self.do_runf('hello_world.c', emcc_args=['-sSINGLE_FILE'])

@requires_v8
def test_single_file_shell_sync_compile(self):
self.do_runf('hello_world.c', emcc_args=['-sSINGLE_FILE', '-sWASM_ASYNC_COMPILATION=0'])

def test_emar_M(self):
create_file('file1', ' ')
create_file('file2', ' ')
Expand Down

0 comments on commit d1ee3b2

Please sign in to comment.