Skip to content

Commit e1d2c46

Browse files
committed
3.1.50fix
1 parent 66e6329 commit e1d2c46

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

scripts/cpython-build-emsdk.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ END
187187
pushd $ROOT/src/cpython${PYBUILD}
188188
# fix double linking
189189
sed -i 's| -lcrypto||g' Makefile.pre.in
190+
sed -i 's|#error|//#error|g' /opt/python-wasm-sdk/src/Python-3.11.6/Include/pyport.h
190191
# please let compiler/user decide what to do with wasm CPU.
191192
sed -i 's|-sWASM_BIGINT||g' configure
192193
sed -i 's|-sWASM_BIGINT||g' configure.ac

scripts/emsdk-fetch.sh

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,20 @@ then
198198
# turn of wasm ex (https://github.com/emscripten-core/emscripten/pull/20536)
199199
# -fno-wasm-exceptions -sEMSCRIPTEN_LONGJMP=0
200200
201-
WASMOPTS="-fno-wasm-exceptions -sSUPPORT_LONGJMP=emscripten"
202201
203202
# -mcpu=generic would activate those https://reviews.llvm.org/D125728
204203
# https://github.com/emscripten-core/emscripten/pull/17689
205204
206205
# -fPIC not allowed with -mno-mutable-globals
207206
# -mno-sign-ext not allowed with pthread
208207
209-
CPU="-mnontrapping-fptoint -mno-reference-types -mno-sign-ext -m32"
208+
#WASMOPTS="-fno-wasm-exceptions -sSUPPORT_LONGJMP=emscripten"
209+
#CPU="-mnontrapping-fptoint -mno-reference-types -mno-sign-ext -m32"
210+
211+
CPU="-sSUPPORT_LONGJMP=emscripten -mnontrapping-fptoint -mno-reference-types -mno-sign-ext -m32"
212+
210213
else
211-
CPU="-mcpu=bleeding-edge -m32"
214+
CPU="-mcpu=bleeding-edge -m64"
212215
fi
213216
214217
# quick hack until 3.1.47
@@ -294,6 +297,16 @@ for arg do
294297
continue
295298
fi
296299
300+
if [ "\$arg" = "-O3" ]
301+
then
302+
continue
303+
fi
304+
305+
if [ "\$arg" = "-g" ]
306+
then
307+
continue
308+
fi
309+
297310
if [ "\$arg" = "-lgcc" ]
298311
then
299312
continue
@@ -371,7 +384,7 @@ done
371384
if \$IS_SHARED
372385
then
373386
# always pass CPU opts when linking
374-
$EMSDK_PYTHON -E \$0.py \$SHARED \$CPU $COPTS $LDFLAGS -sSIDE_MODULE -gsource-map --source-map-base / "\$@" \$COMMON
387+
$EMSDK_PYTHON -E \$0.py \$SHARED $COPTS \$CPU \$LDFLAGS -sSIDE_MODULE -gsource-map --source-map-base / "\$@" \$COMMON
375388
if \$MVP
376389
then
377390
if \$WASM_PURE
@@ -386,7 +399,12 @@ then
386399
fi
387400
else
388401
# do not pass WASM opts when -c/-o but always PIC
389-
$EMSDK_PYTHON -E \$0.py $COPTS \$CPU \$CPPFLAGS -DBUILD_STATIC "\$@" \$COMMON
402+
if echo $@|grep -q MAIN_MODULE
403+
then
404+
$EMSDK_PYTHON -E \$0.py $COPTS \$CPU \$CPU_EXTRA \$CPPFLAGS -DBUILD_STATIC "\$@" \$COMMON
405+
else
406+
$EMSDK_PYTHON -E \$0.py $COPTS \$CPU_EXTRA \$CPPFLAGS -DBUILD_STATIC "\$@" \$COMMON
407+
fi
390408
fi
391409
#else
392410
# unset _EMCC_CCACHE

0 commit comments

Comments
 (0)