]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
xen: Move GCC_HAS_VISIBILITY_ATTRIBUTE to Kconfig and common
authorAnthony PERARD <anthony.perard@citrix.com>
Wed, 11 Dec 2019 16:38:57 +0000 (16:38 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 30 Jan 2020 11:54:33 +0000 (11:54 +0000)
The check for $(CC) -fvisibility=hidden is done by both arm and x86,
so the patch also move the check to the common area.

The check doesn't check if $(CC) is gcc, and clang can accept that
option as well, so s/GCC/CC/ is done to the define name.

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

index 57427927abf03a0db69cc9d70403fb1d95917981..073042f46730a7277cea6361af8a1a72a98038fa 100644 (file)
@@ -23,6 +23,10 @@ config CLANG_VERSION
        int
        default $(shell,$(BASEDIR)/scripts/clang-version.sh $(CC))
 
+# -fvisibility=hidden reduces -fpic cost, if it's available
+config CC_HAS_VISIBILITY_ATTRIBUTE
+       def_bool $(cc-option,-fvisibility=hidden)
+
 source "arch/$(SRCARCH)/Kconfig"
 
 config DEFCONFIG_LIST
index 3d9a0ed357bcc13fc9d574d7298e858ecc925b2f..022a3a6f82ba1f2cb5ff3c07fb7fa6b0141c7704 100644 (file)
@@ -18,10 +18,6 @@ CFLAGS-$(CONFIG_ARM_32) += -mcpu=cortex-a15
 CFLAGS-$(CONFIG_ARM_64) += -mcpu=generic
 CFLAGS-$(CONFIG_ARM_64) += -mgeneral-regs-only # No fp registers etc
 
-ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
-CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
-endif
-
 EARLY_PRINTK := n
 
 ifeq ($(CONFIG_DEBUG),y)
index b98e14e28c5a2328f369edca96e8407296e63abd..e69b8e697cc0efcef7347e800a565a6c7b9b0832 100644 (file)
@@ -65,11 +65,6 @@ CFLAGS += -mno-red-zone -fpic -fno-asynchronous-unwind-tables
 # SSE setup for variadic function calls.
 CFLAGS += -mno-sse $(call cc-option,$(CC),-mskip-rax-setup)
 
-# -fvisibility=hidden reduces -fpic cost, if it's available
-ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
-CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
-endif
-
 # Compile with thunk-extern, indirect-branch-register if avaiable.
 ifeq ($(CONFIG_INDIRECT_THUNK),y)
 CFLAGS += -mindirect-branch=thunk-extern -mindirect-branch-register
index ff6c0f5cdd18fdde1305a53c108304d1bf70e6c2..8c846261d2415512bca8f6cc75fd5a13f8824c6f 100644 (file)
@@ -78,7 +78,7 @@
 #define __must_be_array(a) \
   BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
 
-#ifdef GCC_HAS_VISIBILITY_ATTRIBUTE
+#ifdef CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE
 /* Results in more efficient PIC code (no indirections through GOT or PLT). */
 #pragma GCC visibility push(hidden)
 #endif