emscripten-core / emscripten-core/emscripten

SIDE_MODULE imports increases dramatically after 2.0.32

Open
#15,487 25 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

UPDATE: last good version is `2.0.27`

We are upgrading from 2.0.26 to 2.0.32 and the side modules are failing to compile in browser because they exceed the import limit of 100000, in fact it grew from 4662 to 141035.
symptom as follows

```
CompileError: WebAssembly.Module(): imports count of 141035 exceeds internal limit of 100000 @+11710
```

it seems that something inside wasm-ld changed and is causing this.
I am trying to get the in between versions of emsdk to narrow down the version, in the mean time would like to ask if anyone has any ideas

both 2.0.26 and 2.0.32 have flags as follows

```
emsdk/upstream/bin/wasm-ld'
'-o'
'out.wasm'
'dynamic.cpp.o'
'--whole-archive'
'archive.a'
'--no-whole-archive'
'-L/emcache/sysroot/lib/wasm32-emscripten/pic'
'-mllvm'
'-combiner-global-alias-analysis=false'
'-mllvm'
'-enable-emscripten-cxx-exceptions'
'-mllvm'
'-enable-emscripten-sjlj'
'-mllvm'
'-disable-lsr'
'--import-undefined'
'--import-memory'
'--export-if-defined=__heap_base',
'--export-if-defined=setThrew', '--export-if-defined=emscripten_stack_get_end'
'--export-if-defined=emscripten_stack_get_free','--export-if-defined=emscripten_stack_set_limits'
'--export-if-defined=__cxa_demangle', '--export-if-defined=stackSave', '--export-if-defined=stackRestore'
'--export-if-defined=stackAlloc', '--export-if-defined=__wasm_call_ctors', '--export-if-defined=fflush'
'--export-if-defined=__errno_location', '--export-if-defined=malloc', '--export-if-defined=free'
'--export-if-defined=__cxa_is_pointer_type', '--export-if-defined=__cxa_can_catch', '--export-if-defined=_get_tzname'
'--export-if-defined=_get_daylight', '--export-if-defined=_get_timezone'
'--export-if-defined=emscripten_main_thread_process_queued_calls'
'--experimental-pic'
'-shared'
'--no-export-dynamic
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.