Web: Fix version check for missing scalbnf LTO workaround
The check needs to happen after we set `env["CXX"]`. Follow-up to #81340.
This commit is contained in:
parent
e3e2528ba7
commit
50161808c2
1 changed files with 9 additions and 7 deletions
|
@ -118,11 +118,6 @@ def configure(env: "Environment"):
|
|||
else:
|
||||
env.Append(CCFLAGS=["-flto"])
|
||||
env.Append(LINKFLAGS=["-flto"])
|
||||
# Workaround https://github.com/emscripten-core/emscripten/issues/19781.
|
||||
cc_version = get_compiler_version(env)
|
||||
cc_semver = (int(cc_version["major"]), int(cc_version["minor"]), int(cc_version["patch"]))
|
||||
if cc_semver >= (3, 1, 42):
|
||||
env.Append(LINKFLAGS=["-Wl,-u,scalbnf"])
|
||||
|
||||
# Sanitizers
|
||||
if env["use_ubsan"]:
|
||||
|
@ -204,9 +199,16 @@ def configure(env: "Environment"):
|
|||
env.Append(LINKFLAGS=["-s", "PTHREAD_POOL_SIZE=8"])
|
||||
env.Append(LINKFLAGS=["-s", "WASM_MEM_MAX=2048MB"])
|
||||
|
||||
if env["dlink_enabled"]:
|
||||
# Get version info for checks below.
|
||||
cc_version = get_compiler_version(env)
|
||||
cc_semver = (int(cc_version["major"]), int(cc_version["minor"]), int(cc_version["patch"]))
|
||||
|
||||
if env["lto"] != "none":
|
||||
# Workaround https://github.com/emscripten-core/emscripten/issues/19781.
|
||||
if cc_semver >= (3, 1, 42) and cc_semver < (3, 1, 46):
|
||||
env.Append(LINKFLAGS=["-Wl,-u,scalbnf"])
|
||||
|
||||
if env["dlink_enabled"]:
|
||||
if cc_semver < (3, 1, 14):
|
||||
print("GDExtension support requires emscripten >= 3.1.14, detected: %s.%s.%s" % cc_semver)
|
||||
sys.exit(255)
|
||||
|
|
Loading…
Reference in a new issue