Эх сурвалжийг харах

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 15 жил өмнө
parent
commit
9849c407e8

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

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

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

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

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

@@ -45,7 +45,7 @@
 #define LITERAL_POSITION .literal_position
 #define LITERAL_POSITION .literal_position
 
 
 #undef JUMPTARGET
 #undef JUMPTARGET
-#ifdef PIC
+#ifdef __PIC__
 /* The "@PLT" suffix is currently a no-op for non-shared linking, but
 /* 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
    it doesn't hurt to use it conditionally for PIC code in case that
    changes someday.  */
    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
 #  define __local_multiple_threads	__libc_multiple_threads
 # endif
 # endif
 
 
-# ifdef PIC
+# ifdef __PIC__
 #  define CENABLE	bsr ra, __local_enable_asynccancel !samegp
 #  define CENABLE	bsr ra, __local_enable_asynccancel !samegp
 #  define CDISABLE	bsr ra, __local_disable_asynccancel !samegp
 #  define CDISABLE	bsr ra, __local_disable_asynccancel !samegp
 # else
 # else
@@ -130,7 +130,7 @@ __LABEL($syscall_error)						\
 extern int __local_multiple_threads attribute_hidden;
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P \
 #   define SINGLE_THREAD_P \
   __builtin_expect (__local_multiple_threads == 0, 1)
   __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
 #  define SINGLE_THREAD_P(reg)  ldl reg, __local_multiple_threads(gp) !gprel
 # else
 # else
 #  define SINGLE_THREAD_P(reg)					\
 #  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
 /* We push lr onto the stack, so we have to use ldmib instead of ldmia
    to find the saved arguments.  */
    to find the saved arguments.  */
-# ifdef PIC
+# ifdef __PIC__
 #  undef DOARGS_5
 #  undef DOARGS_5
 #  undef DOARGS_6
 #  undef DOARGS_6
 #  undef DOARGS_7
 #  undef DOARGS_7
@@ -105,7 +105,7 @@
 extern int __local_multiple_threads attribute_hidden;
 extern int __local_multiple_threads attribute_hidden;
 #  define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 #  define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 # else
 # else
-#  if !defined PIC
+#  if !defined __PIC__
 #   define SINGLE_THREAD_P						\
 #   define SINGLE_THREAD_P						\
   ldr ip, =__local_multiple_threads;					\
   ldr ip, =__local_multiple_threads;					\
   ldr ip, [ip];								\
   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
 # define POPARGS_6	POPARGS_5 ldw -54(%sr0,%sp), %r21	ASM_LINE_SEP
 
 
 # ifdef IS_IN_libpthread
 # ifdef IS_IN_libpthread
-#  ifdef PIC
+#  ifdef __PIC__
 #   define CENABLE .import __pthread_enable_asynccancel,code ASM_LINE_SEP \
 #   define CENABLE .import __pthread_enable_asynccancel,code ASM_LINE_SEP \
 			bl __pthread_enable_asynccancel,%r2 ASM_LINE_SEP
 			bl __pthread_enable_asynccancel,%r2 ASM_LINE_SEP
 #   define CDISABLE .import __pthread_disable_asynccancel,code 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
 			bl __pthread_disable_asynccancel,%r2 ASM_LINE_SEP
 #  endif
 #  endif
 # elif !defined NOT_IN_libc
 # elif !defined NOT_IN_libc
-#  ifdef PIC
+#  ifdef __PIC__
 #   define CENABLE .import __libc_enable_asynccancel,code ASM_LINE_SEP \
 #   define CENABLE .import __libc_enable_asynccancel,code ASM_LINE_SEP \
 			bl __libc_enable_asynccancel,%r2 ASM_LINE_SEP
 			bl __libc_enable_asynccancel,%r2 ASM_LINE_SEP
 #   define CDISABLE	.import __libc_disable_asynccancel,code 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
 			bl __libc_disable_asynccancel,%r2 ASM_LINE_SEP
 #  endif
 #  endif
 # else
 # else
-#  ifdef PIC
+#  ifdef __PIC__
 #   define CENABLE .import __librt_enable_asynccancel,code ASM_LINE_SEP \
 #   define CENABLE .import __librt_enable_asynccancel,code ASM_LINE_SEP \
 			bl __librt_enable_asynccancel,%r2 ASM_LINE_SEP
 			bl __librt_enable_asynccancel,%r2 ASM_LINE_SEP
 #   define CDISABLE .import __librt_disable_asynccancel,code ASM_LINE_SEP \
 #   define CDISABLE .import __librt_disable_asynccancel,code ASM_LINE_SEP \
