LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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-07-2009, 12:44 PM   #1
dscener
LQ Newbie
 
Registered: Dec 2005
Posts: 7

Rep: Reputation: 0
Question gcc: No such file or directory [Chapter 6]


Made it all the way to chapter 6, using 6.4 documentation and the 6.3 LIVE CD. However, every time I go I try to compile the Linux Headers I get an error:

bash: /tools/bin/gcc: No such file or directory

I think I've trackd it down to a problem in my toolchain. Running readelf -l /tools/bin/gcc shows that my program interpreter is /lib/ld-linux.so.2 instead of /tools/lib/ld-linux.so.2

What I don't understand, is why! Before I chroot, back in chapter 5, my program interpreter showed up correctly:

http://www.linuxfromscratch.org/lfs/...adjusting.html

Anyone know where I'm messing up the toolchain? How can I fix it now?
 
Old 01-07-2009, 01:54 PM   #2
rm_dash_rf_star
Member
 
Registered: Nov 2007
Location: Seattle, WA
Distribution: LFS
Posts: 36

Rep: Reputation: 16
This line:

bash: /tools/bin/gcc: No such file or directory

Suggests to me that your first problem is that bash can not find gcc.

*****

In your `chrooted' environment, look at your path:

$ echo $PATH

If /tools/bin is not in your path, then you need to add it. This should have been added when you first entered the chrooted environment.

Also---You said that the program interpreter: ld-linux.so.2 was correct when you did your first:

echo 'main(){}' >dummy.c ; gcc dummy.c ; et cetera...

Test.

If this is in fact correct, then I think that your problem is again PATH related. Make sure that PATH is set correctly, and also make sure that / is mounted on the correct device node.

---Daniel T. Nevistic
 
Old 01-08-2009, 08:45 PM   #3
dscener
LQ Newbie
 
Registered: Dec 2005
Posts: 7

Original Poster
Rep: Reputation: 0
My path turned out to be OK, but the interpreter in $LFS/tools/bin/gcc didn't have the right path. Which caused it to work, until I chrooted and $LFS/tools became my /tools directory. I tried several times to recomile GCC and 'adjust the toolchain', but I finally just ended up creating a symbolic link to where it thought it was.

ln -s /tools/bin/gcc /bin/gcc

I'm sure it'll cause trouble down the road
 
Old 02-18-2014, 06:21 PM   #4
gsh91
LQ Newbie
 
Registered: Feb 2014
Posts: 1

Rep: Reputation: Disabled
Solution

Hi,

i have resolve the same problem with:

export CC=$LFS_TGT-gcc
export CXX=$LFS_TGT-g++
export AR=$LFS_TGT-ar
export RANLIB=$LFS_TGT-ranlib

before configuring gcc pass 2
 
Old 02-05-2015, 06:14 AM   #5
mijo
LQ Newbie
 
Registered: Jan 2012
Posts: 1

Rep: Reputation: Disabled
Thumbs up

Thanks,that solved my problem, and is still valid for SVN-20150131.
I guess this should be added to the book.
 
  


Reply



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
gcc will not execute, responds with 'no such file or directory' and 'no input file' nckeecho Ubuntu 9 07-24-2016 01:04 PM
LFS 6.3, messed up somewhere prior to chapter 6.12 (gcc), how to restart chapter 6? Funkster Linux From Scratch 2 12-24-2008 06:30 AM
gcc: ./remote-@REMOTE@.c: No such file or directory gcc: no input files pracslipkerm Linux - Newbie 3 06-15-2005 06:09 AM
gcc: No such file or directory babysealclubber Linux From Scratch 5 01-31-2004 08:43 AM
gcc: No such file or directory babysealclubber Linux - Software 2 01-22-2004 03:03 PM

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

All times are GMT -5. The time now is 01:40 AM.

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