5.7 Adjusting the Toolchain

Herman Gerritsen lfsmailing at gmail.com
Sun Nov 30 03:57:56 PST 2008

Hi there,

I see something wierd in the follwing line from the lfs-6.3 book (it
is in chapter 5.7):
Though I did not check it seems to be the same in the new lfs-6.4 book.

GCC_INCLUDEDIR=`dirname $(gcc -print-libgcc-file-name)`/include &&
find ${GCC_INCLUDEDIR}/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \; &&
rm -vf `grep -l "DO NOT EDIT THIS FILE" ${GCC_INCLUDEDIR}/*` &&

this command: "GCC_INCLUDEDIR=`dirname $(gcc
-print-libgcc-file-name)`/include &&"
seems to point to a directory on the host system.
On my system it becomes: "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include"
next this line: "rm -vf `grep -l "DO NOT EDIT THIS FILE"
tries to delete files from my host system.
This is natural because my systems PATH varaible contains:
thus it uses the hosts gcc.
I believe it should use the new installed gcc from chapter 5.4.
And therefore the GCC_INCLUDEDIR should be:

Though I am not sure :)

I found this problem in the following way:
I have installed an lfs-6.3 system (that did not seem to have any problems)
using the package uyser system.
For this system I used a differnt kernel ( instead of

Next I wanted to install a new lfs-6.3 system (using the previous one
as the host)
but now with the regular kernel as described in the lfs-6.3 book.
Again with the package user system.

when the "rm -vf `grep -l "DO NOT EDIT THIS FILE" ${GCC_INCLUDEDIR}/*` &&" line
was enterd it gave me a permission error on:
Which is good, since these are files from my host system that cannot be deleted
by the lfs user.

I think I did something wrong an hopefully someone can point me somewhere.
Thanks already,
Herman Gerritsen

More information about the lfs-support mailing list