From patchwork Fri Jun 17 11:04:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 100794 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 71628B6FA8 for ; Fri, 17 Jun 2011 21:04:57 +1000 (EST) Received: (qmail 14343 invoked by alias); 17 Jun 2011 11:04:56 -0000 Received: (qmail 14335 invoked by uid 22791); 17 Jun 2011 11:04:55 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, TW_GC, TW_IB X-Spam-Check-By: sourceware.org Received: from c2bthomr10.btconnect.com (HELO mail.btconnect.com) (213.123.20.128) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Jun 2011 11:04:38 +0000 Received: from host81-138-1-83.in-addr.btopenworld.com (EHLO thor.office) ([81.138.1.83]) by c2bthomr10.btconnect.com with ESMTP id DHM95310; Fri, 17 Jun 2011 12:04:36 +0100 (BST) Cc: GCC Patches , Mike Stump Message-Id: <4C4D13B3-179F-44B9-BDB0-29EE706C589A@sandoe-acoustics.co.uk> From: IainS To: Jack Howarth In-Reply-To: <20110617022132.GA18745@bromo.med.uc.edu> Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [PATCH]: Pass -no_pie on SYSTEMSPEC for darwin11 Date: Fri, 17 Jun 2011 12:04:34 +0100 References: <20110617022132.GA18745@bromo.med.uc.edu> X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=tid=0001.0A0B0301.4DFB34C3.0016, actions=tag X-Junkmail-Premium-Raw: score=7/50, refid=2.7.2:2011.6.17.93914:17:7.763, ip=81.138.1.83, rules=__HAS_MSGID, __SANE_MSGID, __MSGID_APPLEMAIL, FROM_NAME_ONE_WORD, __TO_MALFORMED_2, __CT, __CT_TEXT_PLAIN, __CTE, __MIME_VERSION, __MIME_VERSION_APPLEMAIL, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __SUBJ_ALPHA_END, __HAS_X_MAILER, __X_MAILER_APPLEMAIL, __ANY_URI, __URI_NO_WWW, __URI_NO_PATH, __CP_MEDIA_BODY, __MEDS_PLAIN_MEDICATION, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_2000_2999, __MIME_TEXT_ONLY, RDNS_GENERIC_POOLED, BODY_SIZE_5000_LESS, RDNS_SUSP_GENERIC, __USER_AGENT_APPLEMAIL, RDNS_SUSP, BODY_SIZE_7000_LESS X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A0B0202.4DFB34C4.01CE, ss=1, fgs=0, ip=0.0.0.0, so=2010-07-22 22:03:31, dmn=2009-09-10 00:05:08, mode=multiengine 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 Hi Jack, On 17 Jun 2011, at 03:21, Jack Howarth wrote: > > The gcj compiler needs to pass -no_pie for linkage on darwin11 due > to the new -pie > default of the linker. The attached patch accomplishes this by > passing -no_pie on SYSTEMSPEC > for *-*-darwin[12]*. Since Darwin10 supports -no_pie in its linker, > I included it in the > triplet match to simplify the syntax. Bootstrap and tested on x86_64- > apple-darwin11. > Okay for gcc trunk? > Jack > > 2011-06-16 Jack Howarth > > * libjava/configure.ac (SYSTEMSPEC): Pass -no_pie for darwin11. > * libjava/configure: Regenerate. I would like to see some more analysis of what the underlying reasons for failure are. -fpie works fine with darwin 9 and darwin 10 libjava [XCode 3.1.4 and 3.2.5 respectively, bootstrap w/4.2.1] (modulo suppressing it when building test-suite .dylibs *** - which is a testsuite options handling issue - not a fundamental problem). so: make -k check-target-libjava "RUNTESTFLAGS=--target_board=unix/-fpie\{- m32,-m64\} " passes without regression (re the no pie case) given that pie is suppressed for dylibs. ----- So is your proposed patch a work-around for (as yet unreleased) darwin 11 tool-chain bugs or ... ? Iain ALIGN) \ do { \ === **** kludge to suppress pie for for dylibs (use in place of the darwin9.h hunk from the attachment on PR49371). Index: gcc/config/darwin9.h =================================================================== --- gcc/config/darwin9.h (revision 175110) +++ gcc/config/darwin9.h (working copy) @@ -35,6 +35,12 @@ along with GCC; see the file COPYING3. If not see /* Tell collect2 to run dsymutil for us as necessary. */ #define COLLECT_RUN_DSYMUTIL 1 +#undef PIE_SPEC +#define PIE_SPEC \ + "%{fpie|pie|fPIE: %{!Zdynamiclib: \ + %{mdynamic-no-pic: %n'-mdynamic-no-pic' overrides '-pie', '- fpie' or '-fPIE'; \ + :-pie}}}" + #undef ASM_OUTPUT_ALIGNED_COMMON #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE,