Browse Source

build: Get rids of PIC macro using compiler flag __PIC__ instead

Based on Peter Mazinger's comments on a recent commit, I decided
to get rids of all occurrences of PIC changing them to __PIC__

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Carmelo Amoroso 14 years ago
parent
commit
9849c407e8

+ 1 - 1
libc/string/x86_64/memcpy.S

@@ -26,7 +26,7 @@
 #define MEMPCPY_P (defined memcpy)
 
         .text
-#if defined PIC && !defined NOT_IN_libc
+#if defined __PIC__ && !defined NOT_IN_libc
 ENTRY (__memcpy_chk)
 	cmpq	%rdx, %rcx
 	jb	HIDDEN_JUMPTARGET (__chk_fail)

+ 2 - 2
libc/string/x86_64/memset.S

@@ -29,7 +29,7 @@
 #define LARGE $120000
 
         .text
-#if !BZERO_P && defined PIC && !defined NOT_IN_libc
+#if !BZERO_P && defined __PIC__ && !defined NOT_IN_libc
 ENTRY (__memset_chk)
 	cmpq	%rdx, %rcx
 	jb	HIDDEN_JUMPTARGET (__chk_fail)
@@ -142,6 +142,6 @@ END (memset)
 libc_hidden_def(memset)
 #endif
 
-#if !BZERO_P && defined PIC && !defined NOT_IN_libc
+#if !BZERO_P && defined __PIC__ && !defined NOT_IN_libc
 strong_alias (__memset_chk, __memset_zero_constant_len_parameter)
 #endif

+ 1 - 1
libc/sysdeps/linux/xtensa/sysdep.h

@@ -45,7 +45,7 @@
 #define LITERAL_POSITION .literal_position
 
 #undef JUMPTARGET
-#ifdef PIC
+#ifdef __PIC__
 /* The "@PLT" suffix is currently a no-op for non-shared linking, but
    it doesn't hurt to use it conditionally for PIC code in case that
    changes someday.  */

+ 2 - 2
libpthread/linuxthreads/sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h

@@ -118,7 +118,7 @@ __LABEL($syscall_error)						\
 #  define __local_multiple_threads	__libc_multiple_threads
 # endif
 
-# ifdef PIC
+# ifdef __PIC__
 #  define CENABLE	bsr ra, __local_enable_asynccancel !samegp
 #  define CDISABLE	bsr ra, __local_disable_asynccancel !samegp
 # else
@@ -130,7 +130,7 @@ __LABEL($syscall_error)						\
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P \
   __builtin_expect (__local_multiple_threads == 0, 1)
-# elif defined(PIC)
+# elif defined(__PIC__)
 #  define SINGLE_THREAD_P(reg)  ldl reg, __local_multiple_threads(gp) !gprel
 # else
 #  define SINGLE_THREAD_P(reg)					\

+ 2 - 2
libpthread/linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h

@@ -27,7 +27,7 @@
 
 /* We push lr onto the stack, so we have to use ldmib instead of ldmia
    to find the saved arguments.  */
-# ifdef PIC
+# ifdef __PIC__
 #  undef DOARGS_5
 #  undef DOARGS_6
 #  undef DOARGS_7
@@ -105,7 +105,7 @@
 extern int __local_multiple_threads attribute_hidden;
 #  define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 # else
-#  if !defined PIC
+#  if !defined __PIC__
 #   define SINGLE_THREAD_P						\
   ldr ip, =__local_multiple_threads;					\
   ldr ip, [ip];								\

+ 4 - 4
libpthread/linuxthreads/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h

@@ -104,7 +104,7 @@
 # define POPARGS_6	POPARGS_5 ldw -54(%sr0,%sp), %r21	ASM_LINE_SEP
 
 # ifdef IS_IN_libpthread
-#  ifdef PIC
+#  ifdef __PIC__
 #   define CENABLE .import __pthread_enable_asynccancel,code ASM_LINE_SEP \
 			bl __pthread_enable_asynccancel,%r2 ASM_LINE_SEP
 #   define CDISABLE .import __pthread_disable_asynccancel,code ASM_LINE_SEP \
@@ -116,7 +116,7 @@
 			bl __pthread_disable_asynccancel,%r2 ASM_LINE_SEP
 #  endif
 # elif !defined NOT_IN_libc
-#  ifdef PIC
+#  ifdef __PIC__
 #   define CENABLE .import __libc_enable_asynccancel,code ASM_LINE_SEP \
 			bl __libc_enable_asynccancel,%r2 ASM_LINE_SEP
 #   define CDISABLE	.import __libc_disable_asynccancel,code ASM_LINE_SEP \
@@ -128,7 +128,7 @@
 			bl __libc_disable_asynccancel,%r2 ASM_LINE_SEP
 #  endif
 # else
-#  ifdef PIC
+#  ifdef __PIC__
 #   define CENABLE .import __librt_enable_asynccancel,code ASM_LINE_SEP \
 			bl __librt_enable_asynccancel,%r2 ASM_LINE_SEP
 #   define CDISABLE .import __librt_disable_asynccancel,code ASM_LINE_SEP \
@@ -167,7 +167,7 @@
 	nop							ASM_LINE_SEP	\
 	ldw MULTIPLE_THREADS_OFFSET(%sr0,%ret0),%ret0		ASM_LINE_SEP	\
  Lstp:								ASM_LINE_SEP
-#  ifdef PIC
+#  ifdef __PIC__
 /* Slower version uses GOT to get value of __local_multiple_threads */
 #   define SINGLE_THREAD_P							\
 	addil LT%__local_multiple_threads, %r19			ASM_LINE_SEP	\

