Skip to content

Commit

Permalink
** arg fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pmp-p committed Sep 17, 2023
1 parent ca29ca4 commit f3c1244
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
22 changes: 15 additions & 7 deletions config
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,27 @@ fi

EMFLAVOUR=${EMFLAVOUR:-tot}

# base wasm features pure is "mvp"
export WASM_FLAVOUR=bi

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

# tell to not normalize modules.
export WASM_PURE=false
if [ -f /mvp ]
then
export WASM_FLAVOUR=mvp
export WASM_EXTRA="-sMIN_SAFARI_VERSION=120000"
export WASM_PURE=true
else
export WASM_FLAVOUR=bi

# extra features. Safari 14 is expected to have BIGINT, ignore the emsdk warnings.
export WASM_EXTRA="-sWASM_BIGINT -sMIN_SAFARI_VERSION=140100"

# tell to not normalize modules.
export WASM_PURE=false
fi

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


export PYDK_PYTHON_HOST_PLATFORM=wasm32-${WASM_FLAVOUR}-emscripten

if echo $LD_LIBRARY_PATH |grep -q ${HOST_PREFIX}/lib
Expand Down
8 changes: 6 additions & 2 deletions scripts/cpython-build-emsdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ else
echo -n
else
pushd src 2>&1 >/dev/null
# breaks with 3.1.46
#git clone https://github.com/pmp-p/libffi-emscripten.git libffi

# breaks with 3.1.46
git clone --no-tags --depth 1 --single-branch --branch master https://github.com/libffi/libffi
pushd libffi
./autogen.sh
Expand Down Expand Up @@ -315,8 +318,9 @@ export PYBUILD=\${PYBUILD:-$PYBUILD}
export PYMAJOR=\$(echo -n \$PYBUILD|cut -d. -f1)
export PYMINOR=\$(echo -n \$PYBUILD|cut -d. -f2)
export CARGO_HOME=\${CARGO_HOME:-${SDKROOT}}
export RUSTUP_HOME=\${RUSTUP_HOME:-${SDKROOT}}
export CARGO_HOME=\${CARGO_HOME:-${SDKROOT}}/rust
export RUSTUP_HOME=\${RUSTUP_HOME:-${SDKROOT}}/rust
mkdir -p \${CARGO_HOME}/bin
export PATH=\${CARGO_HOME}/bin:\$PATH
export PANDA_PRC_DIR=${SDKROOT}/support
Expand Down
11 changes: 8 additions & 3 deletions scripts/emsdk-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ then
./emsdk install ${EMFLAVOUR:-latest}
./emsdk activate ${EMFLAVOUR:-latest}
pushd upstream/emscripten
echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/20281"
wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/20281.diff
patch -p1 < 20281.diff

echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/17956"
wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/17956.diff

if patch -p1 < 17956.diff
then
echo applied https://github.com/emscripten-core/emscripten/pull/17956
Expand Down Expand Up @@ -179,9 +184,8 @@ if \$MVP
then
# -mcpu=generic would activate those https://reviews.llvm.org/D125728
# https://github.com/emscripten-core/emscripten/pull/17689
# CPU="-sWASM_BIGINT=0 -sMIN_SAFARI_VERSION=140000 -mnontrapping-fptoint -mno-reference-types -mno-sign-ext -mno-mutable-globals -m32"
# go hybrid
CPU="-sMIN_SAFARI_VERSION=140000 -mnontrapping-fptoint -mno-reference-types -mno-sign-ext -mno-mutable-globals -m32"
CPU="-mnontrapping-fptoint -mno-reference-types -mno-sign-ext -mno-mutable-globals -m32"
else
CPU="-mcpu=bleeding-edge -m32"
fi
Expand Down Expand Up @@ -344,6 +348,7 @@ then
then
SOTMP=\$(mktemp).so
mv \$SHARED_TARGET \$SOTMP
# --memory64-lowering --signext-lowering
$SDKROOT/emsdk/upstream/bin/wasm-emscripten-finalize -mvp \$SOTMP -o \$SHARED_TARGET
[ -f \$SHARED_TARGET.map ] && rm \$SHARED_TARGET.map
rm \$SOTMP
Expand Down

0 comments on commit f3c1244

Please sign in to comment.