-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,987 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
builddir | ||
main.* | ||
!main.c | ||
pybuilddir.txt | ||
pyodide | ||
node_modules |
16 changes: 16 additions & 0 deletions
16
emscripten/_sysconfigdata__emscripten_wasm32-emscripten.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# system configuration generated and used by the sysconfig module | ||
build_time_vars = { | ||
"ABIFLAGS": "", | ||
"AR": "/src/emsdk/emsdk/upstream/emscripten/emar", | ||
"ARFLAGS": "rcs", | ||
"BLDSHARED": "emcc -sSIDE_MODULE=1", | ||
"CC": "emcc -I../../emscripten", | ||
"CCSHARED": "", | ||
"CFLAGS": "-Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g " | ||
"-fwrapv -O3 -Wall -O2 -g0 -fPIC", | ||
"EXT_SUFFIX": ".cpython-310-wasm32-emscripten.so", | ||
"HOST_GNU_TYPE": "wasm32-unknown-emscripten", | ||
"LDSHARED": "emcc -sSIDE_MODULE=1", | ||
"Py_DEBUG": "0", | ||
"py_version_nodot": "310", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env python3 | ||
import subprocess | ||
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)): | ||
if "ASSERTIONS" in args[i]: | ||
del args[i - 1 : i + 1] | ||
break | ||
|
||
# remove -lc. Not sure if it makes a difference but -lc doesn't belong here. | ||
# https://github.com/emscripten-core/emscripten/issues/17191 | ||
for i in reversed(range(len(args))): | ||
if args[i] == "c" and args[i - 1] == "-l": | ||
del args[i - 1 : i + 1] | ||
|
||
# Prevent a bunch of errors caused by buggy behavior in | ||
# `esmcripten/tools/building.py:lld_flags_for_executable` REQUIRED_EXPORTS | ||
# 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") | ||
|
||
return args | ||
|
||
|
||
def main(args): | ||
args = update_args(args) | ||
return subprocess.call(["emcc"] + args) | ||
|
||
|
||
if __name__ == "__main__": | ||
args = sys.argv[1:] | ||
sys.exit(main(args)) |
Oops, something went wrong.