This is the mail archive of the
mailing list for the GCC project.
Re: Add -lssp_nonshared to LINK_SSP_SPEC
- From: Tijl Coosemans <tijl at coosemans dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Guenther <richard dot guenther at gmail dot com>, Gerald Pfeifer <gerald at pfeifer dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 7 Feb 2012 12:17:59 +0100
- Subject: Re: Add -lssp_nonshared to LINK_SSP_SPEC
- References: <email@example.com> <CAFiYyc1iSeXCkbj_GxP8w3_6mwHVJ36Oco4qNFGugRCvB=nGog@mail.gmail.com> <20120207085443.GU18768@tyan-ft48-01.lab.bos.redhat.com>
On Tuesday 07 February 2012 09:54:43 Jakub Jelinek wrote:
> On Mon, Jan 23, 2012 at 12:03:27PM +0100, Richard Guenther wrote:
>> On Mon, Jan 23, 2012 at 12:23 AM, Gerald Pfeifer <firstname.lastname@example.org> wrote:
>>> On Sat, 21 Jan 2012, Tijl Coosemans wrote:
>>>> I've been using this patch now. It's similar to the above url, but
>>>> conditional on TARGET_LIBC_PROVIDES_SSP to support older FreeBSD
>>>> Gerald volunteered to commit. Gerald, just trunk for now or older
>>>> branches too?
>>> If Richi agries, I'd apply this on trunk and the GCC 4.6 branch,
>>> since that is the stable release our users employ.
>> Sure, go ahead.
>>> PS: We also need to update the copyright date at the top, and I'll
>>> take care of that when committing.
>>>> 2011-01-20 Tijl Coosemans <email@example.com>
>>>> * gcc/config/freebsd-spec.h [TARGET_LIBC_PROVIDES_SSP] (LINK_SSP_SPEC): Define.
> This change unfortunately broke all non-freebsd powerpc* targets.
> For some weird reason freebsd-spec.h is included for all powerpc* targets
> (to support -mcall-freebsd), which means that e.g. on powerpc64-linux
> the above results in -fstack-protector being broken.
> So, if this mess is really needed (does anybody actually use -mcall-freebsd
> on non-freebsd targets?), IMHO freebsd-spec.h must avoid defining non-FBSD_
> prefixed macros, as the following (completely untested) patch. Don't have
> access to FreeBSD to test it there though, can test on powerpc64-linux.
Everything still works on FreeBSD.
> --- gcc/config/freebsd.h.jj 2010-11-26 18:39:09.000000000 +0100
> +++ gcc/config/freebsd.h 2012-02-07 09:48:50.872294367 +0100
> @@ -45,6 +45,21 @@ along with GCC; see the file COPYING3.
> #undef LIB_SPEC
> #define LIB_SPEC FBSD_LIB_SPEC
> +#ifdef FBSD_LINK_EH_SPEC
> +#undef LINK_EH_SPEC
> +#define LINK_EH_SPEC FBSD_LINK_EH_SPEC
> +#ifdef FBSD_LINK_SSP_SPEC
> +#undef LINK_SSP_SPEC
> +#define LINK_SSP_SPEC FBSD_LINK_SSP_SPEC
FYI, there are extra spaces on this line.