Skip to content

Commit f6c08cc

Browse files
committed
3.1.74.4pre
1 parent 49cd4b9 commit f6c08cc

File tree

6 files changed

+54
-69
lines changed

6 files changed

+54
-69
lines changed

config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ export HPIP="${HPY} -mpip"
3939
if [ -f /mvp ]
4040
then
4141
export WASM_FLAVOUR=mvp
42-
export WASM_EXTRA="-sMIN_SAFARI_VERSION=120000"
42+
export WASM_OPTS="-sMIN_SAFARI_VERSION=120000"
4343
export WASM_PURE=true
4444
else
4545
export WASM_FLAVOUR=bi
4646

4747
# extra features. Safari 140100 is expected to have BIGINT ? emsdk warnings ?
48-
export WASM_EXTRA="-sWASM_BIGINT -sMIN_SAFARI_VERSION=150000"
48+
export WASM_OPTS="-sWASM_BIGINT -sMIN_SAFARI_VERSION=150000"
4949

5050
# tell to not normalize modules.
5151
export WASM_PURE=false

emsdk-cc

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ else:
121121
CPU = arglist("-D_FILE_OFFSET_BITS=64 -mcpu=bleeding-edge -m64")
122122

123123

124-
# try to keep 32 but maybe with 64 iface (bigint)
125-
WASM_EXTRA = env("WASM_EXTRA", "") + " " + env("WASM_OPTS", "")
124+
# try to keep 32 but with 64 iface (bigint)
125+
WASM_OPTS = env("WASM_OPTS", "-sWASM_BIGINT -sMIN_SAFARI_VERSION=150000")
126126

127127

128128
# the only sane default for now
@@ -264,8 +264,6 @@ else:
264264

265265
elif not STATIC:
266266
if arg.endswith(".so"):
267-
if not IS_SHARED:
268-
LINKING = True
269267

270268
if arg.startswith("/usr/lib"):
271269
arg = f"-l{arg.rsplit('/',1)[-1][3:-3]}"
@@ -274,6 +272,7 @@ else:
274272

275273
if arg.find("wasm32-emscripten.so") > 0 or arg.find("abi3.so") > 0:
276274
PY_MODULE = True
275+
LINKING = True
277276
SHARED_TARGET = arg
278277

279278
# FIX linking .so when it should have been .a for final exe without MAIN_MODULE set
@@ -291,6 +290,7 @@ else:
291290
# TODO check is -shared implies -sSIDE_MODULE=1
292291
elif arg == "-shared":
293292
IS_SHARED = True
293+
MAIN_MODULE = False
294294
continue
295295

296296
# duplicates can happen on cmake/rustc but they are expected to be here for a reason so skip them
@@ -397,8 +397,9 @@ else:
397397
except Exception as e:
398398
dbg("ERROR: 312", e)
399399

400-
if SIZEOPT:
401-
final.append("-sENVIRONMENT=node")
400+
# TODO: opt for size should only use 1 platform
401+
# if SIZEOPT:
402+
# final.append("-sENVIRONMENT=node")
402403

403404
# error: explicitly setting EXIT_RUNTIME not compatible with STANDALONE_WASM.
404405
# EXIT_RUNTIME will always be True for programs (with a main function) and False for reactors (not main function).
@@ -410,30 +411,34 @@ else:
410411

411412
__import__("atexit").register(make_exe)
412413
elif HTML:
413-
if SIZEOPT and ("-sENVIRONMENT=web" not in out):
414-
final.append("-sENVIRONMENT=web")
414+
# TODO: opt for size should only use 1 platform
415+
# if SIZEOPT and ("-sENVIRONMENT=web" not in out):
416+
# final.append("-sENVIRONMENT=web")
417+
pass
418+
419+
final.extend(arglist("-fPIC", WASM_OPTS, "-D__PYDK__=1"))
415420

421+
if LINKING:
422+
if MAIN_MODULE:
423+
# TODO: module level
424+
# -gsource-map --source-map-base /
425+
pass
426+
elif IS_SHARED or PY_MODULE:
427+
SHARED = f"-shared -sASSERTIONS=0 -sSIDE_MODULE=1"
428+
429+
final.extend(arglist(SHARED, LOPTS))
430+
final.append(f"-L{PREFIX}/lib")
431+
final.extend(arglist(env("LDFLAGS", "")))
416432

417-
if IS_SHARED or LINKING or PY_MODULE:
418-
SHARED = f"-shared -sASSERTIONS=0 -sSIDE_MODULE=1"
419-
final.extend(arglist("-fPIC", SHARED, LOPTS))
420433
else:
421434
# maybe not pass all WASM opts when -c + -o but always PIC and opt level
422-
final.extend(arglist("-fPIC", SHARED, COPTS))
435+
final.append(f"-I{PREFIX}/include")
436+
final.extend(arglist(COPTS))
437+
423438

424439
# prevent use of extended instr
425440
final.extend(CPU)
426441

427-
if IS_SHARED or LINKING:
428-
final.append(f"-L{PREFIX}/lib")
429-
final.extend(arglist(WASM_EXTRA, env("LDFLAGS", "")))
430-
else:
431-
final.append(f"-I{PREFIX}/include")
432-
if MAIN_MODULE:
433-
# TODO: module level
434-
# -gsource-map --source-map-base /
435-
pass
436-
final.extend(arglist(WASM_EXTRA, "-D__PYDK__=1"))
437442

