]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
xen: Move CONFIG_INDIRECT_THUNK to Kconfig
authorAnthony PERARD <anthony.perard@citrix.com>
Wed, 11 Dec 2019 13:55:06 +0000 (13:55 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 30 Jan 2020 11:54:33 +0000 (11:54 +0000)
Now that Kconfig has the capability to run shell command when
generating CONFIG_* we can use it in some cases to test CFLAGS.

CONFIG_INDIRECT_THUNK is a good example that wants to exist both in
Makefile and as a C macro, which Kconfig do. So use Kconfig to
generate CONFIG_INDIRECT_THUNK and have the CFLAGS depends on that.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/Kconfig
xen/arch/x86/Rules.mk

index f853c04564046b792be87be4649e43614bdf7cc0..8149362bdef3a153e80ae62c1bdef974801fe031 100644 (file)
@@ -31,6 +31,9 @@ config ARCH_DEFCONFIG
        string
        default "arch/x86/configs/x86_64_defconfig"
 
+config INDIRECT_THUNK
+       def_bool $(cc-option,-mindirect-branch-register)
+
 menu "Architecture Features"
 
 source "arch/Kconfig"
index 92fdbe9d6822ad37e41551b71e27b061df7b4046..a2c257fb95b26e5b3999670e951f915ff8428f63 100644 (file)
@@ -71,11 +71,9 @@ CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
 
 # Compile with thunk-extern, indirect-branch-register if avaiable.
-ifneq ($(call cc-option,$(CC),-mindirect-branch-register,n),n)
+ifeq ($(CONFIG_INDIRECT_THUNK),y)
 CFLAGS += -mindirect-branch=thunk-extern -mindirect-branch-register
-CFLAGS += -DCONFIG_INDIRECT_THUNK
 CFLAGS += -fno-jump-tables
-export CONFIG_INDIRECT_THUNK=y
 endif
 
 # If supported by the compiler, reduce stack alignment to 8 bytes. But allow