From patchwork Tue Feb 7 08:54:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 139887 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 796E6B7209 for ; Tue, 7 Feb 2012 19:55:14 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1329209716; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To:User-Agent:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=89R3ZURNHjC0PXBuavcNHAvwqdo=; b=oxgJB0BKxVEZj+vzzvdlGHR0JWvyjB0B03RczGRCghJWuAmBCx8itYNyXsdPHz cxt6bFT9cfksQhzoOYZh9UaSOwPd16EegQLuPfSniNcFt4ec+AZIq7jR8qdeyCz+ G/7GTq/YYFuVXoJJ747UivBknwIWJNq/5Pf1YrxlBVwCk= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To:References:MIME-Version:Content-Type:Content-Disposition:Content-Transfer-Encoding:In-Reply-To:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Ky043y6EKN674946MOGvQ7J9J1EUTjZ/dW1UXAmdhHt8OvNIDR4bcc731jTMDz LMejtIue1bGpV2zBqsdl0lXdz1D2Osvr0eFaVrNUsdgS+HdCHOVjgH2kx+rG9Dkt J/nNOX39ZMRJZAFthLYa2dQ1ozSjzjtauuQSSUskeKFpw=; Received: (qmail 1066 invoked by alias); 7 Feb 2012 08:55:08 -0000 Received: (qmail 1054 invoked by uid 22791); 7 Feb 2012 08:55:06 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, TW_LG, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Feb 2012 08:54:51 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q178slwa018319 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 7 Feb 2012 03:54:48 -0500 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q178skMZ012429 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 7 Feb 2012 03:54:47 -0500 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id q178sjuK027421; Tue, 7 Feb 2012 09:54:45 +0100 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id q178sh8K027419; Tue, 7 Feb 2012 09:54:43 +0100 Date: Tue, 7 Feb 2012 09:54:43 +0100 From: Jakub Jelinek To: Richard Guenther Cc: Gerald Pfeifer , Tijl Coosemans , gcc-patches@gcc.gnu.org Subject: Re: Add -lssp_nonshared to LINK_SSP_SPEC Message-ID: <20120207085443.GU18768@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek References: <201201101514.40392.tijl@coosemans.org> <201201102050.24745.tijl@freebsd.org> <201201210001.37213.tijl@coosemans.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Mon, Jan 23, 2012 at 12:03:27PM +0100, Richard Guenther wrote: > On Mon, Jan 23, 2012 at 12:23 AM, Gerald Pfeifer 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 > >> versions. > >> > >> 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. > > Richard. > > > Gerald > > > > 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   > >> > >>       * 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. 2012-02-07 Jakub Jelinek * config/freebsd-spec.h (LINK_EH_SPEC, LINK_SSP_SPEC, USE_LD_AS_NEEDED): Don't define. (FBSD_LINK_EH_SPEC, FBSD_LINK_SSP_SPEC, FBSD_USE_LD_AS_NEEDED): Define these instead. * config/freebsd.h (LINK_EH_SPEC, LINK_SSP_SPEC, USE_LD_AS_NEEDED): Redefine to FBSD_* macros if those are defined. Jakub --- gcc/config/freebsd-spec.h.jj 2012-01-30 00:10:01.000000000 +0100 +++ gcc/config/freebsd-spec.h 2012-02-07 09:46:05.031256945 +0100 @@ -135,14 +135,15 @@ is built with the --enable-threads confi #endif #if defined(HAVE_LD_EH_FRAME_HDR) -#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " +#define FBSD_LINK_EH_SPEC "%{!static:--eh-frame-hdr} " #endif #ifdef TARGET_LIBC_PROVIDES_SSP -#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared}" +#define FBSD_LINK_SSP_SPEC \ + "%{fstack-protector|fstack-protector-all:-lssp_nonshared}" #endif /* Use --as-needed -lgcc_s for eh support. */ #ifdef HAVE_LD_AS_NEEDED -#define USE_LD_AS_NEEDED 1 +#define FBSD_USE_LD_AS_NEEDED 1 #endif --- 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 @@ -1,6 +1,6 @@ /* Base configuration file for all FreeBSD targets. Copyright (C) 1999, 2000, 2001, 2007, 2008, 2009, - 2010 Free Software Foundation, Inc. + 2010, 2011, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -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 +#endif + +#ifdef FBSD_LINK_SSP_SPEC +#undef LINK_SSP_SPEC +#define LINK_SSP_SPEC FBSD_LINK_SSP_SPEC +#endif + +#ifdef FBSD_USE_LD_AS_NEEDED +#undef USE_LD_AS_NEEDED +#define USE_LD_AS_NEEDED FBSD_USE_LD_AS_NEEDED +#endif + /************************[ Target stuff ]***********************************/ /* All FreeBSD Architectures support the ELF object file format. */