gcc not working after chroot - LinuxQuestions.org
LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux > 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
 
Thread Tools
Old 07-10-2008, 11:54 AM   #1
pillairajeevr
LQ Newbie
 
Registered: Jul 2008
Posts: 1
gcc not working after chroot


[Log in to get rid of this advertisement]
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.
pillairajeevr is offline     Reply With Quote
Old 07-11-2008, 09:21 PM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,499
If gcc is available in the chroot, then

gcc -v

should give you some output.
Mr. C. is offline     Reply With Quote
Old 07-20-2008, 11:00 AM   #3
trurl23
LQ Newbie
 
Registered: Jun 2008
Posts: 5
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
trurl23 is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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


All times are GMT -5. The time now is 10:41 AM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Open Source Consulting | Domain Registration