This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Android Native GCC 4.9.2 Build Fails at Dynamic libgcc
- From: Cyd Haselton <chaselton at gmail dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: brian at shapes dot demon dot co dot uk, "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Wed, 7 Jan 2015 08:32:03 -0600
- Subject: Re: Android Native GCC 4.9.2 Build Fails at Dynamic libgcc
- Authentication-results: sourceware.org; auth=none
- References: <CAHu5PrboyVq7orESm4N3m+2aQZaQNPAkcG4AJ7rFnFu+Q=tKWQ at mail dot gmail dot com> <549DDADB dot 4020707 at redhat dot com> <CAHu5PraJcUxrKcs36uc=njbbs7HLRr4+ozL04OzMEPVyZCDBUw at mail dot gmail dot com> <549EEEF6 dot 9030506 at redhat dot com> <CAHu5PrYG50rU-o7MrFkehdNpQ-KvXYmh6Ymr=OzmYe++V_Wppg at mail dot gmail dot com> <CAHu5PrZ2-Ts7SOqtj=ZdyFbAWpYhf5uEqMAieuJx+1SpmvV1rQ at mail dot gmail dot com> <54A660C4 dot 3030108 at redhat dot com> <CAHu5PrbjFyy83xYUdx+vSVQuVJhD-_HzEAb735o_K+dVbXDLag at mail dot gmail dot com> <54A67520 dot 6030801 at redhat dot com> <CAHu5PrZpsNYawNMacyuZMb9owEsRFf8NN6KqsZZ-zbxYf8_JrA at mail dot gmail dot com> <CAHu5PrY3WjeVGb6e_pgKuALw+kdkJ5HaOSTpAAZpPA3g0i9CNA at mail dot gmail dot com> <1420567682 dot 2034 dot 9 dot camel at shapes dot demon dot co dot uk> <54AC3540 dot 30100 at redhat dot com> <CAHu5PrYEnSjZiu6QSb=75AueOSyqu7jwxeEJW5UaAw+zQ2F51Q at mail dot gmail dot com> <54AD0516 dot 5000804 at redhat dot com> <54AD23EA dot 2070905 at redhat dot com> <1420636833 dot 1716 dot 2 dot camel at shapes dot demon dot co dot uk> <54AD369D dot 1020208 at redhat dot com>
On Wed, Jan 7, 2015 at 7:37 AM, Andrew Haley <aph@redhat.com> wrote:
> On 01/07/2015 01:20 PM, Brian Drummond wrote:
>> On Wed, 2015-01-07 at 12:17 +0000, Andrew Haley wrote:
>>> On 01/07/2015 12:14 PM, Cyd Haselton wrote:
>>>> Here goes.
>>>
>>> You mailer mangled that. As an attachment please.
>>>
>>> Andrew.
>>>
>>
>> Below is the relevant command I saw in the attachment (most .o filenames
>> redacted)...
>>
>> It ends with
>> fakechroot: dlopen: undefined symbol: dlopen
>> collect2: error: ld returned 1 exit status
>> make: *** [libgcc_s.so] Error 1
>>
>> which I think reinforces your hypothesis that it is the ld program
>> itself which fails, rather than anything in the files being linked.
>>
>> I don't know if Cyd cc'ed you this message...
>> (I'll forward it to the list)
>> ----------------------------------------------------------------------
>>> The following is a quote from the developer who created the
>>> environment I'm using:
>>>
>>> "Using libfakechroot to virtualize a root filesystem is a bit of a
>>> hack, to be honest, and its weaknesses are easily exposed. Most
>>> obviously, it will only filter dynamic calls to the Bionic C library
>>> (because that was the C library it itself is linked against).
>> ...
>>> I've been in contact with him regarding a number of other ports and
>>> he's confirmed that reverting to static linking would be a pain.
>>>
>>> Also, iIn case anyone reading this is interested:
>>> http://kevinboone.net/kbox2_how_it_works.html
>> ----------------------------------------------------------------------
>>
>> which makes me wonder about Bionic's support for dlopen(). Cyd confirmed
>> that he uses the same binutils version for 4.8 and 4.9 so we may be
>> looking at a failure in a 2-step process
>>
>> (a) 4.9 assumes some capability from ld that 4.8 doesn't, which requires
>> a DLL to be opened
>>
>> (b) fakechroot layered over Bionic is failing to implement that
>> capability (we know from nm that dlopen is undefined in Cyd's
>> libfakechroot.so)
>>
>> Step (a) may be within the remit of gcc-help, what is the difference and
>> can it be worked round) but step (b) probably lies elsewhere : as a
>> first step, enquire about the missing dlopen() in fakechroot.
>
> I think it's now becoming clear what is happening. Something in ld is
> calling dlopen, and fakechroot prints the error. But it's not clear to
> me which dlopen does not work in fakechroot.
>
This is probably a stupid question, but here goes: How many dlopens are there?
> My guess is that the problem is due to link-time optimization. gcc is
> trying to run -plugin /bld/gcc/builddir-4.9/./gcc/liblto_plugin.so. 4.8
> does not do this.
>
> Maybe fakechroot can be persuaded to produce a decent error message with
> some more information.
I doubt it. The fakechroot running the environment hasn't been
updated since it was built, due to the developer's understandable
reluctance to update a key part of the environment.
I've thought about building a later version...have even downloaded the
source...but was holding off until I'd updated a few other things. It
may be time to take another look.
>
> It may be possible to disable LTO.
Between updating fakechroot and this, this would be the easier option.
Would it be done through configure?
>
> Andrew.
>