-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Workaround mingw-gcc LTO ICE by re-adding some dead code... #102506
Workaround mingw-gcc LTO ICE by re-adding some dead code... #102506
Conversation
// HACK: We don't want to run the simulator library generation code anymore after GH-102179, but removing it | ||
// triggers an internal compiler error with latest mingw-gcc... For now we bring it back as a workaround | ||
// with a condition that should never be true (that project setting doesn't exist). | ||
|
||
// Check and generate missing ARM64 simulator library. | ||
if (ProjectSettings::get_singleton()->has_setting("ios_generate_simulator_library_if_missing")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main difference with the previous code before #102179. Instead of checking a preset option (which #102179 removed), I'm checking a non-existing project setting. This should prevent the compiler from optimizing all this code away (it doesn't know that the project setting doesn't exist), but should also prevent it from running when exporting to iOS (unless a user decides to create this magic project setting manually).
This should really be a temporary hack (famous last words).
Note for when we revert this to replace it by a better fix: the |
Not my finest work, but without that code removed in godotengine#102179, mingw-gcc 14.2.1 on Fedora 41 (but also confirmed with versions on macOS and WSL) crashes when linking with LTO. We need to dig deeper to understand the bug, report it upstream and work it around in a cleaner way. But for now this unblocks building Windows binaries with LTO, and should be harmless.
b05b3ca
to
e12a424
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfection
Not my finest work, but without that code that was removed in #102179, mingw-gcc 14.2.1 on Fedora 41 (but also confirmed with versions on macOS and WSL) crashes when linking with LTO with the following command:
And this error:
We need to dig deeper to understand the bug, report it upstream and work it around in a cleaner way. But for now this unblocks building Windows binaries with LTO, and should be harmless. This could likely be made more minimal by cutting through the code I'm re-adding until it fails linking again, but it's pretty tedious and I need to start a 4.4.beta3 build now :)
I'll write a proper bug report tomorrow so we can keep tracking that issue and make sure to revert this hack and replace it by an actual fix.
More details in this Rocket.chat thread: https://chat.godotengine.org/channel/buildsystem?msg=3LzNsqenWK55Bb8gt