LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-10-2008, 10:54 AM   #1
pillairajeevr
LQ Newbie
 
Registered: Jul 2008
Posts: 1

Rep: Reputation: 0
gcc not working after chroot


Hi

I have finished the initial temporary system.
All the packages are installed .
I ran the "chroot" command,mounted the virtual file system,created the directories etc,all went fine.

When I start installing the packages,I get a error saying gcc not found.
But on checking in /tool/bin , gcc is found there and the permissions are all correct.
when I tried executing gcc from /tool/bin ,it says file not found,however other files present in the directory are executed.
 
Old 07-11-2008, 08:21 PM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
If gcc is available in the chroot, then

gcc -v

should give you some output.
 
Old 07-20-2008, 10:00 AM   #3
trurl23
LQ Newbie
 
Registered: Jun 2008
Posts: 5

Rep: Reputation: 0
I had similar issues with other programs after entering chroot. This usually happens when programs are linked against the wrong libraries. Be sure that your initial toolchain got linked against libraries in /tools.

Check using readelf -l /tools/bin/gcc which program interpreter is requested by your preliminary gcc. Make sure it is /tools/lib/ld-linux.so.2 and not /lib/ld-linux.so.2 as this will not exist anymore after entering chroot!
You can also find out about the libraries your dynamic loader finds using ldd -v /tools/bin/gcc, all paths should be prefixed with /tools at this point.

Be cautious about the toolchain adjustments (copying ld-new to ld) and make sure to follow the instructions from the book exactly and in the exact order. I would also suggest re-reading "Toolchain Technical Notes" in chapter 5...

~ trurl
 
  


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 inside of a chroot jail iidroneii Linux - General 1 12-20-2007 03:12 PM
GCC in chroot failing to build, unable to find headers falt004 Linux From Scratch 4 08-03-2007 10:00 AM
mount command not working in chroot. and now chroot not working mohit.jain Linux From Scratch 5 07-14-2006 03:57 AM
GCC 4.0.2 Chroot Build Unable to Find Headers Kenji Miyamoto Linux From Scratch 5 06-29-2006 03:34 AM
intaling GCC-3.3.3. in chroot env FAILS tests xtrem Linux From Scratch 1 02-18-2005 12:24 PM

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

All times are GMT -5. The time now is 01:21 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