@@ -167,7 +167,7 @@
 	nop							ASM_LINE_SEP	\
 	nop							ASM_LINE_SEP	\
 	ldw MULTIPLE_THREADS_OFFSET(%sr0,%ret0),%ret0		ASM_LINE_SEP	\
 	ldw MULTIPLE_THREADS_OFFSET(%sr0,%ret0),%ret0		ASM_LINE_SEP	\
  Lstp:								ASM_LINE_SEP
  Lstp:								ASM_LINE_SEP
-#  ifdef PIC
+#  ifdef __PIC__
 /* Slower version uses GOT to get value of __local_multiple_threads */
 /* Slower version uses GOT to get value of __local_multiple_threads */
 #   define SINGLE_THREAD_P							\
 #   define SINGLE_THREAD_P							\
 	addil LT%__local_multiple_threads, %r19			ASM_LINE_SEP	\
 	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 CENABLE	call __pthread_enable_asynccancel;
 #  define CDISABLE	call __pthread_disable_asynccancel
 #  define CDISABLE	call __pthread_disable_asynccancel
 # elif defined IS_IN_librt
 # elif defined IS_IN_librt
-#  ifdef PIC
+#  ifdef __PIC__
 #   define CENABLE	pushl %ebx; \
 #   define CENABLE	pushl %ebx; \
 			call __i686.get_pc_thunk.bx; \
 			call __i686.get_pc_thunk.bx; \
 			addl     $_GLOBAL_OFFSET_TABLE_, %ebx; \
 			addl     $_GLOBAL_OFFSET_TABLE_, %ebx; \
@@ -139,7 +139,7 @@
 #endif
 #endif
 
 
 # ifndef __ASSEMBLER__
 # ifndef __ASSEMBLER__
