Summary: | linking in gas fails with uclibc because of missing libm or flag "-lm" respectively | ||
---|---|---|---|
Product: | binutils | Reporter: | Christian Burger <christian.burger> |
Component: | gas | Assignee: | Alan Modra <amodra> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bug-binutils, ps.m |
Priority: | P2 | ||
Version: | 2.18 | ||
Target Milestone: | --- | ||
Host: | armeb-softfloat-linux-uclibc | Target: | armeb-softfloat-linux-uclibc |
Build: | armeb-softfloat-linux-uclibc | Last reconfirmed: | 2009-01-16 07:41:22 |
Attachments: |
last 100 lines of the build with the error and "make -j"-option not set
link shared libbfd and libopcodes against libm link shared libbfd and libopcodes against libm |
Description
Christian Burger
2008-07-26 10:46:27 UTC
I forgot to explicitly mention, that it is a build related bug. I can't see why arm gas would need -lm to build. I can see that arm objdump does, and this should be handled by AC_SEARCH_LIBS(frexp, m) in binutils/configure.in. Your build log attached to the gentoo bug report is just too confusing since it shows what looks like "make -j" output, ie. the result of multiple compilations emitted in jumbled order. Can you please show just the results of remaking as-new by itself? Created attachment 3028 [details] last 100 lines of the build with the error and "make -j"-option not set (In reply to comment #2) > I can't see why arm gas would need -lm to build. I can see that arm objdump > does, and this should be handled by AC_SEARCH_LIBS(frexp, m) in > binutils/configure.in. I can't help you with that either, I only fixed a symptom and don't know if it is the problem too. > Your build log attached to the gentoo bug report is just too confusing since it > shows what looks like "make -j" output, ie. the result of multiple compilations > emitted in jumbled order. Can you please show just the results of remaking > as-new by itself? Didn't get your last sentence, but I think I did the right thing anyway. Thanks again and bye. I didn't realise this was an --enable-shared build. gas links against the shared libopcodes, which means you are linking against the whole libopcodes. libopcodes has a reference to floatformat_to_double (in arm-dis.c), causing floatformat.o to be linked from libiberty. A static link would only pull in the parts of libopcodes used by gas, so no arm-dis.o needed. It's a little nasty that libopcodes.so needs libiberty like this. Every app linked against libopcodes.so thus pulls in parts of the static libiberty whether or not the app needs it. *** Bug 6937 has been marked as a duplicate of this bug. *** Created attachment 3673 [details] link shared libbfd and libopcodes against libm Would someone please test whether the following patch, when applied to mainline CVS binutils, fixes the problem? You'll need a version more recent than 2001-01-16. to pick up http://sourceware.org/ml/binutils/2009-01/msg00224.html Created attachment 3674 [details]
link shared libbfd and libopcodes against libm
The right patch this time!
Subject: Bug 6768 CVSROOT: /cvs/src Module name: src Changes by: amodra@sourceware.org 2009-03-04 02:10:34 Modified files: bfd : ChangeLog configure.in configure opcodes : ChangeLog configure.in configure Log message: bfd/ PR 6768 * configure.in: Test for ld --as-needed support. Link shared libbfd against libm. * configure: Regenerate. opcodes/ PR 6768 * configure.in: Test for ld --as-needed support. Link shared libopcodes against libm. * configure: Regenerate. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.4484&r2=1.4485 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/configure.in.diff?cvsroot=src&r1=1.255&r2=1.256 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/configure.diff?cvsroot=src&r1=1.296&r2=1.297 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/opcodes/ChangeLog.diff?cvsroot=src&r1=1.1366&r2=1.1367 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/opcodes/configure.in.diff?cvsroot=src&r1=1.88&r2=1.89 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/opcodes/configure.diff?cvsroot=src&r1=1.117&r2=1.118 Should be fixed |