Skip to content

Commit

Permalink
Web: Workaround Emscripten 3.1.42+ LTO regression
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga committed Sep 5, 2023
1 parent e720842 commit b064008
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/web_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no
EM_VERSION: 3.1.18
EM_VERSION: 3.1.45
EM_CACHE_FOLDER: "emsdk-cache"

concurrency:
Expand All @@ -16,7 +16,7 @@ concurrency:

jobs:
web-template:
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-22.04"
name: Template (target=template_release)

steps:
Expand Down
5 changes: 5 additions & 0 deletions platform/web/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ 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"]:
Expand Down

0 comments on commit b064008

Please sign in to comment.