Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web: Workaround Emscripten 3.1.42+ LTO regression #81340

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't strictly needed, just a drive-by change as Ubuntu 20.04 will be EOL'ed by GH Actions eventually, and we have no reason to stick to the old version for Web builds.

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):
Comment on lines +122 to +124
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll refactor this logic in #80719 after this is merged.

Copy link
Member Author

@akien-mga akien-mga Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed in the 3.x branch that we use tuple(get_compiler_version(env)) there, which is nicer. I'm changing it to that when cherry-picking, and for master I'll refactor later.

Edit: That can't be done for 4.x, there's more than just (major, minor, patch) in the dict.

env.Append(LINKFLAGS=["-Wl,-u,scalbnf"])

# Sanitizers
if env["use_ubsan"]:
Expand Down