From c88a8f96b478cc92623853b2bb26818b888e311a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 5 Sep 2023 14:56:53 +0200 Subject: [PATCH] Web: Workaround Emscripten 3.1.42+ LTO regression Fixes #80010. (cherry picked from commit b064008c07be856d6f3a5079d11746137e03ede5) --- .github/workflows/javascript_builds.yml | 4 ++-- platform/javascript/detect.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/javascript_builds.yml b/.github/workflows/javascript_builds.yml index 5bed2812149..bc1237ace64 100644 --- a/.github/workflows/javascript_builds.yml +++ b/.github/workflows/javascript_builds.yml @@ -7,7 +7,7 @@ env: # Only used for the cache key. Increment version to force clean build. GODOT_BASE_BRANCH: 3.x SCONSFLAGS: verbose=yes warnings=all werror=yes debug_symbols=no - EM_VERSION: 3.1.18 + EM_VERSION: 3.1.45 EM_CACHE_FOLDER: "emsdk-cache" concurrency: @@ -16,7 +16,7 @@ concurrency: jobs: javascript-template: - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" name: Template (target=release, tools=no) steps: diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index b32133e3326..046f0c53e11 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -111,6 +111,10 @@ def configure(env): else: env.Append(CCFLAGS=["-flto"]) env.Append(LINKFLAGS=["-flto"]) + # Workaround https://github.com/emscripten-core/emscripten/issues/19781. + cc_semver = tuple(get_compiler_version(env)) + if cc_semver >= (3, 1, 42): + env.Append(LINKFLAGS=["-Wl,-u,scalbnf"]) # Sanitizers if env["use_ubsan"]: