public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: IainS <developer@sandoe-acoustics.co.uk>
To: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Cc: Jack Howarth <howarth@bromo.med.uc.edu>,
	       GCC Patches <gcc-patches@gcc.gnu.org>,
	       Mike Stump <mikestump@comcast.net>
Subject: Re: [PATCH] Avoid -lm and -lpthread in libjava on darwin
Date: Thu, 12 Aug 2010 23:21:00 -0000	[thread overview]
Message-ID: <F0CE9D90-3FFE-4010-BCF7-A849B0555D0F@sandoe-acoustics.co.uk> (raw)
In-Reply-To: <20100812213826.GC26124@bromo.med.uc.edu>


On 12 Aug 2010, at 22:38, Jack Howarth wrote:

> On Thu, Aug 12, 2010 at 11:09:46PM +0200, Ralf Wildenhues wrote:
>> * Andrew Pinski wrote on Thu, Aug 12, 2010 at 08:23:13PM CEST:
>>> On Thu, Aug 12, 2010 at 11:20 AM, Richard Henderson  
>>> <rth@redhat.com> wrote:
>>>> Is this patch necessary with the remove-outfile patch in place?
>>>
>>> Yes because libtool calls ld directly for libjava.  I wish it did  
>>> not
>>> but it does.
>>
>> * Jack Howarth wrote on Thu, Aug 12, 2010 at 08:24:30PM CEST:
>>> The remove-outfile patch is necessary to make sure that the gcc
>>> compilers don't shift libSystem forward in the linkage and
>>> disrupt the logic behind libgcc_ext when -ldl, -lm or -lpthread
>>> is passed to the compiler. The libjava patch covers the hardcoding
>>> of -lpthread and -lm into the linker flags that are passed via
>>> libtool directly to the linker.
>>
>> So do I understand correctly that this ought to be fixed in libtool?
>> Is the requirement to have libSystem last one that is specific to GCC
>> or common to all software built with GCC?

one can say for certain that specifying those libraries is unnecessary  
for Darwin >= 8
(so long as the compiler is using the same specs as gcc which place - 
lSystem as the last item)
If one is linking statically, which is only done for kernel code  
AFAIK, then you need to provide your own static libc anyway.

therefore, those rules could be changed as libtool is updated.

---

as far as link order goes, it's less clear where the issue arises with  
libjava, in principle  the two-level namespace in darwin should deal  
with it.

One thing I'm investigating is that, the libjava spec intercepts % 
(lib) rather than %(libgcc) which does not produce the same effect on  
darwin as other systems since we use   %G %L
and not %L %G %L

Still trying to track down what's happening...

as Jack says, at least putting libgcc before libSystem bypasses the  
buggy math routine.

cheers
Iain

  parent reply	other threads:[~2010-08-12 23:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-12 11:44 Jack Howarth
2010-08-12 13:04 ` Andrew Haley
2010-08-18  9:05   ` IainS
2010-08-12 18:22 ` Richard Henderson
2010-08-12 18:24   ` Andrew Pinski
2010-08-12 21:34     ` Ralf Wildenhues
2010-08-12 22:08       ` Jack Howarth
2010-08-12 22:36         ` Jack Howarth
2010-08-12 23:21         ` IainS [this message]
2010-08-12 23:34           ` IainS
2010-08-13  0:28             ` Jack Howarth
2010-08-12 18:26   ` Jack Howarth
2010-08-12 22:33 ` Mike Stump
2010-08-12 22:46   ` IainS
2010-08-13  5:59     ` Mike Stump
2010-08-12 22:47   ` Mike Stump
2010-08-12 23:08     ` Jack Howarth
2010-08-13 10:08     ` Andrew Haley
2010-08-12 22:59   ` 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=F0CE9D90-3FFE-4010-BCF7-A849B0555D0F@sandoe-acoustics.co.uk \
    --to=developer@sandoe-acoustics.co.uk \
    --cc=Ralf.Wildenhues@gmx.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=howarth@bromo.med.uc.edu \
    --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).