diff --git a/Makefile b/Makefile index c67f16fdad8d..addc04d73bcc 100644 --- a/Makefile +++ b/Makefile @@ -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