File tree Expand file tree Collapse file tree 3 files changed +29
-12
lines changed Expand file tree Collapse file tree 3 files changed +29
-12
lines changed Original file line number Diff line number Diff line change 4949
5050EMFLAVOUR=${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.)
6271export EMSDK_NUM_CORES=1
6372
64-
6573export PYDK_PYTHON_HOST_PLATFORM=wasm32-${WASM_FLAVOUR} -emscripten
6674
6775if echo $LD_LIBRARY_PATH | grep -q ${HOST_PREFIX} /lib
Original file line number Diff line number Diff line change 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}
315318export PYMAJOR=\$ (echo -n \$ PYBUILD|cut -d. -f1)
316319export 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
320324export PATH=\$ {CARGO_HOME}/bin:\$ PATH
321325
322326export PANDA_PRC_DIR=${SDKROOT} /support
Original file line number Diff line number Diff line change 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
179184then
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"
185189else
186190 CPU="-mcpu=bleeding-edge -m32"
187191fi
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
You can’t perform that action at this time.
0 commit comments