LinuxQuestions.org
Help answer threads with 0 replies.
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 10-15-2010, 04:52 PM   #1
Bertical
Member
 
Registered: Oct 2008
Location: Kingdom of Mercia
Distribution: Slackware
Posts: 83

Rep: Reputation: 14
gcc not reading specs file LFS Section 6.7.1


hi LFS gurus,

LFS 6.7 Q for ya

I got to section 6.7.1 to install the linux headers and was hit with the message "gcc : No such file or directory" when I ran
Code:
make mrproper
So I started again, deleted everything. I eventually got back to section 5.10 and installed gcc pass 2 and had a closer look.

I created a dummy c file
Code:
echo 'main(){}' > d.c
for testing.

If I run
Code:
/mnt/lfs/tools/bin/gcc -v d.c
the first line is "Using built in specs"

If I run
Code:
/mnt/lfs/tools/bin/i686-lfs-linux-gnu-gcc -v d.c
the first line is "Reading specs from /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux/gnu/4.5.1/specs"

Now the "specs" file is modified by the sed string in section 5.8 "Adjusting the Toolchain" and everything should be cosy.

But ....

When installing the linux headers in the chrooted environment ( section 6.7.1 ) "make" calls gcc which is using its own built in specs and not even reading the sed modified "specs" file. This means the install fails as /lib/ld/linux.so.2 doesn't exist yet.

If I run
Code:
ldd /mnt/lfs/tools/bin/gcc
I get a last line that reads "/lib/ld-linux.so.2" . It should have a /tools prefix. So the internal specs aren't being overridden by the specs file as gcc doesn't even bother to read it !

I've seen a hack that creates a soft link from /tools/lib/ld.linux.so.2 -> chroot/lib but other folks have built it OK without this.

Now I'm confused !

OK I'll try again tomorrow. Grrr !
 
Old 10-16-2010, 05:50 AM   #2
Bertical
Member
 
Registered: Oct 2008
Location: Kingdom of Mercia
Distribution: Slackware
Posts: 83

Original Poster
Rep: Reputation: 14
In section 5.10.1 GCC pass 2 I missed a backslash at the end of the line below :

Code:
CC="$LFS_TGT-gcc -B/tools/lib/" <------------ !!!
    AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib \
so I guess the variables were not passed to the configure script. Doh !
 
  


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
adjusting tool chain section 5.8 i686-lfs-linux-gnu-gcc: command not found rlaybourn Linux From Scratch 7 10-14-2010 08:23 AM
GCC command not found LFS book 6.3, section 6.7.1 cdc5205 Linux From Scratch 1 08-16-2008 01:56 PM
error using lfs while compiling lfs book's 6.12 (gcc-4.1.2) section aditya_gpch Linux From Scratch 3 04-24-2008 04:23 PM
gcc 4: no specs file rconan Linux From Scratch 6 07-11-2005 12:21 PM
I ersased my GCC specs file shanenin Linux From Scratch 2 01-30-2004 10:36 AM

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

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