]> git.sesse.net Git - stockfish/commitdiff
Fix parallel LTO issues on Windows
authorGuy Vreuls <guyvreuls@gmail.com>
Tue, 11 Aug 2020 02:38:38 +0000 (04:38 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Tue, 11 Aug 2020 06:17:03 +0000 (08:17 +0200)
This adds -save-temps to the linker flags when parallel LTO is used on
MinGW/MSYS.

fixes #2977

closes https://github.com/official-stockfish/Stockfish/pull/2978

No functional change.

src/Makefile

index 3d84f4826547076ef241e5f07da09c231d63282b..fd2618a47b276de1cfbf902af607e41e49db1b14 100644 (file)
@@ -472,6 +472,11 @@ ifeq ($(debug), no)
        ifeq ($(gccisclang),)
                CXXFLAGS += -flto
                LDFLAGS += $(CXXFLAGS) -flto=jobserver
+               ifneq ($(findstring MINGW,$(KERNEL)),)
+                       LDFLAGS += -save-temps
+               else ifneq ($(findstring MSYS,$(KERNEL)),)
+                       LDFLAGS += -save-temps
+               endif
        else
                CXXFLAGS += -flto=thin
                LDFLAGS += $(CXXFLAGS)
@@ -605,7 +610,7 @@ objclean:
 # clean auxiliary profiling files
 profileclean:
        @rm -rf profdir
-       @rm -f bench.txt *.gcda *.gcno ./syzygy/*.gcda ./nnue/*.gcda ./nnue/features/*.gcda
+       @rm -f bench.txt *.gcda *.gcno ./syzygy/*.gcda ./nnue/*.gcda ./nnue/features/*.gcda *.s
        @rm -f stockfish.profdata *.profraw
 
 default: