Skip to content

Commit

Permalink
Windows: Configure MinGW LTO with `-fno-use-linker-plugin -fwhole-pro…
Browse files Browse the repository at this point in the history
…gram`

- Works around and closes godotengine#102867.
- Works around and closes godotengine#102982.

Co-authored-by: Hein-Pieter van Braam-Stewart <[email protected]>
  • Loading branch information
akien-mga and hpvb committed Feb 20, 2025
1 parent fe799de commit 26fd345
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions platform/windows/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,10 @@ def configure_mingw(env: "SConsEnvironment"):
else:
env.Append(CCFLAGS=["-flto"])
env.Append(LINKFLAGS=["-flto"])
if not env["use_llvm"]:
# For mingw-gcc LTO, disable linker plugin and enable whole program to work around GH-102867.
env.Append(CCFLAGS=["-fno-use-linker-plugin", "-fwhole-program"])
env.Append(LINKFLAGS=["-fno-use-linker-plugin", "-fwhole-program"])

if env["use_asan"]:
env.Append(LINKFLAGS=["-Wl,--stack," + str(STACK_SIZE_SANITIZERS)])
Expand Down

0 comments on commit 26fd345

Please sign in to comment.