diff --git a/config/StdGNU.mk b/config/StdGNU.mk index 6be8233205..039274ea61 100644 --- a/config/StdGNU.mk +++ b/config/StdGNU.mk @@ -35,7 +35,3 @@ UTIL_LIBS = -lutil SONAME_LDFLAG = -soname SHLIB_LDFLAGS = -shared -ifeq ($(lto),y) -CFLAGS += -flto -LDFLAGS-$(clang) += -plugin LLVMgold.so -endif diff --git a/xen/Rules.mk b/xen/Rules.mk index 24d13dcad1..77bcd44922 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -120,6 +120,8 @@ $(filter-out %.init.o $(nogcov-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += - endif ifeq ($(CONFIG_LTO),y) +CFLAGS += -flto +LDFLAGS-$(clang) += -plugin LLVMgold.so # Would like to handle all object files as bitcode, but objects made from # pure asm are in a different format and have to be collected separately. # Mirror the directory tree, collecting them as built_in_bin.o.