From d766c33f594ec7527b5bb3a13955fd3a01937c9c Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sun, 26 Jan 2025 09:56:53 -0500 Subject: [PATCH] build: Stop using lto. Not worth the hassle. --- GNUmakefile | 13 +++++-------- tools/ssl-android | 3 +-- tools/ssl-mingw64 | 1 - 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 29f7c9be..6eac30b3 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -83,8 +83,7 @@ CFLAGS += \ -g LDFLAGS += \ -Wno-attributes \ - -Wno-aggressive-loop-optimizations \ - -flto=auto + -Wno-aggressive-loop-optimizations ANDROID_MIN_SDK_VERSION := 24 ANDROID_TARGET_SDK_VERSION := 34 @@ -211,8 +210,7 @@ $(ANDROID_TARGETS): LDFLAGS += --sysroot $(ANDROID_NDK)/toolchains/llvm/prebuilt $(DEBUG_TARGETS): CFLAGS += -DDEBUG -Og $(DEBUG_TARGETS): LDFLAGS += -Og $(RELEASE_TARGETS): CFLAGS += \ - -DNDEBUG \ - -flto + -DNDEBUG $(ANDROID_RELEASE_TARGETS): CFLAGS += -Oz $(ANDROID_RELEASE_TARGETS): LDFLAGS += -Oz $(NONANDROID_RELEASE_TARGETS): CFLAGS += -Os @@ -562,7 +560,6 @@ $(UV_OBJS): CFLAGS += \ -Wno-unused-result \ -Wno-unused-variable \ -Wno-nonnull -$(UV_OBJS): CFLAGS += -fno-lto $(filter out/win%,$(UV_OBJS)): \ CFLAGS += \ -Wno-cast-function-type \ @@ -1146,13 +1143,13 @@ $(filter $(BUILD_DIR)/android%,$(APP_OBJS)): | $(ANDROID_DEPS) ifeq ($(UNAME_S),Linux) LOCAL_DEPS := deps/openssl/$(UNAME_S)/$(UNAME_M)/usr/local/lib/libssl.a $(LOCAL_DEPS): - +@OPTIONS="-flto -ffat-lto-objects" tools/ssl-local + +@tools/ssl-local $(filter $(BUILD_DIR)/debug/%,$(APP_OBJS)) $(filter $(BUILD_DIR)/release/%,$(APP_OBJS)): | $(LOCAL_DEPS) ifeq ($(HAVE_CROSS_AARCH64),1) LOCAL_DEPS := deps/openssl/$(UNAME_S)/aarch64/usr/local/lib/libssl.a $(LOCAL_DEPS): - +@OPTIONS="--cross-compile-prefix=aarch64-linux-gnu- -flto -ffat-lto-objects" BUILD_TARGET=aarch64 tools/ssl-local + +@OPTIONS="--cross-compile-prefix=aarch64-linux-gnu-" BUILD_TARGET=aarch64 tools/ssl-local $(filter $(BUILD_DIR)/armdebug/%,$(APP_OBJS)) $(filter $(BUILD_DIR)/armrelease/%,$(APP_OBJS)): | $(LOCAL_DEPS) endif @@ -1175,7 +1172,7 @@ endif ifeq ($(UNAME_S),Darwin) LOCAL_DEPS := deps/openssl/$(UNAME_S)/$(UNAME_M)/usr/local/lib/libssl.a $(LOCAL_DEPS): - +@OPTIONS=-flto tools/ssl-local + +@tools/ssl-local $(filter $(BUILD_DIR)/macosdebug/%,$(APP_OBJS)) $(filter $(BUILD_DIR)/macosrelease/%,$(APP_OBJS)): | $(LOCAL_DEPS) endif diff --git a/tools/ssl-android b/tools/ssl-android index 8fd9cb90..6899c840 100755 --- a/tools/ssl-android +++ b/tools/ssl-android @@ -76,8 +76,7 @@ build_the_thing() { -Oz -DOPENSSL_SMALL_FOOTPRINT -ffunction-sections - -fdata-sections - -flto" + -fdata-sections" pwd echo "./Configure $SSL_TARGET $OPTIONS $GLOBAL_OPTIONS" && \ ./Configure $SSL_TARGET $OPTIONS $GLOBAL_OPTIONS && \ diff --git a/tools/ssl-mingw64 b/tools/ssl-mingw64 index d75c6545..6ea331d8 100755 --- a/tools/ssl-mingw64 +++ b/tools/ssl-mingw64 @@ -59,7 +59,6 @@ build_the_thing() { -Os -ffunction-sections -fdata-sections - -flto -DOPENSSL_SMALL_FOOTPRINT" echo "./Configure $SSL_TARGET $OPTIONS $GLOBAL_OPTIONS" && \ ./Configure $SSL_TARGET $OPTIONS $GLOBAL_OPTIONS && \