Skip to contentSkip to conversation

adjust hidden visibility attribute handling

PATCH New Jan Beulich 1 participant 1 message Sep 21, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 adjust hidden visibility attribute handling

Consolidate the preferable use of a pragma with the feature detection in the make script.

xen/include/xen/compiler.h +1 -1
Index: 2006-09-21/xen/include/xen/compiler.h
===================================================================
@@ -35,7 +35,7 @@
 #define offsetof(a,b) ((unsigned long)&(((a *)0)->b))
 #endif
 
-#if defined(__x86_64__) && (__GNUC__ > 3)
+#ifdef GCC_HAS_VISIBILITY_ATTRIBUTE
 /* Results in more efficient PIC code (no indirections through GOT or PLT). */
 #pragma GCC visibility push(hidden)
 #endif
xen/arch/x86/Rules.mk +1 -1
Index: 2006-09-21/xen/arch/x86/Rules.mk
===================================================================
@@ -44,7 +44,7 @@ CFLAGS  += -mno-red-zone -fpic -fno-reor
 CFLAGS  += -fno-asynchronous-unwind-tables
 # -fvisibility=hidden reduces -fpic cost, if it's available
 CFLAGS  += $(shell $(CC) -v --help 2>&1 | grep " -fvisibility=" | \
-             grep -q hidden && echo "-fvisibility=hidden")
+             grep -q hidden && echo "-DGCC_HAS_VISIBILITY_ATTRIBUTE")
 LDFLAGS += -m elf_x86_64
 x86_32 := n
 x86_64 := y