From: mstembera Date: Mon, 31 Aug 2020 03:48:10 +0000 (-0700) Subject: Use llvm linker with clang on windows for LTO. X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=a057f170c6920fc4d1abdae619c5259e9d80703c Use llvm linker with clang on windows for LTO. other linkers might fail to link during the LTO phase. The linker might have to be installed using `pacman -Syu mingw-w64-x86_64-lld` closes https://github.com/official-stockfish/Stockfish/pull/3084 No functional change. --- diff --git a/src/Makefile b/src/Makefile index 9ae5a51c..340b3008 100644 --- a/src/Makefile +++ b/src/Makefile @@ -595,6 +595,11 @@ ifeq ($(debug), no) LDFLAGS += $(CXXFLAGS) else ifeq ($(comp),clang) CXXFLAGS += -flto=thin + ifneq ($(findstring MINGW,$(KERNEL)),) + CXXFLAGS += -fuse-ld=lld + else ifneq ($(findstring MSYS,$(KERNEL)),) + CXXFLAGS += -fuse-ld=lld + endif LDFLAGS += $(CXXFLAGS) # GCC and CLANG use different methods for parallelizing LTO and CLANG pretends to be