]> git.sesse.net Git - stockfish/blobdiff - src/Makefile
Fix for profile-build failure using gcc on MacOS
[stockfish] / src / Makefile
index a9333a22f46b7ac0928acf7ddfed53cd53257bb6..5e2637729a192f6b32d14eb12ee3f7b2a021371d 100644 (file)
@@ -128,6 +128,7 @@ avx512 = no
 vnni256 = no
 vnni512 = no
 neon = no
+arm_version = 0
 STRIP = strip
 
 ### 2.2 Architecture specific
@@ -275,6 +276,7 @@ ifeq ($(ARCH),armv7)
        arch = armv7
        prefetch = yes
        bits = 32
+       arm_version = 7
 endif
 
 ifeq ($(ARCH),armv7-neon)
@@ -283,6 +285,7 @@ ifeq ($(ARCH),armv7-neon)
        popcnt = yes
        neon = yes
        bits = 32
+       arm_version = 7
 endif
 
 ifeq ($(ARCH),armv8)
@@ -290,6 +293,7 @@ ifeq ($(ARCH),armv8)
        prefetch = yes
        popcnt = yes
        neon = yes
+       arm_version = 8
 endif
 
 ifeq ($(ARCH),apple-silicon)
@@ -297,6 +301,7 @@ ifeq ($(ARCH),apple-silicon)
        prefetch = yes
        popcnt = yes
        neon = yes
+       arm_version = 8
 endif
 
 ifeq ($(ARCH),ppc-32)
@@ -454,6 +459,9 @@ else ifeq ($(comp),clang)
 else
        profile_make = gcc-profile-make
        profile_use = gcc-profile-use
+       ifeq ($(KERNEL),Darwin)
+               EXTRAPROFILEFLAGS = -fvisibility=hidden
+       endif
 endif
 
 ### Travis CI script uses COMPILER to overwrite CXX
@@ -614,7 +622,7 @@ ifeq ($(mmx),yes)
 endif
 
 ifeq ($(neon),yes)
-       CXXFLAGS += -DUSE_NEON
+       CXXFLAGS += -DUSE_NEON=$(arm_version)
        ifeq ($(KERNEL),Linux)
        ifneq ($(COMP),ndk)
        ifneq ($(arch),armv8)
@@ -863,6 +871,7 @@ config-sanity: net
        @echo "vnni256: '$(vnni256)'"
        @echo "vnni512: '$(vnni512)'"
        @echo "neon: '$(neon)'"
+       @echo "arm_version: '$(arm_version)'"
        @echo ""
        @echo "Flags:"
        @echo "CXX: $(CXX)"
@@ -914,12 +923,14 @@ gcc-profile-make:
        @mkdir -p profdir
        $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
        EXTRACXXFLAGS='-fprofile-generate=profdir' \
+       EXTRACXXFLAGS+=$(EXTRAPROFILEFLAGS) \
        EXTRALDFLAGS='-lgcov' \
        all
 
 gcc-profile-use:
        $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
        EXTRACXXFLAGS='-fprofile-use=profdir -fno-peel-loops -fno-tracer' \
+       EXTRACXXFLAGS+=$(EXTRAPROFILEFLAGS) \
        EXTRALDFLAGS='-lgcov' \
        all