about summary refs log tree commit diff
path: root/Makeconfig
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@sourceware.org>2021-03-15 20:25:00 +0530
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2021-03-15 20:25:00 +0530
commit8b8f13b60d9587e91e8719239a9249b448bc1307 (patch)
tree07a0048ac8f8f651ca26e547c3bebc6a68db6b93 /Makeconfig
parent941ea10f8099cb4fcc98c65249fc17a63fcff6a4 (diff)
downloadglibc-8b8f13b60d9587e91e8719239a9249b448bc1307.tar.gz
glibc-8b8f13b60d9587e91e8719239a9249b448bc1307.tar.xz
glibc-8b8f13b60d9587e91e8719239a9249b448bc1307.zip
Build libc-start with stack protector for SHARED
This does not change the emitted code since __libc_start_main does not
return, but is important for formal flags compliance.

This also cleans up the cosmetic inconsistency in the stack protector
flags in csu, especially the incorrect value of STACK_PROTECTOR_LEVEL.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'Makeconfig')
-rw-r--r--Makeconfig8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makeconfig b/Makeconfig
index 0a4811b5e5..01f8638c2e 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -856,6 +856,14 @@ ifneq ($(stack-protector),)
 +stack-protector=$(stack-protector)
 endif
 
+# Some routines are unsafe to build with stack-protection since they're called
+# before the stack check guard is set up.  Provide a way to disable stack
+# protector.  The first argument is the extension (.o, .os, .oS) and the second
+# is a list of routines that this path should be applied to.
+define elide-stack-protector
+$(if $(filter $(@F),$(patsubst %,%$(1),$(2))), $(no-stack-protector))
+endef
+
 # 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.