mirror of
https://github.com/sockspls/badfish
synced 2025-06-28 00:19:50 +00:00
Fix for profile-build failure using gcc on MacOS
Fixes https://github.com/official-stockfish/Stockfish/issues/3846 , where the profiling SF binary generated by GCC on MacOS would launch but failed to quit. Tested with gcc-8, gcc9, gcc10, gcc-11. The problem can be fixed by adding -fvisibility=hidden to the compiler flags, see for example the following piece of Apple documentation: https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html For instance this now works: make -j8 profile-build ARCH=x86-64-avx2 COMP=gcc COMPCXX=g++-11 No functional change
This commit is contained in:
parent
dc5d9bdfee
commit
939b694bfd
1 changed files with 5 additions and 0 deletions
|
@ -459,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
|
||||
|
@ -920,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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue