Use -sSIDE_MODULE=2 when compiling rust (#2713)

This commit is contained in:
Hood Chatham 2022-06-15 07:27:34 -07:00 committed by GitHub
parent 392908cf68
commit 6868d2e93c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 7 deletions

View File

@ -156,7 +156,7 @@ export PYO3_CONFIG_FILE=$(PYODIDE_ROOT)/tools/pyo3_config.ini
export RUSTFLAGS= \
-C relocation-model=pic \
-C target-feature=+mutable-globals \
-C link-arg=-sSIDE_MODULE=1 \
-C link-arg=-sSIDE_MODULE=2 \
-C link-arg=-sWASM_BIGINT
.output_vars:

View File

@ -4,9 +4,6 @@ import sys
def update_args(args):
# https://github.com/emscripten-core/emscripten/issues/17109
args.insert(0, "-Wl,--no-whole-archive")
# Remove -s ASSERTIONS=1
# See https://github.com/rust-lang/rust/pull/97928
for i in range(len(args)):
@ -25,9 +22,6 @@ def update_args(args):
# contains symbols that should come from the main module.
# https://github.com/emscripten-core/emscripten/issues/17202
args.append("-sERROR_ON_UNDEFINED_SYMBOLS=0")
# Seems like --no-entry should be implied by SIDE_MODULE but apparently it
# isn't?
args.append("-Wl,--no-entry")
# Without this, the dylink section seems to get deleted which causes trouble
# at load time.
args.append("-Wl,--no-gc-sections")