-   Linux From Scratch (
-   -   5.9. Adjusting the Toolchain - Error (

Spudds 01-25-2005 11:10 AM

5.9. Adjusting the Toolchain - Error
Hi folks,

My first problem encountered during the LFS installation. This is my first time through. I'm sure this is a linker/gcc path error of some kind but I can't seem to figure it out.

I run the following commands to test the toolchain:

echo 'main(){}' > dummy.c
cc dummy.c
readelf -l a.out | grep ': /tools'

The output I get is the following:

lfs:~$ cc dummy.c
/mnt/lfs/tools/bin/../lib/gcc/i686-pc-linux-gnu/3.4.1/../../../../i686-pc-linux-gnu/bin/ld: no input files
collect2: ld returned 1 exit status

lfs:~$ cc ./dummy.c
/mnt/lfs/tools/bin/../lib/gcc/i686-pc-linux-gnu/3.4.1/../../../../i686-pc-linux-gnu/bin/ld: no input files
collect2: ld returned 1 exit status

Can anyone offer advice? BTW, I don't recall having any errors when I ran make install on the glibc package..


320mb 01-25-2005 12:15 PM


echo 'main(){}' > dummy.c
gcc dummy.c
readelf -l a.out | grep ': /tools'

you are using should be gcc

Spudds 01-25-2005 12:54 PM

cc is a symlink as per the instructions in section: "5.5. GCC-3.4.1 - Pass 1", last step:

As a finishing touch, create a symlink. Many programs and scripts run cc instead of gcc, which is used to keep programs generic and therefore usable on all kinds of UNIX systems where the GNU C compiler is not always installed. Running cc leaves the system administrator free to decide which C compiler to install.

ln -s gcc /tools/bin/cc

I had tried it with both gcc and cc. Gcc seems to be able to create the object file correctly if I use gcc -c. It seems as if it's a problem with ld, which shouldn't come as a surprise.

Thanks all for the help,

__J 01-25-2005 05:10 PM

don't you have an ld in /tools/bin?

Spudds 01-26-2005 10:37 AM

I've now re-built everything from "5.4. Binutils- - Pass 1" and the same problem occurs.

The step that actually seems to cause the problem is the first step under " 5.9. Adjusting the Toolchain", namely:

make -C ld install (from binutils-build).

This step places a new ld into /tools/bin

which gcc:

which ld:

I tried the following:

gcc dummy.c, where PATH=/tools/bin:/bin:/usr/bin

Error (same as before):
/mnt/lfs/tools/bin/../lib/gcc/i686-pc-linux-gnu/3.4.1/../../../../i686-pc-linux-gnu/bin/ld: no input files
collect2: ld returned 1 exit status

gcc dummy.c where PATH=/bin:/usr/bin

This worked and produced the correct readelf output.

So, from this, it would seem that my gcc/ld binaries are somehow f'ed up. I have never received any build errors either of the two times I've built and installled binutils or gcc. What am I doing wrong here?

Thanks all for the help,

darkRoom 02-22-2005 06:52 PM

You didn't print the output from echo $PATH, the first gcc on your path wil be called and that is the gcc which won't have an edited spec file. Are you automating the process in some way and did you source ~/.bash_profile ?

hope that helps . .

tagigogo 02-23-2005 10:22 AM

hi, Spudds:
did you inspect the 'spec' file to ensure all the changes are okay?
i might have the same problem before (not sure if it's the same...), but it's just because i passed the wrong 'LIB_PATH' when I built 'ld'...

All times are GMT -5. The time now is 10:21 PM.