]> git.sesse.net Git - stockfish/blobdiff - src/Makefile
Enable New Pass Manager for Clang.
[stockfish] / src / Makefile
index 54868b39b4682e8c0788cb33ebae04bb9da46756..1ff03f8391acca25bc4e3c5af9938d3408aa062d 100644 (file)
@@ -366,9 +366,11 @@ ifeq ($(COMP),clang)
 
        ifneq ($(KERNEL),Darwin)
        ifneq ($(KERNEL),OpenBSD)
+       ifneq ($(KERNEL),FreeBSD)
                LDFLAGS += -latomic
        endif
        endif
+       endif
 
        ifeq ($(arch),$(filter $(arch),armv7 armv8))
                ifeq ($(OS),Android)
@@ -479,6 +481,10 @@ ifeq ($(optimize),yes)
                        CXXFLAGS += -mdynamic-no-pic
                endif
        endif
+
+       ifeq ($(comp),clang)
+               CXXFLAGS += -fexperimental-new-pass-manager
+       endif
 endif
 
 ### 3.4 Bits
@@ -588,7 +594,7 @@ endif
 ifeq ($(optimize),yes)
 ifeq ($(debug), no)
        ifeq ($(comp),clang)
-               CXXFLAGS += -flto=thin
+               CXXFLAGS += -flto
                ifneq ($(findstring MINGW,$(KERNEL)),)
                        CXXFLAGS += -fuse-ld=lld
                else ifneq ($(findstring MSYS,$(KERNEL)),)
@@ -608,7 +614,7 @@ ifeq ($(debug), no)
                        LDFLAGS += -save-temps
                endif
        else
-               CXXFLAGS += -flto=thin
+               CXXFLAGS += -flto
                LDFLAGS += $(CXXFLAGS)
        endif
 
@@ -711,7 +717,7 @@ endif
         config-sanity icc-profile-use icc-profile-make gcc-profile-use gcc-profile-make \
         clang-profile-use clang-profile-make
 
-build: config-sanity net
+build: net config-sanity
        $(MAKE) ARCH=$(ARCH) COMP=$(COMP) all
 
 profile-build: net config-sanity objclean profileclean
@@ -784,7 +790,7 @@ default:
 
 all: $(EXE) .depend
 
-config-sanity:
+config-sanity: net
        @echo ""
        @echo "Config:"
        @echo "debug: '$(debug)'"