Skip to content

Commit f3c1244

Browse files
committed
** arg fix
1 parent ca29ca4 commit f3c1244

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

config

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,27 @@ fi
4949

5050
EMFLAVOUR=${EMFLAVOUR:-tot}
5151

52-
# base wasm features pure is "mvp"
53-
export WASM_FLAVOUR=bi
5452

55-
# extra features. Safari 14 is expected to have BIGINT, ignore the emsdk warnings.
56-
export WASM_EXTRA="-sWASM_BIGINT -sPOLYFILL -sMIN_SAFARI_VERSION=140000"
53+
# base wasm features pure is "mvp" , "bi" is bigint
5754

58-
# tell to not normalize modules.
59-
export WASM_PURE=false
55+
if [ -f /mvp ]
56+
then
57+
export WASM_FLAVOUR=mvp
58+
export WASM_EXTRA="-sMIN_SAFARI_VERSION=120000"
59+
export WASM_PURE=true
60+
else
61+
export WASM_FLAVOUR=bi
62+
63+
# extra features. Safari 14 is expected to have BIGINT, ignore the emsdk warnings.
64+
export WASM_EXTRA="-sWASM_BIGINT -sMIN_SAFARI_VERSION=140100"
65+
66+
# tell to not normalize modules.
67+
export WASM_PURE=false
68+
fi
6069

6170
#temp fix for oom on CI (Error: Process completed with exit code 143.)
6271
export EMSDK_NUM_CORES=1
6372

64-
6573
export PYDK_PYTHON_HOST_PLATFORM=wasm32-${WASM_FLAVOUR}-emscripten
6674

6775
if echo $LD_LIBRARY_PATH |grep -q ${HOST_PREFIX}/lib

scripts/cpython-build-emsdk.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ else
4848
echo -n
4949
else
5050
pushd src 2>&1 >/dev/null
51+
# breaks with 3.1.46
5152
#git clone https://github.com/pmp-p/libffi-emscripten.git libffi
53+
54+
# breaks with 3.1.46
5255
git clone --no-tags --depth 1 --single-branch --branch master https://github.com/libffi/libffi
5356
pushd libffi
5457
./autogen.sh
@@ -315,8 +318,9 @@ export PYBUILD=\${PYBUILD:-$PYBUILD}
315318
export PYMAJOR=\$(echo -n \$PYBUILD|cut -d. -f1)
316319
export PYMINOR=\$(echo -n \$PYBUILD|cut -d. -f2)
317320
318-
export CARGO_HOME=\${CARGO_HOME:-${SDKROOT}}
319-
export RUSTUP_HOME=\${RUSTUP_HOME:-${SDKROOT}}
321+
export CARGO_HOME=\${CARGO_HOME:-${SDKROOT}}/rust
322+
export RUSTUP_HOME=\${RUSTUP_HOME:-${SDKROOT}}/rust
323+
mkdir -p \${CARGO_HOME}/bin
320324
export PATH=\${CARGO_HOME}/bin:\$PATH
321325
322326
export PANDA_PRC_DIR=${SDKROOT}/support

scripts/emsdk-fetch.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ then
2222
./emsdk install ${EMFLAVOUR:-latest}
2323
./emsdk activate ${EMFLAVOUR:-latest}
2424
pushd upstream/emscripten
25+
echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/20281"
26+
wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/20281.diff
27+
patch -p1 < 20281.diff
28+
2529
echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/17956"
2630
wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/17956.diff
31+
2732
if patch -p1 < 17956.diff
2833
then
2934
echo applied https://github.com/emscripten-core/emscripten/pull/17956
@@ -179,9 +184,8 @@ if \$MVP
179184
then
180185
# -mcpu=generic would activate those https://reviews.llvm.org/D125728
181186
# https://github.com/emscripten-core/emscripten/pull/17689
182-
# CPU="-sWASM_BIGINT=0 -sMIN_SAFARI_VERSION=140000 -mnontrapping-fptoint -mno-reference-types -mno-sign-ext -mno-mutable-globals -m32"
183-
# go hybrid
184-
CPU="-sMIN_SAFARI_VERSION=140000 -mnontrapping-fptoint -mno-reference-types -mno-sign-ext -mno-mutable-globals -m32"
187+
188+
CPU="-mnontrapping-fptoint -mno-reference-types -mno-sign-ext -mno-mutable-globals -m32"
185189
else
186190
CPU="-mcpu=bleeding-edge -m32"
187191
fi
@@ -344,6 +348,7 @@ then
344348
then
345349
SOTMP=\$(mktemp).so
346350
mv \$SHARED_TARGET \$SOTMP
351+
# --memory64-lowering --signext-lowering
347352
$SDKROOT/emsdk/upstream/bin/wasm-emscripten-finalize -mvp \$SOTMP -o \$SHARED_TARGET
348353
[ -f \$SHARED_TARGET.map ] && rm \$SHARED_TARGET.map
349354
rm \$SOTMP

0 commit comments

Comments
 (0)