From 850aaa0fb43f64a2d9cf5160fd6c54dd552cd6a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 11 Feb 2019 18:36:40 +0100 Subject: wasm: disable MOTH_COMPUTED_GOTO for stock llvm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The WASM_OBJECT_FILES=1 build mode requires using upstream llvm (instead of the of the emscripten ‘fastcomp’ llvm fork), which does not support computed goto. Change-Id: Ie47b29ac8a09f4bd2519fc55087e4803e66e9520 Reviewed-by: Ulf Hermann Reviewed-by: Lorn Potter --- src/qml/compiler/qv4instr_moth_p.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index 080f4b42b6..3996143843 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -346,12 +346,18 @@ QT_BEGIN_NAMESPACE #define MOTH_NUM_INSTRUCTIONS() (static_cast(Moth::Instr::Type::Debug_Wide) + 1) -#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) +#if defined(Q_CC_GNU) +#if defined(Q_CC_INTEL) // icc before version 1200 doesn't support computed goto, and at least up to version 18.0.0 the // current use results in an internal compiler error. We could enable this if/when it gets fixed // in a later version. +# elif defined(Q_OS_WASM) && !defined(__asmjs) +// Upstream llvm does not support computed goto for the wasm target, unlike the 'fastcomp' llvm fork +// shipped with the emscripten SDK. Disable computed goto usage for non-fastcomp llvm on Wasm. +#else # define MOTH_COMPUTED_GOTO #endif +#endif #define MOTH_INSTR_ALIGN_MASK (Q_ALIGNOF(QV4::Moth::Instr) - 1) -- cgit v1.2.3