From 4fc0f8754ce41733057ee28f5face63bfb51f4dd Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Sun, 20 Jun 2021 23:56:03 +0800 Subject: [PATCH] [core] Enable LTO (#758) * Update dobby * Enable LTO --- core/build.gradle.kts | 2 +- core/src/main/cpp/Application.mk | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/build.gradle.kts b/core/build.gradle.kts index a689a5d8..dde9eb11 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -58,7 +58,7 @@ val verName: String by rootProject.extra dependencies { implementation("dev.rikka.ndk:riru:${moduleMinRiruVersionName}") implementation("dev.rikka.ndk.thirdparty:cxx:1.1.0") - implementation("io.github.vvb2060.ndk:dobby:1.0") + implementation("io.github.vvb2060.ndk:dobby:1.2") implementation("com.android.tools.build:apksig:7.0.0-beta03") implementation("org.apache.commons:commons-lang3:3.12.0") implementation("de.upb.cs.swt:axml:2.1.1") diff --git a/core/src/main/cpp/Application.mk b/core/src/main/cpp/Application.mk index d538dcca..8787cc84 100644 --- a/core/src/main/cpp/Application.mk +++ b/core/src/main/cpp/Application.mk @@ -7,8 +7,9 @@ APP_LDFLAGS := -Wl,--exclude-libs,ALL APP_STL := none ifneq ($(NDK_DEBUG),1) -APP_CFLAGS += -Oz -Wno-unused -Wno-unused-parameter -Werror +APP_CFLAGS += -Oz -flto +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 += -Wl,--gc-sections -Wl,--strip-all +APP_LDFLAGS += -flto -Wl,--gc-sections -Wl,--strip-all endif