Skip to content

Commit ac9fab9

Browse files
committed
enforce mvp
1 parent a76b3f6 commit ac9fab9

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

scripts/emsdk-fetch.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ then
1818
if git clone --no-tags --depth 1 --single-branch --branch main https://github.com/emscripten-core/emsdk.git
1919
then
2020
pushd emsdk
21+
git checkout 91f8563a9d1a4a0ec03bbb2be23485367d85a091
2122
./emsdk install ${EMFLAVOUR:-latest}
2223
./emsdk activate ${EMFLAVOUR:-latest}
2324
pushd upstream/emscripten
@@ -162,6 +163,17 @@ SHARED=""
162163
IS_SHARED=false
163164
PY_MODULE=false
164165
MVP=\${MVP:true}
166+
167+
if \$MVP
168+
then
169+
# -mcpu=generic would activate those https://reviews.llvm.org/D125728
170+
# https://github.com/emscripten-core/emscripten/pull/17689
171+
CPU="-mno-sign-ext -mno-mutable-globals -m32"
172+
else
173+
CPU="-mcpu=bleeding-edge -m32"
174+
fi
175+
176+
165177
LINKING=\${LINKING:-false}
166178
167179
if echo "\$@ "|grep -q "\\.so "
@@ -298,7 +310,7 @@ done
298310
299311
if \$IS_SHARED
300312
then
301-
$EMSDK_PYTHON -E \$0.py \$SHARED -m32 $COPTS $LDFLAGS -sSIDE_MODULE -gsource-map --source-map-base / "\$@" \$COMMON
313+
$EMSDK_PYTHON -E \$0.py \$SHARED $CPU $COPTS $LDFLAGS -sSIDE_MODULE -gsource-map --source-map-base / "\$@" \$COMMON
302314
if \$MVP
303315
then
304316
SOTMP=\$(mktemp).so
@@ -308,7 +320,7 @@ then
308320
rm \$SOTMP
309321
fi
310322
else
311-
$EMSDK_PYTHON -E \$0.py -m32 \$COPTS \$CPPFLAGS -DBUILD_STATIC "\$@" \$COMMON
323+
$EMSDK_PYTHON -E \$0.py $CPU \$COPTS \$CPPFLAGS -DBUILD_STATIC "\$@" \$COMMON
312324
fi
313325
#else
314326
# unset _EMCC_CCACHE

0 commit comments

Comments
 (0)