Skip to content

Commit 5d99f46

Browse files
akien-mgahpvb
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 45875c2 commit 5d99f46

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

platform/windows/detect.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,9 @@ def configure_mingw(env: "SConsEnvironment"):
779779
env.Append(CCFLAGS=["-flto"])
780780
env.Append(LINKFLAGS=["-flto=" + str(env.GetOption("num_jobs"))])
781781
else:
782-
env.Append(CCFLAGS=["-flto"])
783-
env.Append(LINKFLAGS=["-flto"])
782+
# For mingw-gcc LTO, disable linker plugin and enable whole program to work around GH-102867.
783+
env.Append(CCFLAGS=["-flto", "-fno-use-linker-plugin", "-fwhole-program"])
784+
env.Append(LINKFLAGS=["-flto", "-fno-use-linker-plugin", "-fwhole-program"])
784785

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

0 commit comments

Comments
 (0)