Skip to content

Commit 7b1615b

Browse files
akien-mgahpvb
authored andcommitted
Windows: Configure MinGW LTO with -fno-use-linker-plugin -fwhole-program
- Works around and closes godotengine#102867. - Works around and closes godotengine#102982. Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
1 parent 9d093cd commit 7b1615b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

platform/windows/detect.py

+4
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,10 @@ def configure_mingw(env: "SConsEnvironment"):
781781
else:
782782
env.Append(CCFLAGS=["-flto"])
783783
env.Append(LINKFLAGS=["-flto"])
784+
if not env["use_llvm"]:
785+
# For mingw-gcc LTO, disable linker plugin and enable whole program to work around GH-102867.
786+
env.Append(CCFLAGS=["-fno-use-linker-plugin", "-fwhole-program"])
787+
env.Append(LINKFLAGS=["-fno-use-linker-plugin", "-fwhole-program"])
784788

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

0 commit comments

Comments
 (0)