LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   5.9. Adjusting the Toolchain - Error (http://www.linuxquestions.org/questions/linux-from-scratch-13/5-9-adjusting-the-toolchain-error-282035/)

Spudds 01-25-2005 10: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..

Thanks,
Spudds

320mb 01-25-2005 11:15 AM

Code:

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

you are using cc.........it should be gcc

Spudds 01-25-2005 11:54 AM

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,
Spudds

__J 01-25-2005 04:10 PM

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

Spudds 01-26-2005 09:37 AM

I've now re-built everything from "5.4. Binutils-2.15.91.0.2 - 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:
/tools/bin

which ld:
/tools/bin

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,
Spudds

darkRoom 02-22-2005 05:52 PM

Hi
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 09: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 06:57 AM.