From ca51b456493a4663b2d0f82273f67a3e499244a1 Mon Sep 17 00:00:00 2001 From: George Sobala Date: Mon, 13 Dec 2021 16:05:35 +0000 Subject: [PATCH] Fixes build failure on Apple M1 Silicon This pull request selectively avoids `-mdynamic-no-pic` for gcc on Apple Silicon (there was no problem with the default clang compiler). fixes https://github.com/official-stockfish/Stockfish/issues/3847 closes https://github.com/official-stockfish/Stockfish/pull/3850 No functional change --- src/Makefile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Makefile b/src/Makefile index 5e263772..f00df79f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -522,11 +522,17 @@ ifeq ($(optimize),yes) endif endif - ifeq ($(comp),$(filter $(comp),gcc clang icc)) - ifeq ($(KERNEL),Darwin) - CXXFLAGS += -mdynamic-no-pic - endif - endif + ifeq ($(KERNEL),Darwin) + ifeq ($(comp),$(filter $(comp),clang icc)) + CXXFLAGS += -mdynamic-no-pic + endif + + ifeq ($(comp),gcc) + ifneq ($(arch),arm64) + CXXFLAGS += -mdynamic-no-pic + endif + endif + endif ifeq ($(comp),clang) CXXFLAGS += -fexperimental-new-pass-manager -- 2.39.2