LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 05-22-2009, 04:51 AM   #1
LinuxNewman
Member
 
Registered: Apr 2009
Posts: 42

Rep: Reputation: 15
LFS- Adjusting the Toolchain problem


Hi All,
I am following LFS-version 6.4 and the host system is SuSE 11.0.
Everything was successful till installing Glibc(section 5.7).Then I entered the section 5.8 Adjusting the Toolchain.
When I did :
gcc -dumpspecs | sed 's@/lib/ld-linux.so.2@/tools&@g' \
> `dirname $(gcc -print-libgcc-file-name)`/specs

I got the following error :

sed: can't read /mnt/point1/tools/bin/../lib/gcc/i686-pc-linux-gnu/4.3.2/specs : No such file or directory.

(NOTE: my LFS partition is /dev/sda4 mounted on /mnt/point1 )

Then I decided to ignore it and went ahead with next instructions.After a while,as soon as I typed:
echo 'main(){}' > dummy.c
cc dummy.c

it showed the error:

cc: unrecognized option '-mtune=generic'

Please tell me what to do.
 
Old 05-22-2009, 05:00 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Did you copy/paste the gcc -dumpspecs | sed 's@..... or type it yourself?
The > in this one-liner is for redirection and _not_ your PS2 prompt.

I personally think it is a bad breakpoint for a one-liner, maybe you should try this instead:

gcc -dumpspecs | sed 's@/lib/ld-linux.so.2@/tools&@g' > `dirname $(gcc -print-libgcc-file-name)`/specs

If that doesn't help, what happens when you execute this: dirname $(gcc -print-libgcc-file-name) (part of the one-liner).
 
Old 05-22-2009, 05:59 AM   #3
LinuxNewman
Member
 
Registered: Apr 2009
Posts: 42

Original Poster
Rep: Reputation: 15
Thanks Druuna,
I had typed it and thought that it is a line change.So, it was wrong.Then I copied and pasted it and got error.At last I wrote what you told me to write and it worked ! A specs file was generated.

Then I proceeded to next instruction :
GCC_FIXED=`dirname $(gcc -print-libgcc-file-name)`/include-fixed &&
find ${GCC_FIXED}/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \; &&
rm -vf `grep -l "DO NOT EDIT THIS FILE" ${GCC_FIXED}/*` &&
unset GCC_FIXED

And got the following error :

grep: /mnt/point1/tools/bin/../lib/gcc/i686-pc-linux-gnu/4.3.2/include-fixed/ssl
:No such file or directory

I went to that directory and saw that there is broken file called ssl.

Now can you please tell me what went wrong?I tried to type it and copy-paste it.Both cases had same error.
Thanks.
 
Old 05-22-2009, 08:32 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

