diff options
author | Sam Clegg <sbc@chromium.org> | 2022-01-09 07:51:14 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-09 07:51:14 -0800 |
commit | 92dd9e253a64784d4047c4a0dc660081316a79da (patch) | |
tree | 71e93da953ff5c8cdf8af1dd3a5c2c46448872dc | |
parent | 1ef8f1f2c3fcecc6906e8fd40184f3e81b2d1838 (diff) | |
download | binaryen-92dd9e253a64784d4047c4a0dc660081316a79da.tar.gz binaryen-92dd9e253a64784d4047c4a0dc660081316a79da.tar.bz2 binaryen-92dd9e253a64784d4047c4a0dc660081316a79da.zip |
Fix emscripten build by removing dummy atexit function (#4435)
Since https://github.com/emscripten-core/emscripten/pull/15905 landed
emscripten now includes its own dummy atexit function when building with
EXIT_RUNTIME=0.
This dummy function conflicts with the emscripten-provided one:
```
wasm-ld: error: duplicate symbol: atexit
>>> defined in CMakeFiles/binaryen_wasm.dir/src/binaryen-c.cpp.o
>>> defined in ...wasm32-emscripten/lto/libnoexit.a(atexit_dummy.o)
```
Normally overriding symbols from libc does not causes issues but one
needs to be sure to override all the symbols in a given object file so
that the object in question (atexit_dummy.o) does not get linked in. In
this case some other symbol being defined in in atexit_dummy.o (e.g.
__cxa_atexit) is likely the cause of the conflict.
Overriding symbols from libc is likely to break in this way as the libc
evolves, and since emscripten is now providing a dummy, just as we want,
its better/safer to simply remove our dummy.
-rw-r--r-- | src/binaryen-c.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp index bce508e23..be538ef86 100644 --- a/src/binaryen-c.cpp +++ b/src/binaryen-c.cpp @@ -4617,10 +4617,6 @@ void BinaryenSetColorsEnabled(bool enabled) { Colors::setEnabled(enabled); } bool BinaryenAreColorsEnabled() { return Colors::isEnabled(); } #ifdef __EMSCRIPTEN__ -// Override atexit - we don't need any global ctors to actually run, and -// otherwise we get clutter in the output in debug builds -int atexit(void (*function)(void)) { return 0; } - // Internal binaryen.js APIs // Returns the size of a Literal object. |