Skip to content

Commit 4ab8b0b

Browse files
gvreulsvondele
authored andcommitted
Fix parallel LTO issues on Windows
This adds -save-temps to the linker flags when parallel LTO is used on MinGW/MSYS. fixes #2977 closes #2978 No functional change.
1 parent a72cec1 commit 4ab8b0b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,11 @@ ifeq ($(debug), no)
472472
ifeq ($(gccisclang),)
473473
CXXFLAGS += -flto
474474
LDFLAGS += $(CXXFLAGS) -flto=jobserver
475+
ifneq ($(findstring MINGW,$(KERNEL)),)
476+
LDFLAGS += -save-temps
477+
else ifneq ($(findstring MSYS,$(KERNEL)),)
478+
LDFLAGS += -save-temps
479+
endif
475480
else
476481
CXXFLAGS += -flto=thin
477482
LDFLAGS += $(CXXFLAGS)
@@ -605,7 +610,7 @@ objclean:
605610
# clean auxiliary profiling files
606611
profileclean:
607612
@rm -rf profdir
608-
@rm -f bench.txt *.gcda *.gcno ./syzygy/*.gcda ./nnue/*.gcda ./nnue/features/*.gcda
613+
@rm -f bench.txt *.gcda *.gcno ./syzygy/*.gcda ./nnue/*.gcda ./nnue/features/*.gcda *.s
609614
@rm -f stockfish.profdata *.profraw
610615

611616
default:

0 commit comments

Comments
 (0)