From 427fcdbdcae89b883bc907240ddb997c8aa92148 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Thu, 25 Jul 2024 16:02:14 -0400 Subject: [PATCH] build: -flto all the things. --- GNUmakefile | 12 +++++++----- tools/ssl-android | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index b3da932a..ca30e195 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -57,7 +57,11 @@ CFLAGS += \ -ffunction-sections \ -fdata-sections \ -fno-exceptions \ - -g + -g \ + -flto +LDFLAGS += \ + -flto \ + -Wno-attributes ANDROID_MIN_SDK_VERSION := 24 ANDROID_TARGET_SDK_VERSION := 34 @@ -178,13 +182,11 @@ $(WINDOWS_TARGETS): CFLAGS += \ -D_WIN32_WINNT=0x0A00 \ -DWINVER=0x0A00 \ -DNTDDI_VERSION=NTDDI_WIN10 \ - -Ideps/openssl/mingw64/usr/local/include \ - -flto + -Ideps/openssl/mingw64/usr/local/include $(WINDOWS_TARGETS): LDFLAGS += \ -static \ -lm \ - -Ldeps/openssl/mingw64/usr/local/lib \ - -flto + -Ldeps/openssl/mingw64/usr/local/lib ifeq ($(UNAME_S),Darwin) $(MACOS_TARGETS): CC = xcrun clang $(IOS_TARGETS): IOS_SYSROOT := $(shell xcrun --sdk iphoneos --show-sdk-path) diff --git a/tools/ssl-android b/tools/ssl-android index 19aa9393..b7815ec1 100755 --- a/tools/ssl-android +++ b/tools/ssl-android @@ -68,7 +68,8 @@ build_the_thing() { no-weak-ssl-ciphers no-zlib -Os - -DOPENSSL_SMALL_FOOTPRINT" + -DOPENSSL_SMALL_FOOTPRINT + -flto" pwd echo "./Configure $SSL_TARGET $OPTIONS $GLOBAL_OPTIONS" && \ ./Configure $SSL_TARGET $OPTIONS $GLOBAL_OPTIONS && \