-#  if defined FLOATING_STACKS && USE___THREAD && defined PIC
+#  if defined FLOATING_STACKS && USE___THREAD && defined __PIC__
 #   define SINGLE_THREAD_P \
 #   define SINGLE_THREAD_P \
   __builtin_expect (THREAD_GETMEM (THREAD_SELF,				      \
   __builtin_expect (THREAD_GETMEM (THREAD_SELF,				      \
 				   p_header.data.multiple_threads) == 0, 1)
 				   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)
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 #  endif
 #  endif
 # else
 # else
-#  if !defined PIC
+#  if !defined __PIC__
 #   define SINGLE_THREAD_P cmpl $0, __local_multiple_threads
 #   define SINGLE_THREAD_P cmpl $0, __local_multiple_threads
 #  elif defined FLOATING_STACKS && USE___THREAD
 #  elif defined FLOATING_STACKS && USE___THREAD
 #   define SINGLE_THREAD_P cmpl $0, %gs:MULTIPLE_THREADS_OFFSET
 #   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;
 # define UNDOCARGS_5	UNDOCARGS_4; move.l (%sp)+, %d5;
 
 
 # ifdef IS_IN_libpthread
 # ifdef IS_IN_libpthread
-#  ifdef PIC
+#  ifdef __PIC__
 #   define CENABLE	jbsr __pthread_enable_asynccancel@PLTPC
 #   define CENABLE	jbsr __pthread_enable_asynccancel@PLTPC
 #   define CDISABLE	jbsr __pthread_disable_asynccancel@PLTPC
 #   define CDISABLE	jbsr __pthread_disable_asynccancel@PLTPC
 #  else
 #  else
@@ -85,7 +85,7 @@
 #   define CDISABLE	jbsr __pthread_disable_asynccancel
 #   define CDISABLE	jbsr __pthread_disable_asynccancel
 #  endif
 #  endif
 # elif !defined NOT_IN_libc
 # elif !defined NOT_IN_libc
-#  ifdef PIC
+#  ifdef __PIC__
 #   define CENABLE	jbsr __libc_enable_asynccancel@PLTPC
 #   define CENABLE	jbsr __libc_enable_asynccancel@PLTPC
 #   define CDISABLE	jbsr __libc_disable_asynccancel@PLTPC
 #   define CDISABLE	jbsr __libc_disable_asynccancel@PLTPC
 #  else
 #  else
@@ -93,7 +93,7 @@
 #   define CDISABLE	jbsr __libc_disable_asynccancel
 #   define CDISABLE	jbsr __libc_disable_asynccancel
 #  endif
 #  endif
 # else
 # else
-#  ifdef PIC
+#  ifdef __PIC__
 #   define CENABLE	jbsr __librt_enable_asynccancel@PLTPC
 #   define CENABLE	jbsr __librt_enable_asynccancel@PLTPC
 #   define CDISABLE	jbsr __librt_disable_asynccancel@PLTPC
 #   define CDISABLE	jbsr __librt_disable_asynccancel@PLTPC
 #  else
 #  else
@@ -114,7 +114,7 @@
 extern int __local_multiple_threads attribute_hidden;
 extern int __local_multiple_threads attribute_hidden;
 #  define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 #  define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 # else
 # else
-#  if !defined PIC
+#  if !defined __PIC__
 #   define SINGLE_THREAD_P tst.l __local_multiple_threads
 #   define SINGLE_THREAD_P tst.l __local_multiple_threads
 #  else
 #  else
 #   define SINGLE_THREAD_P tst.l (__local_multiple_threads, %pc)
 #   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@-
 	movel	%a0,%sp@-
 
 
 # ifdef __ASSUME_VFORK_SYSCALL
 # ifdef __ASSUME_VFORK_SYSCALL
-#  ifndef PIC
+#  ifndef __PIC__
 	jbra	SYSCALL_ERROR_LABEL
 	jbra	SYSCALL_ERROR_LABEL
 #  endif
 #  endif
 # else
 # else

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

@@ -89,7 +89,7 @@
 # else
 # else
 #  define CENABLE	bl JUMPTARGET(__librt_enable_asynccancel)
 #  define CENABLE	bl JUMPTARGET(__librt_enable_asynccancel)
 #  define CDISABLE	bl JUMPTARGET(__librt_disable_asynccancel)
 #  define CDISABLE	bl JUMPTARGET(__librt_disable_asynccancel)
-#  if defined HAVE_AS_REL16 && defined PIC
+#  if defined HAVE_AS_REL16 && defined __PIC__
 #   undef CGOTSETUP
 #   undef CGOTSETUP
 #   define CGOTSETUP							\
 #   define CGOTSETUP							\
     bcl 20,31,1f;							\
     bcl 20,31,1f;							\
@@ -122,7 +122,7 @@
 extern int __local_multiple_threads attribute_hidden;
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 #  else
 #  else
-#   if !defined PIC
+#   if !defined __PIC__
 #    define SINGLE_THREAD_P						\
 #    define SINGLE_THREAD_P						\
   lis 10,__local_multiple_threads@ha;					\
   lis 10,__local_multiple_threads@ha;					\
   lwz 10,__local_multiple_threads@l(10);				\
   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
 #  define __local_multiple_threads	__librt_multiple_threads
 # endif
 # endif
 
 
-# if defined IS_IN_librt && defined PIC
+# if defined IS_IN_librt && defined __PIC__
 #  define CENABLE \
 #  define CENABLE \
 	mov.l r12,@-r15; \
 	mov.l r12,@-r15; \
 	mov.l 1f,r12; \
 	mov.l 1f,r12; \
@@ -155,7 +155,7 @@
 # endif
 # endif
 
 
 # ifndef __ASSEMBLER__
 # ifndef __ASSEMBLER__
-#  if defined FLOATING_STACKS && USE___THREAD && defined PIC
+#  if defined FLOATING_STACKS && USE___THREAD && defined __PIC__
 #   define SINGLE_THREAD_P \
 #   define SINGLE_THREAD_P \
   __builtin_expect (THREAD_GETMEM (THREAD_SELF, p_multiple_threads) == 0, 1)
   __builtin_expect (THREAD_GETMEM (THREAD_SELF, p_multiple_threads) == 0, 1)
 #  else
 #  else
@@ -163,7 +163,7 @@ extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 #  endif
 #  endif
 # else
 # else
-#  if !defined PIC
+#  if !defined __PIC__
 #   define SINGLE_THREAD_P \
 #   define SINGLE_THREAD_P \
 	mov.l 1f,r0; \
 	mov.l 1f,r0; \
 	mov.l @r0,r0; \
 	mov.l @r0,r0; \