summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2014-09-11 21:19:07 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2014-09-11 21:30:41 -0400
commit7a82ace00e3cf19205df455cc1ec8a444d99d79d (patch)
treebf973c23519490c1fbfa0e84561398838b1834dd /Configure
parent61cd60c6c5ee318dd200a61898201288b3c1958b (diff)
downloadperl-7a82ace00e3cf19205df455cc1ec8a444d99d79d.tar.gz
Use -fstack-protector-strong, if available.
In preference to just -fstack-protector. gcc 4.8.x? gcc 4.9, definitely. (FWIW, users include at least Google Chrome, Fedora 20, Ubuntu)
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure21
1 files changed, 20 insertions, 1 deletions
diff --git a/Configure b/Configure
index da0b9d057a..835bf212ef 100755
--- a/Configure
+++ b/Configure
@@ -5384,8 +5384,15 @@ default|recommended)
# as that way the compiler can do the right implementation dependant
# thing. (NWC)
case "$gccversion" in
- ?*) set stack-protector -fstack-protector
+ ?*) set stack-protector-strong -fstack-protector-strong
eval $checkccflag
+ case "$dflt" in
+ *-fstack-protector-strong*) ;; # It got added.
+ *) # Try the plain/older -fstack-protector.
+ set stack-protector -fstack-protector
+ eval $checkccflag
+ ;;
+ esac
;;
esac
;;
@@ -5528,6 +5535,12 @@ case "$ldflags" in
esac
# See note above about -fstack-protector
case "$ccflags" in
+*-fstack-protector-strong*)
+ case "$dflt" in
+ *-fstack-protector-strong*) ;; # Don't add it again
+ *) dflt="$dflt -fstack-protector-strong" ;;
+ esac
+ ;;
*-fstack-protector*)
case "$dflt" in
*-fstack-protector*) ;; # Don't add it again
@@ -8399,6 +8412,12 @@ EOM
esac
case "$ldflags" in
+ *-fstack-protector-strong*)
+ case "$dflt" in
+ *-fstack-protector-strong*) ;; # Don't add it again
+ *) dflt="$dflt -fstack-protector-strong" ;;
+ esac
+ ;;
*-fstack-protector*)
case "$dflt" in
*-fstack-protector*) ;; # Don't add it again