about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--csu/Makefile16
2 files changed, 22 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3bfd61a44a..5a1f291b85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
 2018-07-05  Florian Weimer  <fweimer@redhat.com>
+
+	* csu/Makefile (CFLAGS-static-reloc.os): Build with stack
+	protector.
+	(CFLAGS-elf-init.oS): Likewise.
+
+2018-07-05  Florian Weimer  <fweimer@redhat.com>
 	    Carlos O'Donell  <carlos@redhat.com>
 
 	* debug/Makefile (CFLAGS-stack_chk_fail_local.c): Remove
diff --git a/csu/Makefile b/csu/Makefile
index f3498960f8..88fc77662e 100644
--- a/csu/Makefile
+++ b/csu/Makefile
@@ -50,6 +50,22 @@ CFLAGS-.o += $(no-stack-protector)
 CFLAGS-.op += $(no-stack-protector)
 CFLAGS-.os += $(no-stack-protector)
 
+# Dummy object not actually used for anything.  It is linked into
+# crt1.o nevertheless, which in turn is statically linked into
+# applications, so that build flags matter.
+# See <https://sourceware.org/ml/libc-alpha/2018-07/msg00101.html>.
+# NB: Using $(stack-protector) in this way causes a wrong definition
+# STACK_PROTECTOR_LEVEL due to the preceding $(no-stack-protector),
+# but it does not matter for this source file.
+CFLAGS-static-reloc.os += $(stack-protector)
+
+# This file is not actually part of the startup code in the nonshared
+# case and statically linked into applications.  See
+# <https://sourceware.org/bugzilla/show_bug.cgi?id=23323>,
+# <https://sourceware.org/ml/libc-alpha/2018-06/msg00717.html>.
+# Also see the note above regarding STACK_PROTECTOR_LEVEL.
+CFLAGS-elf-init.oS += $(stack-protector)
+
 ifeq (yes,$(build-shared))
 extra-objs += S$(start-installed-name) gmon-start.os
 ifneq ($(start-installed-name),$(static-start-installed-name))