@@ -198,17 +198,20 @@ then
198
198
# turn of wasm ex (https://github.com/emscripten-core/emscripten/pull/20536)
199
199
# -fno-wasm-exceptions -sEMSCRIPTEN_LONGJMP=0
200
200
201
- WASMOPTS="-fno-wasm-exceptions -sSUPPORT_LONGJMP=emscripten"
202
201
203
202
# -mcpu=generic would activate those https://reviews.llvm.org/D125728
204
203
# https://github.com/emscripten-core/emscripten/pull/17689
205
204
206
205
# -fPIC not allowed with -mno-mutable-globals
207
206
# -mno-sign-ext not allowed with pthread
208
207
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
+
210
213
else
211
- CPU="-mcpu=bleeding-edge -m32 "
214
+ CPU="-mcpu=bleeding-edge -m64 "
212
215
fi
213
216
214
217
# quick hack until 3.1.47
@@ -294,6 +297,16 @@ for arg do
294
297
continue
295
298
fi
296
299
300
+ if [ "\$ arg" = "-O3" ]
301
+ then
302
+ continue
303
+ fi
304
+
305
+ if [ "\$ arg" = "-g" ]
306
+ then
307
+ continue
308
+ fi
309
+
297
310
if [ "\$ arg" = "-lgcc" ]
298
311
then
299
312
continue
371
384
if \$ IS_SHARED
372
385
then
373
386
# 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
375
388
if \$ MVP
376
389
then
377
390
if \$ WASM_PURE
@@ -386,7 +399,12 @@ then
386
399
fi
387
400
else
388
401
# 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
390
408
fi
391
409
#else
392
410
# unset _EMCC_CCACHE
0 commit comments