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: dc5723b02e ("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
This commit is contained in:
Giuliano Procida
2021-03-12 09:19:08 +00:00
committed by Matthias Maennich
parent 839c8821c7
commit 5e93939f6d

View File

@@ -952,7 +952,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