From: Jack Howarth <howarth@bromo.med.uc.edu>
To: IainS <developer@sandoe-acoustics.co.uk>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
Mike Stump <mikestump@comcast.net>
Subject: Re: [PATCH]: Pass -no_pie on SYSTEMSPEC for darwin11
Date: Fri, 17 Jun 2011 13:57:00 -0000 [thread overview]
Message-ID: <20110617130544.GA23292@bromo.med.uc.edu> (raw)
In-Reply-To: <4C4D13B3-179F-44B9-BDB0-29EE706C589A@sandoe-acoustics.co.uk>
On Fri, Jun 17, 2011 at 12:04:34PM +0100, IainS wrote:
> 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 <howarth@bromo.med.uc.edu>
>>
>> * 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.
Iain,
I suspect these failures are related to those seen in the boehm-gc
testsuite when those tests are built with the default -pie linker option. I'll
have to repeat a build without the patch but a cursory examination suggests
ecj1 is miscompiled with -pie. If I remove -no_pie from /sw/lib/gcc4.7/lib/libgcj.spec
after building and installing gcc trunk, the crashes in gcj don't occur.
IMHO, my patch is effectively doing the same thing that Mike checked in with...
# Ensure we don't try and use -pie, as it is incompatible with pch.
BOOT_LDFLAGS += `case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; esac;`
The libjava build uses gcj.spec to build ecj1, etc and Mike's change is insufficient
to cause -no_pie to be used for those cases (since those parts of the libjava bootstrap
don't honor BOOT_LDFLAGS).
Jack
ps I'll repeat the bootstrap without my patch and open a PR for the gcj failure.
However, I believe it was an exception failure which would place us in the system unwinder
and that will be extremely difficult to debug outside of Apple.
>
> -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
>
> ===
> ****
> 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, ALIGN) \
> do { \
next prev parent reply other threads:[~2011-06-17 13:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-17 4:32 Jack Howarth
2011-06-17 11:21 ` IainS
2011-06-17 13:57 ` Jack Howarth [this message]
2011-06-17 15:34 ` Jack Howarth
2011-06-17 15:55 ` Jack Howarth
2011-06-18 5:54 ` Jack Howarth
2011-06-18 8:57 ` IainS
2011-06-17 17:49 ` Mike Stump
2011-06-17 20:10 ` Jack Howarth
2011-06-18 8:32 ` IainS
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110617130544.GA23292@bromo.med.uc.edu \
--to=howarth@bromo.med.uc.edu \
--cc=developer@sandoe-acoustics.co.uk \
--cc=gcc-patches@gcc.gnu.org \
--cc=mikestump@comcast.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).