From 9480844c7bf05d69a190870f1f062d5bc80a730f Mon Sep 17 00:00:00 2001 From: LoveSy Date: Sat, 8 Jan 2022 09:13:00 +0800 Subject: [PATCH] Use thinlto & enable lto cache (#1517) --- core/src/main/cpp/Application.mk | 4 ++-- daemon/src/main/cpp/Application.mk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/cpp/Application.mk b/core/src/main/cpp/Application.mk index 8787cc84..acaee188 100644 --- a/core/src/main/cpp/Application.mk +++ b/core/src/main/cpp/Application.mk @@ -7,9 +7,9 @@ APP_LDFLAGS := -Wl,--exclude-libs,ALL APP_STL := none ifneq ($(NDK_DEBUG),1) -APP_CFLAGS += -Oz -flto +APP_CFLAGS += -Oz -flto=thin APP_CFLAGS += -Wno-unused -Wno-unused-parameter -Werror APP_CFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden APP_CFLAGS += -fno-unwind-tables -fno-asynchronous-unwind-tables -APP_LDFLAGS += -flto -Wl,--gc-sections -Wl,--strip-all +APP_LDFLAGS += -flto=thin -Wl,--thinlto-cache-policy,cache_size_bytes=300m -Wl,--thinlto-cache-dir=build/.lto-cache -Wl,--gc-sections -Wl,--strip-all endif diff --git a/daemon/src/main/cpp/Application.mk b/daemon/src/main/cpp/Application.mk index 8787cc84..c9ca3a6e 100644 --- a/daemon/src/main/cpp/Application.mk +++ b/daemon/src/main/cpp/Application.mk @@ -7,9 +7,9 @@ APP_LDFLAGS := -Wl,--exclude-libs,ALL APP_STL := none ifneq ($(NDK_DEBUG),1) -APP_CFLAGS += -Oz -flto +APP_CFLAGS += -Oz -flto=thin APP_CFLAGS += -Wno-unused -Wno-unused-parameter -Werror APP_CFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden APP_CFLAGS += -fno-unwind-tables -fno-asynchronous-unwind-tables -APP_LDFLAGS += -flto -Wl,--gc-sections -Wl,--strip-all +APP_LDFLAGS += -flto=thin -Wl,--thinlto-cache-policy,cache_size_bytes=10m -Wl,--thinlto-cache-dir=build/.lto-cache -Wl,--gc-sections -Wl,--strip-all endif