438443
final.extend(out)
439444
final.extend(COMMON)

python-wasi-sdk.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ reset
77
mkdir -p /tmp/sdk-bin
88
export PATH=/tmp/sdk-bin:$PATH
99

10-
which command || cat > /tmp/sdk-bin/command << END
11-
#!/bin/bash
12-
shift
13-
which $1
14-
END
15-
chmod +x /tmp/sdk-bin/command
16-
17-
1810
if which python3
1911
then
2012
SYS_PYTHON=$(which python3)

python-wasm-sdk.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ reset
77
mkdir -p /tmp/sdk-bin
88
export PATH=/tmp/sdk-bin:$PATH
99

10-
which command || cat > /tmp/sdk-bin/command << END
11-
#!/bin/bash
12-
shift
13-
which $1
14-
END
15-
chmod +x /tmp/sdk-bin/command
16-
17-
1810
if which python3
1911
then
2012
SYS_PYTHON=$(which python3)

scripts/cpython-build-host.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ END
8383
then
8484
# Prevent freezing bytecode with a different magic
8585
rm -f $HOST_PREFIX/bin/python3 $HOST_PREFIX/bin/python${PYBUILD}
86-
if command -v python3.${PYMINOR}
86+
if which python3.${PYMINOR}
8787
then
8888
echo "
8989
9090
===================================================================================
9191
9292
it's not safe to have a python3.${PYMINOR} in the path :
93-
$(command -v python3.${PYMINOR})
93+
$(which python3.${PYMINOR})
9494
while in pre-release cycle : _sre.MAGIC / bytecode weird errors etc ...
9595
9696
===================================================================================

scripts/emsdk-fetch.sh

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,12 @@ then
3737
pushd emsdk/upstream/emscripten
3838

3939

40-
41-
4240
echo "FIXME: applying stdio* are not const"
4341
sed -i 's|extern FILE \*const|extern FILE \*|g' cache/sysroot/include/stdio.h
4442

4543

46-
47-
4844
echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/20281 dylink.js : handle ** argument case"
49-
if [ -f test/other/test_em_js_side.c b/test/other/test_em_js_side.c ]
45+
if [ -f test/other/test_em_js_side.c ]
5046
then
5147
wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/20281.diff
5248
patch -p1 < 20281.diff
@@ -90,29 +86,29 @@ END
9086
# wget https://raw.githubusercontent.com/paradust7/minetest-wasm/main/emsdk_emcc.patch
9187
# patch -p1 < emsdk_emcc.patch
9288

93-
pushd upstream/emscripten
94-
echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/21472 glfw3: gl level version major/minor hints"
95-
wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/21472.diff
96-
patch -p1 < 21472.diff
89+
pushd emsdk/upstream/emscripten
90+
echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/21472 glfw3: gl level version major/minor hints"
91+
wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/21472.diff
92+
patch -p1 < 21472.diff
9793

9894

99-
echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/20442 fix mouse position for 3D canvas"
100-
# wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/20442.diff
101-
# patch -p1 < 20442.diff
102-
wget https://patch-diff.githubusercontent.com/raw/pmp-p/emscripten/pull/2.diff
103-
patch -p1 < 2.diff
95+
echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/20442 fix mouse position for 3D canvas"
96+
# wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/20442.diff
97+
# patch -p1 < 20442.diff
98+
wget https://patch-diff.githubusercontent.com/raw/pmp-p/emscripten/pull/2.diff
99+
patch -p1 < 2.diff
104100

105-
echo "FIXME: Applying https://github.com/pmp-p/emscripten/pull/3 ioctl TIOCSWINSZ"
106-
wget https://github.com/pmp-p/emscripten/pull/3.diff
107-
patch -p1 < 3.diff
101+
echo "FIXME: Applying https://github.com/pmp-p/emscripten/pull/3 ioctl TIOCSWINSZ"
102+
wget https://github.com/pmp-p/emscripten/pull/3.diff
103+
patch -p1 < 3.diff
108104

109-
#echo "FIXME: remove XHR for .data and use fetch" MERGED
110-
#wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/22016.diff
111-
#patch -p1 < 22016.diff
105+
#echo "FIXME: remove XHR for .data and use fetch" MERGED
106+
#wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/22016.diff
107+
#patch -p1 < 22016.diff
112108

113-
#echo "FIXME: scriptDirectory workaround" MERGER
114-
#wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/22605.diff
115-
#patch -p1 < 22605.diff
109+
#echo "FIXME: scriptDirectory workaround" MERGER
110+
#wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/22605.diff
111+
#patch -p1 < 22605.diff
116112
popd # upstream/emscripten
117113

118114

@@ -344,10 +340,10 @@ END
344340
export CFLDPFX="$CPPFLAGS $LDFLAGS -Wno-unused-command-line-argument"
345341
export PYDK=true
346342

347-
if command -v ccache 2>&1 >/dev/null; then
348-
export EM_COMPILER_WRAPPER=ccache
349-
export _EMCC_CCACHE=1
350-
fi
343+
# if which ccache 2>&1 >/dev/null; then
344+
# export EM_COMPILER_WRAPPER=ccache
345+
# export _EMCC_CCACHE=1
346+
# fi
351347

352348
export EMCC_SKIP_SANITY_CHECK=1
353349
export EM_IGNORE_SANITY=1

0 commit comments

Comments
 (0)