LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
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


Reply
  Search this Thread
Old 01-25-2005, 10:10 AM   #1
Spudds
LQ Newbie
 
Registered: Jan 2005
Posts: 3

Rep: Reputation: 0
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
 
Old 01-25-2005, 11:15 AM   #2
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
Code:
echo 'main(){}' > dummy.c
gcc dummy.c
readelf -l a.out | grep ': /tools'
you are using cc.........it should be gcc
 
Old 01-25-2005, 11:54 AM   #3
Spudds
LQ Newbie
 
Registered: Jan 2005
Posts: 3

Original Poster
Rep: Reputation: 0
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
 
Old 01-25-2005, 04:10 PM   #4
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
don't you have an ld in /tools/bin?
 
Old 01-26-2005, 09:37 AM   #5
Spudds
LQ Newbie
 
Registered: Jan 2005
Posts: 3

Original Poster
Rep: Reputation: 0
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
 
Old 02-22-2005, 05:52 PM   #6
darkRoom
Member
 
Registered: Mar 2004
Location: Valencia, espaņa
Distribution: Slack, Gentoo, Custom
Posts: 162

Rep: Reputation: 30
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 . .
 
Old 02-23-2005, 09:22 AM   #7
tagigogo
LQ Newbie
 
Registered: Sep 2004
Posts: 21

Rep: Reputation: 15
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'...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
5.7. Adjusting the Toolchain - sanity issue... yanger Linux From Scratch 2 11-12-2008 04:52 AM
Possible Error in Book -- Adjusting Toolchain suma17 Linux From Scratch 9 10-13-2005 04:06 AM
Held on 5.9. Adjusting the Toolchain satimis Linux From Scratch 2 06-30-2005 06:36 AM
LFS 6 ch5.9 adjusting the toolchain failed sanity check totty79 Linux From Scratch 1 03-21-2005 02:58 PM
6.12. Re-adjusting the Toolchain jobesd Linux From Scratch 2 01-16-2005 01:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 07:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration