Bug 3049 - binutils have a sysroot bug in ld
Summary: binutils have a sysroot bug in ld
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-06 07:07 UTC by Rick
Modified: 2012-10-21 21:07 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
Patch I used to test with binutils-2.20.1 (1.10 KB, patch)
2011-01-06 07:07 UTC, Rick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rick 2011-01-06 07:07:24 UTC
Created attachment 2839 [details]
Patch I used to test with binutils-2.20.1

I ran into problems using buildroot to cross-compile mpc (and gcc-4.5.x for which mpc is a dependency).  The build would fail and the cross-compile-ld would complain that it couldn't find /lib//libc.so.0

It turns out this is a bug in ld from binutils that was fixed in binutils 2.21:
https://bugs.launchpad.net/binutils/+bug/625320

Basically ld ignores the sysroot path when absolute library paths are given, which causes errors when cross-compiling.

This issue affects any package that uses absolute library paths, such as mpc and others.  

The fix (which is basically this http://bugs.gentoo.org/attachment.cgi?id=195936) ought to be added to the buildroot patches for binutils versions prior to 2.21.
Comment 1 Mike Frysinger 2011-01-06 08:19:25 UTC
the patch hasnt been merged upstream, so why do you think 2.21 is fixed ?
Comment 2 Rick 2011-01-06 08:56:40 UTC
(In reply to comment #1)
> the patch hasnt been merged upstream, so why do you think 2.21 is fixed ?

I thought I had read that somewhere but I closed my windows and can't find that reference.  If it's not fixed in 2.21 then I misunderstood or misread something.
Comment 3 Mike Frysinger 2011-01-06 18:48:55 UTC
perhaps you interpreted the "fixed in ubuntu binutils-xxx" as "fixed upstream"
Comment 4 Peter Korsgaard 2012-10-21 21:07:41 UTC
Fixed in git by Gustavoz, thanks.