From f1c9126b8518d869e89228f3e5930b24abbbc51e Mon Sep 17 00:00:00 2001 From: jakub Date: Thu, 22 Jan 2015 20:45:59 +0000 Subject: [PATCH] * 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}. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220014 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 9 +++++++++ gcc/config/freebsd.h | 4 +++- gcc/gcc.c | 7 +++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5a3ec54..c166933 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2015-01-22 Rainer Orth + Jakub Jelinek + + * 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 H.J. Lu diff --git a/gcc/config/freebsd.h b/gcc/config/freebsd.h index 215451e..0e8e63e 100644 --- a/gcc/config/freebsd.h +++ b/gcc/config/freebsd.h @@ -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 diff --git a/gcc/gcc.c b/gcc/gcc.c index c1e5ca5..71c1f72 100644 --- 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 -- 2.7.4