* gcc.c (LINK_SSP_SPEC): Handle -fstack-protector-explicit
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Jan 2015 20:45:59 +0000 (20:45 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Jan 2015 20:45:59 +0000 (20:45 +0000)
for !TARGET_LIBC_PROVIDES_SSP version and
-fstack-protector-{all,strong,explicit} otherwise.
* config/freebsd.h (LINK_SSP_SPEC): Handle
-fstack-protector-{strong,explicit}.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220014 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/freebsd.h
gcc/gcc.c

index 5a3ec54..c166933 100644 (file)
@@ -1,3 +1,12 @@
+2015-01-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+           Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.c (LINK_SSP_SPEC): Handle -fstack-protector-explicit
+       for !TARGET_LIBC_PROVIDES_SSP version and
+       -fstack-protector-{all,strong,explicit} otherwise.
+       * config/freebsd.h (LINK_SSP_SPEC): Handle
+       -fstack-protector-{strong,explicit}.
+
 2015-01-22  Jan Hubicka  <hubicka@ucw.cz>
            H.J. Lu  <hongjiu.lu@intel.com>
 
index 215451e..0e8e63e 100644 (file)
@@ -49,7 +49,9 @@ along with GCC; see the file COPYING3.  If not see
 #endif
 
 #ifdef TARGET_LIBC_PROVIDES_SSP
-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared}"
+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+                      "|fstack-protector-strong|fstack-protector-explicit" \
+                      ":-lssp_nonshared}"
 #endif
 
 #undef TARGET_LIBC_HAS_FUNCTION
index c1e5ca5..71c1f72 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -728,9 +728,12 @@ proper position among the other output files.  */
 
 #ifndef LINK_SSP_SPEC
 #ifdef TARGET_LIBC_PROVIDES_SSP
-#define LINK_SSP_SPEC "%{fstack-protector:}"
+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+                      "|fstack-protector-strong|fstack-protector-explicit:}"
 #else
-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-strong|fstack-protector-all:-lssp_nonshared -lssp}"
+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+                      "|fstack-protector-strong|fstack-protector-explicit" \
+                      ":-lssp_nonshared -lssp}"
 #endif
 #endif