From patchwork Tue May 8 13:53:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexis Ballier X-Patchwork-Id: 157689 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 32FF6B6FA5 for ; Tue, 8 May 2012 23:54:25 +1000 (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=1337090066; h=Comment: DomainKey-Signature:Received:Received:Received:Received:From:To: Cc:Subject:Date:Message-Id:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=nYlzo8jZifj61aAWSahq7LrHbtU=; b=aBU52YVYHMPlIgC aqma0ju3YJk+5udwyyZ+Y5csVoGXn7heAGCvlXTeHX0rGs2FAN45o8JpwWuLyuhu oZb7w7IXy4PkqA96BGm8OvE8dHgfii1yiL5CQsTRp00AO/fAJdRipOmFhH5+UuHF 1ffFS9mVVA/Gc14cd2twqMtafrLU= 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:From:To:Cc:Subject:Date:Message-Id:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=h/fGXmJBNutNoTqpPC123JhauCtclvGE8pBvPH1KwVobW7L0dwvOOaUjsT3tm2 L7GQtpavU+ySgV53HNbV+Jrn6LUOATM1Q+ssy83LWJHRNSmBiyOZtQKM+UBFAre5 FwnYzBNVPj0OvVPwZnO/+NV/UGI34HU6F4Z4Jgvly5PS8=; Received: (qmail 31374 invoked by alias); 8 May 2012 13:54:17 -0000 Received: (qmail 31189 invoked by uid 22791); 8 May 2012 13:54:15 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 May 2012 13:54:00 +0000 Received: from localhost.localdomain (pc-154-79-101-190.cm.vtr.net [190.101.79.154]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: aballier) by smtp.gentoo.org (Postfix) with ESMTPSA id E2AA61B401E; Tue, 8 May 2012 13:53:58 +0000 (UTC) From: Alexis Ballier To: gcc-patches@gcc.gnu.org Cc: Alexis Ballier Subject: [PATCH] gcc/config/freebsd-spec.h: Fix building PIE executables. Link them with crt{begin, end}S.o and Scrt1.o which are PIC instead of crt{begin, end}.o and crt1.o which are not. Spec synced from gnu-user.h. Date: Tue, 8 May 2012 09:53:43 -0400 Message-Id: <1336485223-20028-1-git-send-email-aballier@gentoo.org> 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 gcc/config/i386/freebsd.h: Likewise. --- gcc/config/freebsd-spec.h | 9 +++------ gcc/config/i386/freebsd.h | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h index 770a3d1..2808582 100644 --- a/gcc/config/freebsd-spec.h +++ b/gcc/config/freebsd-spec.h @@ -64,11 +64,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see before entering `main'. */ #define FBSD_STARTFILE_SPEC \ - "%{!shared: \ - %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ - %{!p:%{profile:gcrt1.o%s} \ - %{!profile:crt1.o%s}}}} \ - crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" + "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ + crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}" /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on the magical crtend.o file (see crtstuff.c) which provides part of @@ -77,7 +74,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see `crtn.o'. */ #define FBSD_ENDFILE_SPEC \ - "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" + "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" /* Provide a LIB_SPEC appropriate for FreeBSD as configured and as required by the user-land thread model. Before __FreeBSD_version diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h index 649274d..dd69e43 100644 --- a/gcc/config/i386/freebsd.h +++ b/gcc/config/i386/freebsd.h @@ -67,11 +67,8 @@ along with GCC; see the file COPYING3. If not see #undef STARTFILE_SPEC #define STARTFILE_SPEC \ - "%{!shared: \ - %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ - %{!p:%{profile:gcrt1.o%s} \ - %{!profile:crt1.o%s}}}} \ - crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" + "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ + crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}" /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on the magical crtend.o file (see crtstuff.c) which provides part of @@ -81,7 +78,7 @@ along with GCC; see the file COPYING3. If not see #undef ENDFILE_SPEC #define ENDFILE_SPEC \ - "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" + "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" /* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support for the special GCC options -static and -shared, which allow us to