gcc 3.4.4 collect2: cannot find ld

Moser, Dan (GE Trans) Dan.Moser@Trans.ge.com
Wed Jul 6 18:34:00 GMT 2005


Found my own answer.  I'll document it here for any future generations that come across the same problem.

collect2 finds the linker as specified in

http://gcc.gnu.org/onlinedocs/gccint/Collect2.html#Collect2

To determine your compiler's search path use the -print-search-dirs option.

In my case, the exact syntax was 'powerpc-eabi-g++ -print-search-dirs'.

>From that output, I picked one of the compiler path directories and put a copy of ld (renamed to real-ld) into the first path entry.

Simple as that.

Dan



> -----Original Message-----
> From: Moser, Dan (GE Trans) 
> Sent: Wednesday, July 06, 2005 1:41 PM
> To: 'gcc-help@gcc.gnu.org'
> Subject: gcc 3.4.4 collect2: cannot find ld
> 
> 
> Hi,
> 
> I have seen some other (older-not gcc 3.4.4) posts regarding 
> this issue but couldn't find where a solution was ever given.
> 
> I just upgraded to gcc 3.4.4.  I had been successfully using 
> 3.4.3 and don't recall having to deal with this issue under 
> that version.
> 
> Below is the verbose output of the attempted link (well, collect2).
> 
> The area of interest in the text below are the lines
> 
> ========================================
> collect2 version 3.4.4 (PowerPC Embedded)
> ld_file_name        = not found
> ========================================
> 
> Note that 'ld' does exist on my path as '/usr/bin/ld'.
> 
> I have also tried placing ld at other locations in my path 
> but still had the same problem.
> 
> Any insight is greatly appreciated.
> 
> Thanks in advance,
> Dan Moser
> 
> 
> Reading specs from /home/moser/lib/gcc/powerpc-eabi/3.4.4/specs
> Configured with: /home/moser/gcc-3.4.4/configure 
> --target=powerpc-eabi --prefix=/home/moser --with-newlib 
> --with-headers=/home/moser/powerpc-eabi/include --disable-nls 
> --enable-languages=c,c++ --disable-multilib --disable-shared 
> --with-gnu-as --with-gnu-ld
> Thread model: single
> gcc version 3.4.4
>  /home/moser/libexec/gcc/powerpc-eabi/3.4.4/collect2.exe -V 
> -Qy -dn -Bstatic -L/home/moser/lib/gcc/powerpc-eabi/3.4.4 
> -L/home/moser/lib/gcc/powerpc-eabi/3.4.4/../../../../powerpc-e
> abi/lib -v -debug -Tlinker.ld -M --cref --sort-common 
> -odan.elf -lnosys ecrti.o danCrt0.o newlibSysCalls.o other.o 
> Mpc561.o danMain.o interruptHandlers.o exceptionHandlers.o 
> PowerPcRateMonotonicScheduler.o TaskScheduler.o main.o 
> ecrtn.o -lstdc++ -lm -lc -lgcc -lgcc 
> /home/moser/lib/gcc/powerpc-eabi/3.4.4/crtsavres.o
> Convert string 
> '/home/moser/libexec/gcc/powerpc-eabi/3.4.4/:/home/moser/libex
> ec/gcc/powerpc-eabi/3.4.4/:/home/moser/libexec/gcc/powerpc-eab
i/:/home/moser/lib/gcc/powerpc-> eabi/3.4.4/:/home/moser/lib/gcc/powerpc-eabi/:/usr/libexec/gcc
> /powerpc-eabi/3.4.4/:/usr/libexec/gcc/powerpc-eabi/:/usr/lib/g
> cc/powerpc-eabi/3.4.4/:/usr/lib/gcc/powerpc-eabi/:/home/moser/
> lib/gcc/powerpc-eabi/3.4.4/../../../../powerpc-eabi/bin/powerp
> c-eabi/3.4.4/:/home/moser/lib/gcc/powerpc-eabi/3.4.4/../../../
> ../powerpc-eabi/bin/' into prefixes, separator = ':'
>   - add prefix: /home/moser/libexec/gcc/powerpc-eabi/3.4.4/
>   - add prefix: /home/moser/libexec/gcc/powerpc-eabi/3.4.4/
>   - add prefix: /home/moser/libexec/gcc/powerpc-eabi/
>   - add prefix: /home/moser/lib/gcc/powerpc-eabi/3.4.4/
>   - add prefix: /home/moser/lib/gcc/powerpc-eabi/
>   - add prefix: /usr/libexec/gcc/powerpc-eabi/3.4.4/
>   - add prefix: /usr/libexec/gcc/powerpc-eabi/
>   - add prefix: /usr/lib/gcc/powerpc-eabi/3.4.4/
>   - add prefix: /usr/lib/gcc/powerpc-eabi/
>   - add prefix: 
> /home/moser/lib/gcc/powerpc-eabi/3.4.4/../../../../powerpc-eab
> i/bin/powerpc-eabi/3.4.4/
>   - add prefix: 
> /home/moser/lib/gcc/powerpc-eabi/3.4.4/../../../../powerpc-eabi/bin/
> Convert string 
> '/home/moser/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:%
> SystemRoot%/system32:%SystemRoot%:%SystemRoot%/System32/Wbem:/
> cygdrive/g/Widgets:/cygdrive/c/ora817/bin:/cygdrive/c/Program 
> Files/Oracle/jre/1.1.7/bin:/cygdrive/c/Program 
> Files/Oracle/jre/1.1.8/bin:/cygdrive/c/orant/bin:/cygdrive/c/P
> ROGRA~1/IBM/CLIENT~1:/cygdrive/c/PROGRA~1/IBM/CLIENT~1/Shared:
> /cygdrive/c/PROGRA~1/IBM/CLIENT~1/Emulator:/cygdrive/c/Program
>  
> Files/Hummingbird/Connectivity/9.00/Accessories/:/cygdrive/c/M
> ATLAB704/bin/win32:.:/cygdrive/c/diab/4.4b/WIN32/bin:/cygdrive
> /c/Program Files/Microsoft Visual 
> Studio/Common/Tools/WinNT:/cygdrive/c/Program Files/Microsoft 
> Visual Studio/Common/MSDev98/Bin:/cygdrive/c/Program 
> Files/Microsoft Visual 
> Studio/Common/Tools:/cygdrive/c/Program Files/Microsoft 
> Visual Studio/VC98/bin' into prefixes, separator = ':'
>   - add prefix: /home/moser/bin/
>   - add prefix: /usr/local/bin/
>   - add prefix: /usr/bin/
>   - add prefix: /bin/
>   - add prefix: /usr/X11R6/bin/
>   - add prefix: %SystemRoot%/system32/
>   - add prefix: %SystemRoot%/
>   - add prefix: %SystemRoot%/System32/Wbem/
>   - add prefix: /cygdrive/g/Widgets/
>   - add prefix: /cygdrive/c/ora817/bin/
>   - add prefix: /cygdrive/c/Program Files/Oracle/jre/1.1.7/bin/
>   - add prefix: /cygdrive/c/Program Files/Oracle/jre/1.1.8/bin/
>   - add prefix: /cygdrive/c/orant/bin/
>   - add prefix: /cygdrive/c/PROGRA~1/IBM/CLIENT~1/
>   - add prefix: /cygdrive/c/PROGRA~1/IBM/CLIENT~1/Shared/
>   - add prefix: /cygdrive/c/PROGRA~1/IBM/CLIENT~1/Emulator/
>   - add prefix: /cygdrive/c/Program 
> Files/Hummingbird/Connectivity/9.00/Accessories/
>   - add prefix: /cygdrive/c/MATLAB704/bin/win32/
>   - add prefix: ./
>   - add prefix: /cygdrive/c/diab/4.4b/WIN32/bin/
>   - add prefix: /cygdrive/c/Program Files/Microsoft Visual 
> Studio/Common/Tools/WinNT/
>   - add prefix: /cygdrive/c/Program Files/Microsoft Visual 
> Studio/Common/MSDev98/Bin/
>   - add prefix: /cygdrive/c/Program Files/Microsoft Visual 
> Studio/Common/Tools/
>   - add prefix: /cygdrive/c/Program Files/Microsoft Visual 
> Studio/VC98/bin/
> Looking for 'real-ld'
> Looking for 'collect-ld'
> Looking for 'ld'
> Looking for 'powerpc-eabi-ld'
> Looking for 'gnm'
> Looking for 'powerpc-eabi-gnm'
> Looking for 'nm'
> Looking for 'gstrip'
> Looking for 'powerpc-eabi-gstrip'
> Looking for 'strip'
> Looking for 'powerpc-eabi-g++'
> Looking for 'powerpc-eabi-g++'
> collect2 version 3.4.4 (PowerPC Embedded)
> ld_file_name        = not found
> c_file_name         = /home/moser/bin/powerpc-eabi-g++
> nm_file_name        = 
> /home/moser/lib/gcc/powerpc-eabi/3.4.4/../../../../powerpc-eabi/bin/nm
> strip_file_name     = 
> /home/moser/lib/gcc/powerpc-eabi/3.4.4/../../../../powerpc-eab
> i/bin/strip
> c_file              = /home/moser/temp/cczlzevc.c
> o_file              = /home/moser/temp/ccYwYiQe.o
> COLLECT_GCC_OPTIONS = '-g' '-O3' '-v' '-meabi' '-msdata=eabi'
> COLLECT_GCC         = powerpc-eabi-g++
> COMPILER_PATH       = 
> /home/moser/libexec/gcc/powerpc-eabi/3.4.4/:/home/moser/libexe
> c/gcc/powerpc-eabi/3.4.4/:/home/moser/libexec/gcc/powerpc-eabi
/:/home/moser/lib/gcc/powerpc-> eabi/3.4.4/:/home/moser/lib/gcc/powerpc-eabi/:/usr/libexec/gcc
> /powerpc-eabi/3.4.4/:/usr/libexec/gcc/powerpc-eabi/:/usr/lib/g
> cc/powerpc-eabi/3.4.4/:/usr/lib/gcc/powerpc-eabi/:/home/moser/
> lib/gcc/powerpc-eabi/3.4.4/../../../../powerpc-eabi/bin/powerp
> c-eabi/3.4.4/:/home/moser/lib/gcc/powerpc-eabi/3.4.4/../../../
> ../powerpc-eabi/bin/
> LIBRARY_PATH        = 
> /home/moser/lib/gcc/powerpc-eabi/3.4.4/:/usr/lib/gcc/powerpc-e
abi/3.4.4/:/home/moser/lib/gcc/powerpc-> eabi/3.4.4/../../../../powerpc-eabi/lib/powerpc-eabi/3.4.4/:/h
> ome/moser/lib/gcc/powerpc-eabi/3.4.4/../../../../powerpc-eabi/lib/
> 
> [cannot find ld] -V -Qy -dn -Bstatic 
> -L/home/moser/lib/gcc/powerpc-eabi/3.4.4 
> -L/home/moser/lib/gcc/powerpc-eabi/3.4.4/../../../../powerpc-e
> abi/lib -v -Tlinker.ld -M --cref --sort-common -odan.elf 
> -lnosys ecrti.o danCrt0.o newlibSysCalls.o other.o Mpc561.o 
> danMain.o interruptHandlers.o exceptionHandlers.o 
> PowerPcRateMonotonicScheduler.o TaskScheduler.o main.o 
> ecrtn.o -lstdc++ -lm -lc -lgcc -lgcc 
> /home/moser/lib/gcc/powerpc-eabi/3.4.4/crtsavres.o
> collect2: cannot find `ld'
> [Leaving /home/moser/temp/cczlzevc.c]
> [Leaving /home/moser/temp/ccYwYiQe.o]
> [Leaving /home/moser/temp/ccnInnbh.ld]
> [Leaving dan.elf]
> 
> 
> 



More information about the Gcc-help mailing list