]> git.sesse.net Git - stockfish/commitdiff
Use llvm linker with clang on windows for LTO.
authormstembera <MissingEmail@email>
Mon, 31 Aug 2020 03:48:10 +0000 (20:48 -0700)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Tue, 1 Sep 2020 07:26:08 +0000 (09:26 +0200)
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.

src/Makefile

index 9ae5a51c5df85ca86b278fb69769748674644248..340b3008381be752d1d9edf1cd3020bffd323961 100644 (file)
@@ -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