blob: de4056ae31ae43fbe0765a956954f48800eacaa7 [file] [log] [blame]
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Giuliano Procida <gprocida@google.com>
Date: Fri, 12 Mar 2021 09:19:08 +0000
Subject: ANDROID: Clang LTO: Only set -fvisibility=hidden for x86
Otherwise this upsets ABI monitoring as symbols are hidden and as such
do not get considered for ABI analysis.
Bug: 182194803
Bug: 203411090
Fixes: dc5723b02e52 ("kbuild: add support for Clang LTO")
Signed-off-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Matthias Maennich <maennich@google.com>
Change-Id: If6011ad739ecccd23a92cfa2f9fd43084f9a0b4f
---
Makefile | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -900,7 +900,13 @@ KBUILD_LDFLAGS += --thinlto-cache-dir=$(extmod_prefix).thinlto-cache
else
CC_FLAGS_LTO := -flto
endif
+
+ifeq ($(SRCARCH),x86)
+# Workaround for compiler / linker bug
CC_FLAGS_LTO += -fvisibility=hidden
+else
+CC_FLAGS_LTO += -fvisibility=default
+endif
# Limit inlining across translation units to reduce binary size
KBUILD_LDFLAGS += -mllvm -import-instr-limit=5