diff options
author | Sam Clegg <sbc@chromium.org> | 2020-06-10 16:54:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-10 16:54:40 -0700 |
commit | b9feef2861b6f7286c6a8bf1a89c1699b2fcae01 (patch) | |
tree | 0b7b5d1548ba5f30e6a7d9bc4753724066677e2d /src/tools/wasm-emscripten-finalize.cpp | |
parent | f21eb572dd4a30c27dfad813249c3d715b4d1bca (diff) | |
download | binaryen-b9feef2861b6f7286c6a8bf1a89c1699b2fcae01.tar.gz binaryen-b9feef2861b6f7286c6a8bf1a89c1699b2fcae01.tar.bz2 binaryen-b9feef2861b6f7286c6a8bf1a89c1699b2fcae01.zip |
Support new clang mangling of main (__main_argc_argv) (#2671)
The plan is that for standlone mode we can function just like wasi-sdk
and call the correct main from crt1.c.
For non-standalone mode we still want to export can call main directly
so we rename __main_argc_argv back to main as part of finalize.
See https://reviews.llvm.org/D70700
Diffstat (limited to 'src/tools/wasm-emscripten-finalize.cpp')
-rw-r--r-- | src/tools/wasm-emscripten-finalize.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tools/wasm-emscripten-finalize.cpp b/src/tools/wasm-emscripten-finalize.cpp index f7de3af3f..c01fb00bf 100644 --- a/src/tools/wasm-emscripten-finalize.cpp +++ b/src/tools/wasm-emscripten-finalize.cpp @@ -277,6 +277,9 @@ int main(int argc, const char* argv[]) { } else { // If not standalone wasm then JS is relevant and we need dynCalls. generator.generateDynCallThunks(); + // This is also not needed in standalone mode since standalone mode uses + // crt1.c to invoke the main and is aware of __main_argc_argv mangling. + generator.renameMainArgcArgv(); } // Legalize the wasm, if BigInts don't make that moot. |