gcc.c (LINK_SSP_SPEC): Handle -fstack-protector-explicit for !TARGET_LIBC_PROVIDES_SS...
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Thu, 22 Jan 2015 20:45:59 +0000 (20:45 +0000)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 22 Jan 2015 20:45:59 +0000 (21:45 +0100)
* 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}.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r220014

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

index 5a3ec54b707ba3fffca753e6690475255cd20c27..c1669330aab55712786fd93812ad064c8434f3d5 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 215451e275bbdbade2b718c66fbdb1055d8695f3..0e8e63ed57ebbf205214e627f7d985aef323a97c 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 c1e5ca5037657ea133d5f7952d73b44911bf9bb8..71c1f720192618f5db741842ec8304ab7ade16df 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