Browse Source

ntpl: fix static linking by not leaking SSP_ALL_CFLAGS

The SSP_ALL_CFLAGS in nptl arch CFLAGS leaks out and forces things
like dl-support.c, brk.c, sbrk.c memcpy, etc to be built with
-fstack-protector-all. This is bad when linking statically since
initializing TLS will call those functions before SSP is initialized.

The libpthread itself will still be built with -fstack-protector-all
due to CFLAGS-nptl has SSP_ALL_CFLAGS in libpthread/nptl/Makefile.in

Thanks to Timo Teras for helping with this.

Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Natanael Copa 13 years ago
parent
commit
c452a58e65

+ 0 - 1
libpthread/nptl/sysdeps/arm/Makefile.arch

@@ -15,4 +15,3 @@ ASFLAGS-pthread_spin_lock.S = -DNOT_IN_libc -DIS_IN_libpthread
 ASFLAGS-pthread_spin_trylock.S = -DNOT_IN_libc -DIS_IN_libpthread
 ASFLAGS-aeabi_read_tp.S = -DNOT_IN_libc=1
 
-CFLAGS-arm = $(SSP_ALL_CFLAGS)

+ 0 - 2
libpthread/nptl/sysdeps/generic/Makefile.in

@@ -19,8 +19,6 @@ libpthread_generic_libc_a_OBJS = $(libpthread_generic_libc_a_COBJ)
 libpthread_ld_tls_CSRC = dl-tls.c
 libpthread_ld_tls_COBJ = $(patsubst %.c,$(libpthread_generic_OUT)/%.o,$(libpthread_ld_tls_CSRC))
 
-CFLAGS-generic = $(SSP_ALL_CFLAGS)
-
 objclean-y += CLEAN_libpthread/nptl/sysdeps/generic
 
 CLEAN_libpthread/nptl/sysdeps/generic:

+ 0 - 1
libpthread/nptl/sysdeps/i386/Makefile.arch

@@ -8,4 +8,3 @@
 CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
 CFLAGS-pthread_create.c += -mpreferred-stack-boundary=4
 
-CFLAGS-i386 = $(SSP_ALL_CFLAGS)

+ 0 - 1
libpthread/nptl/sysdeps/mips/Makefile.arch

@@ -15,4 +15,3 @@ ASFLAGS-nptl-sysdep.S = -DNOT_IN_libc -DIS_IN_libpthread	\
 
 libc_arch_a_CSRC = libc-tls.c
 
-CFLAGS-mips = $(SSP_ALL_CFLAGS)

+ 0 - 1
libpthread/nptl/sysdeps/powerpc/Makefile.arch

@@ -5,4 +5,3 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
-CFLAGS-powerpc = $(SSP_ALL_CFLAGS)

+ 0 - 1
libpthread/nptl/sysdeps/sh/Makefile.arch

@@ -10,5 +10,4 @@ ASFLAGS-pthread_spin_trylock.S = -DNOT_IN_libc -DIS_IN_libpthread
 
 CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
 
-CFLAGS-sh = $(SSP_ALL_CFLAGS)
 

+ 0 - 1
libpthread/nptl/sysdeps/sparc/Makefile.arch

@@ -8,5 +8,4 @@ subdirs += libpthread/nptl/sysdeps/$(TARGET_ARCH)/$(TARGET_SUBARCH)/sparv9
 
 CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
 
-CFLAGS-sparc = $(SSP_ALL_CFLAGS)
 

+ 0 - 1
libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch

@@ -14,7 +14,6 @@ libc_linux_arch_CSRC = fork.c libc-lowlevellock.c
 libc_linux_arch_SSRC = clone.S vfork.S
 libc_linux_arch_SSRC-OMIT = waitpid.S
 
-CFLAGS += $(SSP_ALL_CFLAGS)
 
 CFLAGS-pthread_once.c = -DNOT_IN_libc -DIS_IN_libpthread
 CFLAGS-pt-__syscall_rt_sigaction.c = -DNOT_IN_libc -DIS_IN_libpthread

+ 0 - 1
libpthread/nptl/sysdeps/unix/sysv/linux/i386/Makefile.arch

@@ -12,7 +12,6 @@ libc_linux_arch_CSRC = fork.c
 libc_linux_arch_SSRC = clone.S vfork.S
 
 ASFLAGS += -DUSE___THREAD
-CFLAGS += $(SSP_ALL_CFLAGS)
 
 CFLAGS-pt-__syscall_error.c =  -DNOT_IN_libc -DIS_IN_libpthread
 ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT

+ 0 - 1
libpthread/nptl/sysdeps/unix/sysv/linux/mips/Makefile.arch

@@ -12,7 +12,6 @@ libc_linux_arch_CSRC = fork.c
 libc_linux_arch_SSRC = clone.S vfork.S
 
 ASFLAGS += -DUSE___THREAD
-CFLAGS += $(SSP_ALL_CFLAGS)
 
 CFLAGS-OMIT-fork.c = -DNOT_IN_libc -DIS_IN_libpthread
 ifeq ($(UCLIBC_HAS_STDIO_FUTEXES),y)

+ 0 - 1
libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/Makefile.arch

@@ -15,7 +15,6 @@ libc_linux_arch_SSRC = clone.S vfork.S
 librt_linux_arch_CSRC = pt-__syscall_error.c
 
 ASFLAGS += -DUSE___THREAD
-CFLAGS += $(SSP_ALL_CFLAGS)
 
 CFLAGS-pthread_once.c = -DNOT_IN_libc -DIS_IN_libpthread
 CFLAGS-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread

+ 0 - 1
libpthread/nptl/sysdeps/unix/sysv/linux/sh/Makefile.arch

@@ -16,7 +16,6 @@ libc_linux_arch_CSRC = fork.c
 libc_linux_arch_SSRC = libc-lowlevellock.S clone.S vfork.S
 
 ASFLAGS += -DUSE___THREAD
-CFLAGS += $(SSP_ALL_CFLAGS)
 
 ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
 ASFLAGS-pthread_once.S = -D_LIBC_REENTRANT

+ 0 - 1
libpthread/nptl/sysdeps/unix/sysv/linux/sparc/Makefile.arch

@@ -13,7 +13,6 @@ libc_linux_arch_CSRC = fork.c libc-lowlevellock.c
 libc_linux_arch_SSRC = clone.S vfork.S
 
 ASFLAGS += -DUSE___THREAD
-CFLAGS += $(SSP_ALL_CFLAGS)
 
 ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT
 CFLAGS-pthread_once.c = -DNOT_IN_libc -DIS_IN_libpthread

+ 0 - 1
libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/Makefile.arch

@@ -19,7 +19,6 @@ libc_linux_arch_SSRC-OMIT = waitpid.S
 librt_linux_arch_SSRC = librt-cancellation.S
 
 ASFLAGS += -DUSE___THREAD
-CFLAGS += $(SSP_ALL_CFLAGS)
 
 CFLAGS-pt-__syscall_error.c =  -DNOT_IN_libc -DIS_IN_libpthread
 ASFLAGS-pt-vfork.S = -DNOT_IN_libc -DIS_IN_libpthread -D_LIBC_REENTRANT

+ 0 - 1
libpthread/nptl/sysdeps/x86_64/Makefile.arch

@@ -7,5 +7,4 @@
 
 CFLAGS-pthread_spin_lock.c += -D_GNU_SOURCE
 
-CFLAGS-x86_64 = $(SSP_ALL_CFLAGS)