about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--config.make.in2
-rw-r--r--csu/Makefile4
-rw-r--r--misc/Makefile7
-rw-r--r--string/Makefile4
5 files changed, 29 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 395a14ba4d..64ccdf7ca0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,18 @@
 2016-12-26  Nick Alcock  <nick.alcock@oracle.com>
 
 	[BZ #7065]
+	* config.make.in (have-ssp, no-stack-protector): New.
+	* csu/Makefile (CFLAGS-.o, CFLAGS-.op, CFLAGS-.os): Use it.
+	* misc/Makefile (CFLAGS-sbrk.o): Likewise.
+	(CFLAGS-sbrk.op): Likewise.
+	(CFLAGS-brk.o): Likewise.
+	(CFLAGS-brk.op): Likewise.
+	* string/Makefile (CFLAGS-memcpy.c): Likewise.
+	(CFLAGS-wordcopy.c): Likewise.
+
+2016-12-26  Nick Alcock  <nick.alcock@oracle.com>
+
+	[BZ #7065]
 	* configure.ac (HAVE_CC_NO_STACK_PROTECTOR): Define.
 	* config.h.in (HAVE_CC_NO_STACK_PROTECTOR): New macro.
 	* include/libc-symbols.h (inhibit_stack_protector): New macro.
diff --git a/config.make.in b/config.make.in
index 35e7e59663..4422025e59 100644
--- a/config.make.in
+++ b/config.make.in
@@ -58,7 +58,9 @@ with-fp = @with_fp@
 enable-timezone-tools = @enable_timezone_tools@
 unwind-find-fde = @libc_cv_gcc_unwind_find_fde@
 have-fpie = @libc_cv_fpie@
+have-ssp = @libc_cv_ssp@
 stack-protector = @stack_protector@
+no-stack-protector = @no_stack_protector@
 have-selinux = @have_selinux@
 have-libaudit = @have_libaudit@
 have-libcap = @have_libcap@
diff --git a/csu/Makefile b/csu/Makefile
index 3d23f13868..75f36bbbf4 100644
--- a/csu/Makefile
+++ b/csu/Makefile
@@ -46,6 +46,10 @@ before-compile += $(objpfx)version-info.h
 # code is compiled with special flags.
 tests =
 
+CFLAGS-.o += $(no-stack-protector)
+CFLAGS-.op += $(no-stack-protector)
+CFLAGS-.os += $(no-stack-protector)
+
 ifeq (yes,$(build-shared))
 extra-objs += S$(start-installed-name) gmon-start.os
 ifneq ($(start-installed-name),$(static-start-installed-name))
diff --git a/misc/Makefile b/misc/Makefile
index d241daea47..35dba3492a 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -108,6 +108,13 @@ CFLAGS-getusershell.c = -fexceptions
 CFLAGS-err.c = -fexceptions
 CFLAGS-tst-tsearch.c = $(stack-align-test-flags)
 
+# Called during static library initialization, so turn stack-protection
+# off for non-shared builds.
+CFLAGS-sbrk.o = $(no-stack-protector)
+CFLAGS-sbrk.op = $(no-stack-protector)
+CFLAGS-brk.o = $(no-stack-protector)
+CFLAGS-brk.op = $(no-stack-protector)
+
 include ../Rules
 
 $(objpfx)libg.a: $(dep-dummy-lib); $(make-dummy-lib)
diff --git a/string/Makefile b/string/Makefile
index 081627734d..64b4c80eaa 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -73,6 +73,10 @@ CFLAGS-test-ffs.c = -fno-builtin
 CFLAGS-tst-inlcall.c = -fno-builtin
 CFLAGS-tst-xbzero-opt.c = -O3
 
+# Called during TLS initialization.
+CFLAGS-memcpy.c = $(no-stack-protector)
+CFLAGS-wordcopy.c = $(no-stack-protector)
+
 ifeq ($(run-built-tests),yes)
 $(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
 	cmp $^ > $@; \