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: Andrew Haley <aph at redhat dot com>
- To: Cyd Haselton <chaselton at gmail dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Tue, 23 Dec 2014 09:30:42 +0000
- 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> <54986284 dot 5060402 at redhat dot com> <CAHu5PrYCfCUOBJC=ucYRAEued+FGe9VCYR6tSRc-55pM8c2G3A at mail dot gmail dot com> <54986B89 dot 3080002 at redhat dot com> <CAHu5PraqcyjeoNQBJWK5QpY1=keheSjqY20UbpBTmLJqS4jW6w at mail dot gmail dot com> <CAHu5Prb0KTMAg7cOZo-pMRxqbYHcuGCSMMK1nU9DFWkP8TM_6A at mail dot gmail dot com>
On 22/12/14 20:55, Cyd Haselton wrote:
> On Mon, Dec 22, 2014 at 1:09 PM, Cyd Haselton <chaselton@gmail.com> wrote:
>> On Mon, Dec 22, 2014 at 1:05 PM, Andrew Haley <aph@redhat.com> wrote:
>>> On 12/22/2014 06:40 PM, Cyd Haselton wrote:
>>>>> What does your /usr/lib/libc.so look like? I'd expect to see
>>>>>> something like this:
>>>>>>
>>>>>> /* GNU ld script
>>>>>> Use the shared library, but some functions are only in
>>>>>> the static library, so try that secondarily. */
>>>>>> OUTPUT_FORMAT(elf64-x86-64)
>>>>>> GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) )
>>>>
>>>> I'm not quite sure what you're asking; I'm using a sysroot with the
>>>> build compiler and the libc.so is not a script but an actual library.
>>>> Were you asking about the build link script or the stage1 link script?
>>>
>>> I'm asking about the file /usr/lib/libc.so.
>>>
>>> If it's a script which looks like the file above you'll get
>>> the function definitions you need when you link against libc,
>>> even though dlopen is defined in ld-blah.so.
>>
>> There's no /usr/lib/libc.so in the environment in which I'm working on
>> my Android device.
>>
>> The script excerpt you included in your original email looks familiar
>> though. Is it possible the script is located elsewhere, with a
>> different name?
>
> Or, if not, is there a workaround? I'm assuming there is as I've
> built versions previous to 4.8.x on-device...
You said "when bootstrapping 4.8.0 I was able to get around this by
specifying -ldl in LDFLAGS and LIBS when running configure" which
tells me that 4.8.0 was also broken. Either Android needs a linker
script like GNU/Linux or you need to actually get in there and edit
GCC's build scripts to link against libdl.
Andrew.