From e4cdd74f02eaeea96348dc51534eff8e03d87697 Mon Sep 17 00:00:00 2001 From: Tim Deegan Date: Mon, 7 Mar 2011 11:34:09 +0000 Subject: xen: add "lto=y" option to build Xen with link-time optimizations. This involves gathering object files from .asm (which will be binary) and object files from .c (which will be in LTO format) separately until the final link. Only tested for x86_64 Xen builds using Clang/LLVM bitcode; it should be possible to do the same with newer GCCs and GIMPLE. Signed-off-by: Tim Deegan Acked-by: Keir Fraser --- config/StdGNU.mk | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/StdGNU.mk b/config/StdGNU.mk index d73e644bbf..786efd7e20 100644 --- a/config/StdGNU.mk +++ b/config/StdGNU.mk @@ -1,10 +1,11 @@ AS = $(CROSS_COMPILE)as +LD = $(CROSS_COMPILE)ld ifeq ($(clang),y) -LD = $(CROSS_COMPILE)gold CC = $(CROSS_COMPILE)clang +LD_LTO = $(CROSS_COMPILE)llvm-ld else -LD = $(CROSS_COMPILE)ld CC = $(CROSS_COMPILE)gcc +LD_LTO = $(CROSS_COMPILE)ld endif CPP = $(CC) -E AR = $(CROSS_COMPILE)ar @@ -79,3 +80,10 @@ ifneq ($(clang),y) CFLAGS += -fno-optimize-sibling-calls endif endif + +ifeq ($(lto),y) +CFLAGS += -flto +ifeq ($(clang),y) +LDFLAGS += -plugin LLVMgold.so +endif +endif -- cgit v1.2.3