Skip to content

Commit

Permalink
Fix parallel LTO issues on Windows
Browse files Browse the repository at this point in the history
This adds -save-temps to the linker flags when parallel LTO is used on
MinGW/MSYS.

fixes official-stockfish#2977

closes official-stockfish#2978

No functional change.
  • Loading branch information
gvreuls authored and Fanael committed Mar 7, 2021
1 parent 5da0f55 commit 5a344f1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,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)
Expand Down Expand Up @@ -473,7 +478,7 @@ objclean:
# clean auxiliary profiling files
profileclean:
@rm -rf profdir
@rm -f bench.txt *.gcda *.gcno
@rm -f bench.txt *.gcda *.gcno ./syzygy/*.gcda *.s
@rm -f stockfish.profdata *.profraw

default:
Expand Down

0 comments on commit 5a344f1

Please sign in to comment.