From 150082a57fca1682149266bf994d0c5de09eca4c Mon Sep 17 00:00:00 2001 From: Peter Osterlund Date: Sun, 20 Sep 2020 08:06:18 +0200 Subject: [PATCH] Compile Stockfish with LTO for all CPU types Use link time optimization when compiling Stockfish for all CPU types. --- DroidFishApp/src/main/cpp/stockfish/Android.mk | 2 +- DroidFishApp/src/main/cpp/stockfish/build_sf.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DroidFishApp/src/main/cpp/stockfish/Android.mk b/DroidFishApp/src/main/cpp/stockfish/Android.mk index ad8f226..72c7aff 100644 --- a/DroidFishApp/src/main/cpp/stockfish/Android.mk +++ b/DroidFishApp/src/main/cpp/stockfish/Android.mk @@ -12,7 +12,7 @@ ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) MY_ARCH_DEF += -DUSE_NEON -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon endif ifeq ($(TARGET_ARCH_ABI),arm64-v8a) - MY_ARCH_DEF += -DIS_64BIT -DUSE_POPCNT -DUSE_NEON -flto=thin + MY_ARCH_DEF += -DIS_64BIT -DUSE_POPCNT -DUSE_NEON endif ifeq ($(TARGET_ARCH_ABI),x86_64) MY_ARCH_DEF += -DIS_64BIT -DUSE_SSE41 -msse4.1 diff --git a/DroidFishApp/src/main/cpp/stockfish/build_sf.mk b/DroidFishApp/src/main/cpp/stockfish/build_sf.mk index 305cc3f..7360dfb 100644 --- a/DroidFishApp/src/main/cpp/stockfish/build_sf.mk +++ b/DroidFishApp/src/main/cpp/stockfish/build_sf.mk @@ -1,5 +1,5 @@ LOCAL_SRC_FILES := $(SF_SRC_FILES) LOCAL_CFLAGS := -std=c++17 -O3 -fno-exceptions -DNNUE_EMBEDDING_OFF -DUSE_PTHREADS \ - -fPIE $(MY_ARCH_DEF) -s + -fPIE $(MY_ARCH_DEF) -s -flto=thin LOCAL_LDFLAGS += -fPIE -s -flto=thin include $(BUILD_EXECUTABLE)