xen: convert lto to Kconfig option
authorWei Liu <wei.liu2@citrix.com>
Mon, 5 Dec 2016 14:39:55 +0000 (14:39 +0000)
committerWei Liu <wei.liu2@citrix.com>
Tue, 6 Dec 2016 09:57:21 +0000 (09:57 +0000)
Introduce CONFIG_LTO in Kconfig. Since this is the last option to be
converted to Kconfig, delete the preceding comment in Rules.mk as well.

Make it depend on BROKEN because it doesn't work at the moment.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
xen/Kconfig
xen/Rules.mk
xen/arch/arm/Makefile
xen/arch/x86/Makefile

index 5515fe9e1916afb299cb372db17620264580ed19..65d491d7762fd06d24f6f865b44f1372bb840c4f 100644 (file)
@@ -30,4 +30,12 @@ config EXPERT
        string
        option env="XEN_CONFIG_EXPERT"
 
+config LTO
+       bool "Link Time Optimisation"
+       depends on BROKEN
+       ---help---
+         Enable Link Time Optimisation.
+
+         If unsure, say N.
+
 source "Kconfig.debug"
index 08cc776ebcdd55b84b20d62bf1898d36f0298a18..24d13dcad1256afdf024f8dfa4cad623bb86b4e5 100644 (file)
@@ -1,10 +1,4 @@
 
-#
-# If you change any of these configuration options then you must
-# 'make clean' before rebuilding.
-#
-lto           ?= n
-
 -include $(BASEDIR)/include/config/auto.conf
 
 include $(XEN_ROOT)/Config.mk
@@ -125,7 +119,7 @@ ifeq ($(CONFIG_GCOV),y)
 $(filter-out %.init.o $(nogcov-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -fprofile-arcs -ftest-coverage
 endif
 
-ifeq ($(lto),y)
+ifeq ($(CONFIG_LTO),y)
 # 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.
@@ -144,7 +138,7 @@ built_in.o: $(obj-y)
 ifeq ($(obj-y),)
        $(CC) $(CFLAGS) -c -x c /dev/null -o $@
 else
-ifeq ($(lto),y)
+ifeq ($(CONFIG_LTO),y)
        $(LD_LTO) -r -o $@ $^
 else
        $(LD) $(LDFLAGS) -r -o $@ $^
index da39d3919d844c356e93f4493746a510036e5c42..f165178ab82232d94c1aaeb208e85d819822d3b8 100644 (file)
@@ -81,7 +81,7 @@ $(TARGET).axf: $(TARGET)-syms
        $(OBJCOPY) --change-addresses +0x80000000 $< $@
        $(STRIP) $@
 
-ifeq ($(lto),y)
+ifeq ($(CONFIG_LTO),y)
 # Gather all LTO objects together
 prelink_lto.o: $(ALL_OBJS)
        $(LD_LTO) -r -o $@ $^
index 931917d1d305af9016b1cc058831af76b0b72efe..fdcf9770c3737c53a4f983c5eb1cac6527f345d0 100644 (file)
@@ -95,7 +95,7 @@ $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
 
 ALL_OBJS := $(BASEDIR)/arch/x86/boot/built_in.o $(BASEDIR)/arch/x86/efi/built_in.o $(ALL_OBJS)
 
-ifeq ($(lto),y)
+ifeq ($(CONFIG_LTO),y)
 # Gather all LTO objects together
 prelink_lto.o: $(ALL_OBJS)
        $(LD_LTO) -r -o $@ $^