+ 3 - 3
libpthread/linuxthreads/sysdeps/unix/sysv/linux/i386/sysdep-cancel.h

@@ -101,7 +101,7 @@
 #  define CENABLE	call __pthread_enable_asynccancel;
 #  define CDISABLE	call __pthread_disable_asynccancel
 # elif defined IS_IN_librt
-#  ifdef PIC
+#  ifdef __PIC__
 #   define CENABLE	pushl %ebx; \
 			call __i686.get_pc_thunk.bx; \
 			addl     $_GLOBAL_OFFSET_TABLE_, %ebx; \
@@ -139,7 +139,7 @@
 #endif
 
 # ifndef __ASSEMBLER__
-#  if defined FLOATING_STACKS && USE___THREAD && defined PIC
+#  if defined FLOATING_STACKS && USE___THREAD && defined __PIC__
 #   define SINGLE_THREAD_P \
   __builtin_expect (THREAD_GETMEM (THREAD_SELF,				      \
 				   p_header.data.multiple_threads) == 0, 1)
@@ -153,7 +153,7 @@ extern int __local_multiple_threads
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 #  endif
 # else
-#  if !defined PIC
+#  if !defined __PIC__
 #   define SINGLE_THREAD_P cmpl $0, __local_multiple_threads
 #  elif defined FLOATING_STACKS && USE___THREAD
 #   define SINGLE_THREAD_P cmpl $0, %gs:MULTIPLE_THREADS_OFFSET

+ 4 - 4
libpthread/linuxthreads/sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h

@@ -77,7 +77,7 @@
 # define UNDOCARGS_5	UNDOCARGS_4; move.l (%sp)+, %d5;
 
 # ifdef IS_IN_libpthread
-#  ifdef PIC
+#  ifdef __PIC__
 #   define CENABLE	jbsr __pthread_enable_asynccancel@PLTPC
 #   define CDISABLE	jbsr __pthread_disable_asynccancel@PLTPC
 #  else
@@ -85,7 +85,7 @@
 #   define CDISABLE	jbsr __pthread_disable_asynccancel
 #  endif
 # elif !defined NOT_IN_libc
-#  ifdef PIC
+#  ifdef __PIC__
 #   define CENABLE	jbsr __libc_enable_asynccancel@PLTPC
 #   define CDISABLE	jbsr __libc_disable_asynccancel@PLTPC
 #  else
@@ -93,7 +93,7 @@
 #   define CDISABLE	jbsr __libc_disable_asynccancel
 #  endif
 # else
-#  ifdef PIC
+#  ifdef __PIC__
 #   define CENABLE	jbsr __librt_enable_asynccancel@PLTPC
 #   define CDISABLE	jbsr __librt_disable_asynccancel@PLTPC
 #  else
@@ -114,7 +114,7 @@
 extern int __local_multiple_threads attribute_hidden;
 #  define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 # else
-#  if !defined PIC
+#  if !defined __PIC__
 #   define SINGLE_THREAD_P tst.l __local_multiple_threads
 #  else
 #   define SINGLE_THREAD_P tst.l (__local_multiple_threads, %pc)

+ 1 - 1
libpthread/linuxthreads/sysdeps/unix/sysv/linux/m68k/vfork.S

@@ -56,7 +56,7 @@ ENTRY (__vfork)
 	movel	%a0,%sp@-
 
 # ifdef __ASSUME_VFORK_SYSCALL
-#  ifndef PIC
+#  ifndef __PIC__
 	jbra	SYSCALL_ERROR_LABEL
 #  endif
 # else

+ 2 - 2
libpthread/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h

@@ -89,7 +89,7 @@
 # else
 #  define CENABLE	bl JUMPTARGET(__librt_enable_asynccancel)
 #  define CDISABLE	bl JUMPTARGET(__librt_disable_asynccancel)
-#  if defined HAVE_AS_REL16 && defined PIC
+#  if defined HAVE_AS_REL16 && defined __PIC__
 #   undef CGOTSETUP
 #   define CGOTSETUP							\
     bcl 20,31,1f;							\
@@ -122,7 +122,7 @@
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 #  else
-#   if !defined PIC
+#   if !defined __PIC__
 #    define SINGLE_THREAD_P						\
   lis 10,__local_multiple_threads@ha;					\
   lwz 10,__local_multiple_threads@l(10);				\

+ 3 - 3
libpthread/linuxthreads/sysdeps/unix/sysv/linux/sh/sysdep-cancel.h

@@ -102,7 +102,7 @@
 #  define __local_multiple_threads	__librt_multiple_threads
 # endif
 
-# if defined IS_IN_librt && defined PIC
+# if defined IS_IN_librt && defined __PIC__
 #  define CENABLE \
 	mov.l r12,@-r15; \
 	mov.l 1f,r12; \
@@ -155,7 +155,7 @@
 # endif
 
 # ifndef __ASSEMBLER__
-#  if defined FLOATING_STACKS && USE___THREAD && defined PIC
+#  if defined FLOATING_STACKS && USE___THREAD && defined __PIC__
 #   define SINGLE_THREAD_P \
   __builtin_expect (THREAD_GETMEM (THREAD_SELF, p_multiple_threads) == 0, 1)
 #  else
@@ -163,7 +163,7 @@ extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 #  endif
 # else
-#  if !defined PIC
+#  if !defined __PIC__
 #   define SINGLE_THREAD_P \
 	mov.l 1f,r0; \
 	mov.l @r0,r0; \