wasm: do not use clamp mode for upstream LLVM

Emscripten version 1.39.0 and above are based upon upstream LLVM, which
does not contain BINARYEN_TRAP_MODE

Fixes: QTBUG-80691
Change-Id: I6129f84a31a607c202e13847b50705ef1c809630
Reviewed-by: jian liang <jianliang79@gmail.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Lorn Potter 2019-12-12 09:38:20 +10:00
parent 98f19f0036
commit 868ded6d87
3 changed files with 29 additions and 25 deletions

View File

@ -1,25 +1,2 @@
load(default_pre)
defineReplace(qtEmccRecommendedVersion) {
return (1.38.27)
}
defineReplace(qtSystemEmccVersion) {
E_VERSION = $$system("emcc -v 2>&1 | perl -alne $$shell_quote($_ = $F[9]; s/://; print;) ")
return ($${E_VERSION})
}
defineTest(qtConfTest_emccVersion) {
REQ_VERSION = $$qtEmccRecommendedVersion()
EMCC_VERSION = $$qtSystemEmccVersion()
!defined(QT_EMCC_VERSION, var):!equals(EMCC_VERSION, $${REQ_VERSION}) {
warning ("You should use the recommended Emscripten version $$REQ_VERSION with this Qt. You have $${EMCC_VERSION} ")
}
contains(TEMPLATE, .*app) {
!equals(QT_EMCC_VERSION, $$EMCC_VERSION) {
warning("This Qt was built with Emscripten version $${QT_EMCC_VERSION}. You have $${EMCC_VERSION}. The difference may cause issues.")
}
}
}
load(emcc_ver)

View File

@ -0,0 +1,23 @@
defineReplace(qtEmccRecommendedVersion) {
return (1.38.27)
}
defineReplace(qtSystemEmccVersion) {
E_VERSION = $$system("emcc -v 2>&1 | perl -alne $$shell_quote($_ = $F[9]; s/://; print;) ")
return ($${E_VERSION})
}
defineTest(qtConfTest_emccVersion) {
REQ_VERSION = $$qtEmccRecommendedVersion()
EMCC_VERSION = $$qtSystemEmccVersion()
!defined(QT_EMCC_VERSION, var):!equals(EMCC_VERSION, $${REQ_VERSION}) {
warning ("You should use the recommended Emscripten version $$REQ_VERSION with this Qt. You have $${EMCC_VERSION} ")
}
contains(TEMPLATE, .*app) {
!equals(QT_EMCC_VERSION, $$EMCC_VERSION) {
warning("This Qt was built with Emscripten version $${QT_EMCC_VERSION}. You have $${EMCC_VERSION}. The difference may cause issues.")
}
}
}

View File

@ -6,6 +6,7 @@ include(../common/gcc-base.conf)
include(../common/clang.conf)
load(device_config)
load(emcc_ver)
# Support setting WASM_OBJECT_FILES with -device-option WASM_OBJECT_FILES=1
!isEmpty(WASM_OBJECT_FILES): {
@ -15,7 +16,10 @@ load(device_config)
QMAKE_CXXFLAGS += -s WASM_OBJECT_FILES=$$WASM_OBJECT_FILES
QMAKE_LFLAGS += -s WASM_OBJECT_FILES=$$WASM_OBJECT_FILES
} else {
EMCC_COMMON_LFLAGS += -s \"BINARYEN_TRAP_MODE=\'clamp\'\"
EMSCRIPTEN_VERSION=$$qtSystemEmccVersion()
lessThan(EMSCRIPTEN_VERSION, 1.39) {
EMCC_COMMON_LFLAGS += -s \"BINARYEN_TRAP_MODE=\'clamp\'\"
}
}
EMTERP_FLAGS = \