Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-25-2005, 10:10 AM
|
#1
|
LQ Newbie
Registered: Jan 2005
Posts: 3
Rep:
|
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
|
|
|
01-25-2005, 11:15 AM
|
#2
|
Senior Member
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577
Rep:
|
Code:
echo 'main(){}' > dummy.c
gcc dummy.c
readelf -l a.out | grep ': /tools'
you are using cc.........it should be gcc
|
|
|
01-25-2005, 11:54 AM
|
#3
|
LQ Newbie
Registered: Jan 2005
Posts: 3
Original Poster
Rep:
|
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
|
|
|
01-25-2005, 04:10 PM
|
#4
|
Senior Member
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973
Rep:
|
don't you have an ld in /tools/bin?
|
|
|
01-26-2005, 09:37 AM
|
#5
|
LQ Newbie
Registered: Jan 2005
Posts: 3
Original Poster
Rep:
|
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
|
|
|
02-22-2005, 05:52 PM
|
#6
|
Member
Registered: Mar 2004
Location: Valencia, espaņa
Distribution: Slack, Gentoo, Custom
Posts: 162
Rep:
|
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 . .
|
|
|
02-23-2005, 09:22 AM
|
#7
|
LQ Newbie
Registered: Sep 2004
Posts: 21
Rep:
|
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 07:47 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|