From patchwork Tue Feb 7 11:53:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 139904 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 CAD041007D3 for ; Tue, 7 Feb 2012 22:53:52 +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=1329220434; 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: In-Reply-To:User-Agent:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=knKMZL6W6udUh1b3qEn/i7KnQWo=; b=uzpapLpNqgCcymE IRl4HmvsSbBheRh6REyb22DRlQeFJNpNCoeQKr6nLqb3gcYMu0XV50zoeBmT2a/c 161UVrYLE5omchg2Zh05Td0KoRs+v85WJfGWm0rV/ASrc9Li9iRs+hvce7LEeknU AjxVDY20HzdtMePSZYaBqL7Gps3M= 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:In-Reply-To:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=PCgGiVnjb3sbaH+ake8HQMn/qUiHkt3Ohnb6ESozFtXpzMqgDhpMf9+4Rotk6h REr2cfUTGyO1mWm2BQuHy0WUhGJ0vz0qUln75F2oxDg42Lpe8JpbgA3bVzdiDIcy nC/w0Ql4JGLhoxpdqn+e4NMdKKq0QflPC2HBzEATGjIlE=; Received: (qmail 3251 invoked by alias); 7 Feb 2012 11:53:45 -0000 Received: (qmail 3235 invoked by uid 22791); 7 Feb 2012 11:53:43 -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 11:53:29 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q17BrSbH018755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 7 Feb 2012 06:53:28 -0500 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q17BrQcm022536 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 7 Feb 2012 06:53:27 -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 q17BrPVE027757; Tue, 7 Feb 2012 12:53:25 +0100 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id q17BrOLN027755; Tue, 7 Feb 2012 12:53:24 +0100 Date: Tue, 7 Feb 2012 12:53:24 +0100 From: Jakub Jelinek To: Tijl Coosemans Cc: Richard Guenther , Gerald Pfeifer , gcc-patches@gcc.gnu.org Subject: Re: Add -lssp_nonshared to LINK_SSP_SPEC Message-ID: <20120207115324.GY18768@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek References: <201201101514.40392.tijl@coosemans.org> <20120207085443.GU18768@tyan-ft48-01.lab.bos.redhat.com> <201202071218.01969.tijl@coosemans.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201202071218.01969.tijl@coosemans.org> 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 Tue, Feb 07, 2012 at 12:17:59PM +0100, Tijl Coosemans wrote: > Everything still works on FreeBSD. After discussion about this on IRC Richard expressed his preference for the following variant instead: 2012-02-07 Jakub Jelinek * config/freebsd-spec.h: Add comment about what macros can be defined in this header. (LINK_EH_SPEC, LINK_SSP_SPEC, USE_LD_AS_NEEDED): Don't define here. * config/freebsd.h (LINK_EH_SPEC, LINK_SSP_SPEC, USE_LD_AS_NEEDED): But here instead. Jakub --- gcc/config/freebsd-spec.h.jj 2012-01-30 00:10:01.000000000 +0100 +++ gcc/config/freebsd-spec.h 2012-02-07 12:44:47.000000000 +0100 @@ -134,15 +134,6 @@ is built with the --enable-threads confi #define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1" #endif -#if defined(HAVE_LD_EH_FRAME_HDR) -#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " -#endif - -#ifdef TARGET_LIBC_PROVIDES_SSP -#define 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 -#endif +/* NOTE: The freebsd-spec.h header is included also for various + non-FreeBSD powerpc targets, thus it should never define macros + other than FBSD_* prefixed ones, or USING_CONFIG_FREEBSD_SPEC. */ --- gcc/config/freebsd.h.jj 2010-11-26 18:39:09.000000000 +0100 +++ gcc/config/freebsd.h 2012-02-07 12:45:34.497798123 +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,19 @@ along with GCC; see the file COPYING3. #undef LIB_SPEC #define LIB_SPEC FBSD_LIB_SPEC +#if defined(HAVE_LD_EH_FRAME_HDR) +#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " +#endif + +#ifdef TARGET_LIBC_PROVIDES_SSP +#define 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 +#endif + /************************[ Target stuff ]***********************************/ /* All FreeBSD Architectures support the ELF object file format. */