]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Build csu/elf-init.c and csu/static-reloc.c with stack protector
authorFlorian Weimer <fweimer@redhat.com>
Thu, 5 Jul 2018 20:57:45 +0000 (22:57 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 5 Jul 2018 20:57:45 +0000 (22:57 +0200)
This does not change generated code (with -fstack-protector-strong), but
is important for formal compiler flags compliance.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
ChangeLog
csu/Makefile

index 3bfd61a44a0e459c12bd2f96275e4180812eb590..5a1f291b858e5a9723881083309d99c4c57ecdc6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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>
 
index f3498960f89e3b31f7cda6969e6eb3393a305241..88fc77662ef834794b92bdc47d8f93a4c8eebc7b 100644 (file)
@@ -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))