collect2: cannot find ld

Pablo León pablo.leon at horus.es
Wed Mar 29 19:34:15 UTC 2006



Rob Landley escribió:
> On Wednesday 29 March 2006 5:09 am, Pablo León wrote:
>> After some days of tweaking, finally I have got my uClib development
>> system (almost) working.
> 
> There's a bug in some versions of gcc that if "." is in your path, collect2 
> will ignore $PATH when looking for ld because the FSF thinks it knows better 
> than you do in that case.
> 
> That was the cause of my persistent "can't find ld" bug, and I had to trace 
> through the collect2 source code to figure out why.  But that doesn't seem to 
> be affecting you here...

No, there are no dots in my PATH.

> 
>> I have build it using buildroot with 
>> busybox-1.1.1, gcc-3.4.6, make-3.80, and all of the compiling stuff
>> needed. I can even compile and run a simple "Hello World" c program
>> without any problem.
>>
>> But when I try to compile any standard "configure/make/make install"
>> linux package, I always get the following error message at configure stage:
>>
>> configure: error: installation or configuration problem: C compiler
>> cannot create executables.
>>
>> And config.log states:
>>
>> configure:722: gcc -o conftest conftest.c 1>&5
>> collect2: cannot find 'ld'
>> configure: failed program was:
>> #line 768 "configure"
>> #include "confdefs.h"
>> main(){return(0);}
>>
>> I have double-checked that ld is in the PATH. The only thing suspicious
>> to me is that ash export feature seems broken:
> 
> Does msh have the same problem?

Yes, I have build busybox with msh support and still the same problem.

> 
>> root at uc:/usr/local# export PATH
>> root at uc:/usr/local# cat testpath
>> #! /bin/sh
>> echo $PATH
>> root at uc:/usr/local# echo $PATH
>> /bin:/sbin:/usr/bin:/usr/sbin
>> root at uc:/usr/local# ./testpath
>> /usr/local/bin:/usr/bin:/sbin:/bin
> 
> Does running /bin/sh read in any kind of profile?

Yes, I have an /etc/profile:

PATH="/bin:/sbin:/usr/bin:/usr/sbin"
TERM=linux
PS1='\u@\h:\w\# '
PS2='> '
export PATH TERM PS1 PS2

> 
>> Any way, ld is located at /usr/bin, so it should be located by collect2.
> 
> Dunno.

Which is the recommended shell (and compile options) for a development 
system?

> 
> Rob
> 
>> Any hint would be very appreciated. Thank you very much.
>> _______________________________________________
>> busybox mailing list
>> busybox at busybox.net
>> http://busybox.net/cgi-bin/mailman/listinfo/busybox
> 



More information about the busybox mailing list