This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Help: GOLD unable to find logf() in libm.so when sysroot is enabled
- From: Nick Clifton <nickc at redhat dot com>
- To: iant at google dot com, ccoutant at gmail dot com
- Cc: binutils at sourceware dot org
- Date: Thu, 03 Nov 2016 10:15:15 +0000
- Subject: Help: GOLD unable to find logf() in libm.so when sysroot is enabled
- Authentication-results: sourceware.org; auth=none
Hi Ian, Hi Cary,
Do you have a minute to help me with a Fedora binutils bug which I
think might be a generic GOLD problem ?
https://bugzilla.redhat.com/show_bug.cgi?id=1386126
The problem appears to be that an ARM native GOLD linker built with
--with-sysroot=/ enabled reports that it cannot resolve a reference to
the logf symbol (in libm.so), despite the fact that it has found the
library:
SYSROOT GOLD
/usr/lib/ghc-7.10.3/text_HmqVQnZSpjaC156ABqPhne/libHStext-1.2.2.1-HmqVQnZSpjaC156ABqPhne-ghc7.10.3.so: reference to logf
/usr/lib/ghc-7.10.3/base_HQfYBxpPvuw8OunzQu6JGM/libHSbase-4.8.2.0-HQfYBxpPvuw8OunzQu6JGM-ghc7.10.3.so: reference to logf
/usr/lib/ghc-7.10.3/ghcpr_8TmvWUcS1U1IKHT0levwg3/libHSghc-prim-0.4.0.0-8TmvWUcS1U1IKHT0levwg3-ghc7.10.3.so: reference to logf
/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/6.2.1/../../../libm.so: definition of logf
/usr/lib/ghc-7.10.3/text_HmqVQnZSpjaC156ABqPhne/libHStext-1.2.2.1-HmqVQnZSpjaC156ABqPhne-ghc7.10.3.so: error: undefined reference to 'logf'
NON-SYSROOT GOLD
/usr/lib/ghc-7.10.3/text_HmqVQnZSpjaC156ABqPhne/libHStext-1.2.2.1-HmqVQnZSpjaC156ABqPhne-ghc7.10.3.so: reference to logf
/usr/lib/ghc-7.10.3/base_HQfYBxpPvuw8OunzQu6JGM/libHSbase-4.8.2.0-HQfYBxpPvuw8OunzQu6JGM-ghc7.10.3.so: reference to logf
/usr/lib/ghc-7.10.3/ghcpr_8TmvWUcS1U1IKHT0levwg3/libHSghc-prim-0.4.0.0-8TmvWUcS1U1IKHT0levwg3-ghc7.10.3.so: reference to logf
/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/6.2.1/../../../libm.so: definition of logf
Apparently this problem is restricted to the ARM and AARCH64 targets,
although I have not verified this. It may be a factor of the build
systems involved, in that the build for non-arm targets might use a
different location for the application libraries. That is just a
guess however.
Also I do not know if the logf symbol is special, or it just happens
that this is the only symbol in libm.so that is needed by the
libHStext-1.2.2.1-HmqVQnZSpjaC156ABqPhne-ghc7.10.3.so library. I
suspect the latter however.
I have found that if I add a second reference to logf in an ordinary
object file that the link then works.
I am currently using the 2.27 gold sources to reproduce this problem.
I am about to start a test using the mainline sources, but it takes a
day to spin up a new linker and as far as I can see there have no
changes to sysroot handling since 2.27 anyway, so I doubt it this will
resolve the issue.
Do you have any suggestions or insights ?
Thanks.
Cheers
Nick