about summary refs log tree commit diff
path: root/Makeconfig
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2016-12-26 10:09:10 +0100
committerFlorian Weimer <fweimer@redhat.com>2016-12-26 10:11:06 +0100
commitcecbc7967f0bcac718b6f8f8942b58403c0e917c (patch)
tree2196eac197244caf06b0f9e6e5f744f01a44cfdb /Makeconfig
parent2e6c45c59bcd40f1ae8466cbd32f4d263ff45619 (diff)
downloadglibc-cecbc7967f0bcac718b6f8f8942b58403c0e917c.tar.gz
glibc-cecbc7967f0bcac718b6f8f8942b58403c0e917c.tar.xz
glibc-cecbc7967f0bcac718b6f8f8942b58403c0e917c.zip
Enable -fstack-protector=* when requested by configure [BZ #7065]
Diffstat (limited to 'Makeconfig')
-rw-r--r--Makeconfig8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makeconfig b/Makeconfig
index 2d316accf3..0158eaa76e 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -807,6 +807,11 @@ endif
 # disable any optimization that assume default rounding mode.
 +math-flags = -frounding-math
 
+# We might want to compile with some stack-protection flag.
+ifneq ($(stack-protector),)
++stack-protector=$(stack-protector)
+endif
+
 # This is the program that generates makefile dependencies from C source files.
 # The -MP flag tells GCC >= 3.2 (which we now require) to produce dummy
 # targets for headers so that removed headers don't break the build.
@@ -866,7 +871,8 @@ ifeq	"$(strip $(+cflags))" ""
 +cflags	:= $(default_cflags)
 endif	# $(+cflags) == ""
 
-+cflags += $(cflags-cpu) $(+gccwarn) $(+merge-constants) $(+math-flags)
++cflags += $(cflags-cpu) $(+gccwarn) $(+merge-constants) $(+math-flags) \
+	   $(+stack-protector)
 +gcc-nowarn := -w
 
 # Don't duplicate options if we inherited variables from the parent.