LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   LFS- Adjusting the Toolchain problem (https://www.linuxquestions.org/questions/linux-from-scratch-13/lfs-adjusting-the-toolchain-problem-727738/)

LinuxNewman 05-22-2009 03:51 AM

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.

druuna 05-22-2009 04:00 AM

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).

LinuxNewman 05-22-2009 04:59 AM

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.

druuna 05-22-2009 07:32 AM

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)

LinuxNewman 05-25-2009 12:15 AM

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.

LinuxNewman 05-26-2009 02:03 AM

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.

druuna 05-26-2009 02:17 AM

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.

LinuxNewman 05-27-2009 10:18 PM

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?

druuna 05-28-2009 02:32 AM

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.

LinuxNewman 06-02-2009 01:44 AM

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 :-)

druuna 06-02-2009 02:17 AM

Hi,

Glad to read that things are ok now!

LinuxNewman 06-04-2009 03:55 AM

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 :-(

druuna 06-04-2009 04:06 AM

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.

LinuxNewman 06-04-2009 04:24 AM

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 ?

druuna 06-04-2009 04:37 AM

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.


All times are GMT -5. The time now is 05:21 AM.