cannot amend the GCC specs with SED script in '5.8. Adjusting the Toolchain'

Roel Kluin rjckluin at
Wed Jun 29 16:27:57 PDT 2005

I was following the instructions in the book (first time) when i got to
chapter 5.8. Adjusting the Toolchain. As instructed I tried to run the sed

SPECFILE=`gcc --print-file specs` &&
sed 's@ /lib/ /tools/lib/ at g' \
    $SPECFILE > tempspecfile &&
mv -f tempspecfile $SPECFILE &&

But pasting this in the console I got this error:

lfs:/mnt/lfs/sources/gcc-build/gcc$ SPECFILE=`gcc --print-file specs` &&
>sed 's@ /lib/ /tools/lib/ at g' \
>     $SPECFILE > tempspecfile &&
>mv -f tempspecfile $SPECFILE &&
mv: inter-device move failed: `tempspecfile' to
`/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/specs'; unable to remove
target: Permission denied

As you can see I am building from a slackware distribution. my architechture
is actually i686 (athlon-xp). On my platform the dynamic linker is
if I "vi /mnt/lfs/sources/gcc-build/gcc/specs" I can't find any occurences
of '/lib/' to be replaced.
The `/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/specs' file mentioned
should not be removed I guess. Any idea what the problem is?

lfs:/mnt/lfs/sources$ cat /proc/version
Linux version 2.6.12 (root at zoinx) (gcc version 3.3.4) #3 Tue Jun 28 23:34:22
CEST 2005
lfs:/mnt/lfs/sources$ ld --verbose | grep SEARCH
SEARCH_DIR("/tools/i686-pc-linux-gnu/lib"); SEARCH_DIR("/tools/lib");


More information about the lfs-support mailing list