In your first post you mention executing the echo 'main(){}' > dummy.c and cc dummy.c parts. Did you execute the GCC_FIXED=`dirname $(gcc ...... unset GCC_FIXED part as well? If so, you already removed (that's what the GCC_FIXED part does, it removes certain dirs and files) certain parts.

I'm not sure what dirs and files should be removed, but if I take a look at /x/y/tools/bin/../lib/gcc/i686-pc-linux-gnu/4.3.2/include-fixed/ there are only 3 files present: README limits.h and syslimits.h. But that is on a box that has a fully functional LFS 6.4.

Maybe you should start over with chapter 5, just to make sure.

BTW: You did check to see if Suse 11.0 is suitable as host?? (http://www.linuxfromscratch.org/lfs/.../hostreqs.html)
 
Old 05-25-2009, 01:15 AM   #5
LinuxNewman
Member
 
Registered: Apr 2009
Posts: 42

Original Poster
Rep: Reputation: 15
Yes, I had executed the "GCC_FIXED=`dirname $(gcc ...... unset GCC_FIXED" part as well. You are right.It might have removed something. Now I am going to start again from chapter 5.
 
Old 05-26-2009, 03:03 AM   #6
LinuxNewman
Member
 
Registered: Apr 2009
Posts: 42

Original Poster
Rep: Reputation: 15
Hi All,
I started again and this time I took all the care and went ahead for a loner distance than before.Till section 5.13, there was no problem and everything went without showing errors.Even sanity checks worked this time.
The problem started when I reached section 5.14 Ncurses-5.6 . When I copied and pasted the following command :

./configure --prefix=/tools --with-shared \
--without-debug --without-ada --enable-overwrite

I got the following error :

(these are last few lines, I can provide more if you want)

checking if you want to build a separate terminfo library... no
checking if you want to link with the GPM mouse library... maybe
checking for gpm.h... yes
checking for Gpm_Open in _lgpm... no
configure: error: cannot link with GPM library

What went wrong here? How to solve it?
NOTE: I had deleted all the older build directories.
 
Old 05-26-2009, 03:17 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

These errors (both toolchain and ncurses) shouldn't happen. I've installed LFS 6.4 more then once and neven encountered these before.

One thing that I can come up with that could cause all of these problems (and a question you haven't answered yet): Is Suse 11.0 suitable as a base for LFS?

I always use the LFS liveCD as base, maybe you should too. This liveCD was created to be a suitable host.
 
Old 05-27-2009, 11:18 PM   #8
LinuxNewman
Member
 
Registered: Apr 2009
Posts: 42

Original Poster
Rep: Reputation: 15
I checked that SuSE 11.0 is good for being a host by running the instructions given in "Host system requirements".

Do you have any other clue about what went wrong?
 
Old 05-28-2009, 03:32 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

I do see something in post #6 that shouldn't be there: gpm entries (to be more precise: the linking of gpm).

At this stage gpm should not be available at all and it should skip it with no instead of maybe (checking if you want to link with the GPM mouse library... maybe).

What does the following show you (as lfs user):

echo | gcc -v -x c - 2>&1 | sed -n '/^#include/,/End of search list/p'

The output should be something like:
/home/build/tools/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/include
/tools/include


and

gcc -dumpspecs | grep "ld-linux.so.2"

The output should be:
/tools/lib/ld-linux.so.2

If either of them come up with different/more output, then probably something went wring with gcc pass 2 and/or adjusting the toolchain.

Last edited by druuna; 05-28-2009 at 02:55 PM.
 
Old 06-02-2009, 02:44 AM   #10
LinuxNewman
Member
 
Registered: Apr 2009
Posts: 42

Original Poster
Rep: Reputation: 15
I had run the instructions mentioned by you and got totally different outputs. So, I decided to start the second pass of gcc again. This time I got no problems.I did chapter 5 successfully and I am doing now the sixth one.
If I find any problem,I will post it here again.Thank you for the help :-)
 
Old 06-02-2009, 03:17 AM   #11
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Glad to read that things are ok now!
 
Old 06-04-2009, 04:55 AM   #12
LinuxNewman
Member
 
Registered: Apr 2009
Posts: 42

Original Poster
Rep: Reputation: 15
Hi !
Now I am in chapter 8.3.1. Installation of the kernel
Here it is told to run the following command :
make LANG=<host_LANG_value> LC_ALL= menuconfig

It also tells to : "Be sure to replace <host_ LANG_ value> by the value of the $LANG variable from your host. If not set, you
could use instead the host's value of $LC_ ALL or $LC_ CTYPE."

I tried to do echo for $LANG,$LC_ALL and $LC_CTYPE.But,nothing was displayed.So, what should I replace "<host_ LANG_ value>" with? I am stuck with this instruction :-(
 
Old 06-04-2009, 05:06 AM   #13
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

I do not use the LANG settings at all during the kernel setup step. It is there to enable proper line drawings for the ncurses program (the menu itself).

The steps I take/took are these:

1) unpack kernel source and enter directory
2) make mrproper
3) make menuconfig
4) make
5) make modules_install
6) 'rest' of LFS chapter 8.3

If you have an 'old' working .config stored somewhere that you want to use, do the following between steps 2 and 3
a) copy the old .config file to the linux source directory
b) make oldconfig (just use the defaults given if you are not clear about certain options)
continue with step 3 from this point on.

Hope this clears things up a bit.
 
Old 06-04-2009, 05:24 AM   #14
LinuxNewman
Member
 
Registered: Apr 2009
Posts: 42

Original Poster
Rep: Reputation: 15
If we do "make modules_install", will there be need of initrd image? In LFS chapters, nothing is mentioned about initrd. How will it boot if it has modules but no initrd ?
 
Old 06-04-2009, 05:37 AM   #15
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

No initrd is needed.

There is an old lfs-hint file (initrd for LFS) you can look at if you do want/need initrd. Never tried it myself, I never needed initrd.
 
  


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 LFS.6.3 need help foi Linux From Scratch 3 07-05-2008 08:30 PM
Adjusting the Toolchain in lfs 6.3 saritha Linux From Scratch 3 02-15-2008 02:31 AM
5.7 Adjusting the Toolchain Problem g3neration Linux From Scratch 2 09-08-2007 11:41 AM
Adjusting toolchain problem (in temport system) ChrisScott Linux From Scratch 6 01-21-2007 10:26 AM
LFS 6 ch5.9 adjusting the toolchain failed sanity check totty79 Linux From Scratch 1 03-21-2005 03:58 PM


All times are GMT -5. The time now is 07:16 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration