@@ -189,19 +189,30 @@ PY_MODULE=false
189
189
MVP=\$ {MVP:true}
190
190
WASM_PURE=\$ {WASM_PURE:true}
191
191
192
+
193
+
194
+
192
195
if \$ MVP
193
196
then
197
+
198
+ # turn of wasm ex (https://github.com/emscripten-core/emscripten/pull/20536)
199
+ # -fno-wasm-exceptions -sEMSCRIPTEN_LONGJMP=0
200
+
201
+ WASMOPTS="-fno-wasm-exceptions -sSUPPORT_LONGJMP=emscripten"
202
+
194
203
# -mcpu=generic would activate those https://reviews.llvm.org/D125728
195
204
# https://github.com/emscripten-core/emscripten/pull/17689
205
+
196
206
# -fPIC not allowed with -mno-mutable-globals
197
207
# -mno-sign-ext not allowed with pthread
198
- CPU="-sSUPPORT_LONGJMP=emscripten -mnontrapping-fptoint -mno-reference-types -mno-sign-ext -m32"
208
+
209
+ CPU="-mnontrapping-fptoint -mno-reference-types -mno-sign-ext -m32"
199
210
else
200
211
CPU="-mcpu=bleeding-edge -m32"
201
212
fi
202
213
203
214
# quick hack until 3.1.47
204
- CPU ="$WASM_EXTRA \$ CPU "
215
+ WASMOPTS ="$WASM_EXTRA \$ WASMOPTS "
205
216
206
217
207
218
LINKING=\$ {LINKING:-false}
@@ -299,6 +310,15 @@ for arg do
299
310
continue
300
311
fi
301
312
313
+ if [ "\$ arg" = "-pthread" ]
314
+ then
315
+ if echo \$ CPU|grep -q mno-sign-ext
316
+ then
317
+ continue
318
+ fi
319
+ fi
320
+
321
+
302
322
# that is for some very bad setup.py behaviour regarding cross compiling.
303
323
# should not be needed ..
304
324
[ "\$ arg" = "-I/usr/include" ] && continue
365
385
fi
366
386
fi
367
387
else
368
- # pass CPU opts only when -c/-o but always PIC
369
- $EMSDK_PYTHON -E \$ 0.py \$ CPU_EXTRA -fpic \$ COPTS \$ CPPFLAGS -DBUILD_STATIC "\$ @" \$ COMMON
388
+ # do not pass WASM opts when -c/-o but always PIC
389
+ $EMSDK_PYTHON -E \$ 0.py $COPTS \$ CPU \$ CPPFLAGS -DBUILD_STATIC "\$ @" \$ COMMON
370
390
fi
371
391
#else
372
392
# unset _EMCC_CCACHE
0 commit comments