[lfs-support] Issues with compiling GCC-4.8.1 (LFS 7.4)

Chris Staub chris at beaker67.com
Sat Nov 2 09:52:33 PDT 2013

On 11/02/2013 08:14 AM, Bernard Hurley wrote:
> Hi there!
> I have been trying to compile GCC-4.8.1 in section 5.5 of LFS 7.4.  The
> first problem was that the compiler didn't seem to understand (a
> parameter to configure on p.37):
>    --disable-libstdc++-v3
> In case anyone else has the problem, I found after running "configure
> --help" that the solution seems to be to replace it with:
>    --disable-libstdcxx

--disable-libstdc++-v3 works just fine, so you must have mistyped something.
> The second problem is a bit more intractible.  Having made the apbove
> adjustment to "configure", when I run "make" it bombs out with:
> ================ snip ===============
> configure: creating ./config.status
> config.status: creating Makefile
> config.status: creating auto-target.h
> config.status: linking ../.././libgcc/enable-execute-stack-empty.c to enable-execute-stack.c
> config.status: linking ../.././libgcc/unwind-generic.h to unwind.h
> config.status: linking ../.././libgcc/config/i386/linux-unwind.h to md-unwind-support.h
> config.status: linking ../.././libgcc/config/i386/sfp-machine.h to sfp-machine.h
> config.status: linking ../.././libgcc/gthr-single.h to gthr-default.h
> config.status: executing default commands
> make[2]: Entering directory `/mnt/lfs/gcc-build/gcc-4.8.1/x86_64-lfs_7_4-linux-gnu/libgcc'
> Makefile:162: ../.././gcc/libgcc.mvars: No such file or directory
> make[2]: *** No rule to make target `../.././gcc/libgcc.mvars'.  Stop.
> make[2]: Leaving directory `/mnt/lfs/gcc-build/gcc-4.8.1/x86_64-lfs_7_4-linux-gnu/libgcc'
> make[1]: *** [all-target-libgcc] Error 2
> make[1]: Leaving directory `/mnt/lfs/gcc-build/gcc-4.8.1'
> make: *** [all] Error 2
> ================ snip ===============

One problem I'm seeing in this output is that you are running this from 
$LFS/gcc-build, and have apparently unpacked GCC's source inside that 
dir, which is not what you're supposed to be doing. Go back and read 
page 5.3 very carefully.

> I have the following environment variables set:
> LFS=/mnt/lfs
> LFS_TGT=x86_64-lfs_7_4-linux-gnu
> PATH=/tools/bin:/bin:/usr/bin

Apparently you've modified $LFS_TGT from what the book says to use. 
Granted, this particular change should not be a problem, but it does 
indicate that you've deviated from the book's instructions. In what 
other ways have you done things differently from the book?

>There appears to be somthing wrong with the "sed" command on page 37:

 >   sed -i '/k prot/agcc_cv_libc_provides_ssp=yes' gcc/configure

 >as the output from 'grep "k prot" gcc/configure' (before running "sed")

 >  # Test for stack protector support in target C library.
 >        # all versions of Bionic support stack protector

There is nothing wrong with that sed command - you are just 
misunderstanding what it actually does. Try changing the "-i" to 
"-i.bak" and then doing a "diff -au gcc/configure{.bak,}" to see the 

> Another thing that seems strange is the configure option (again on page
> 37):
>    --with-mpfr-lib=$(pwd)/mpfr/src/.libs
> There is no file "mpfr/src/.libs", in fact there is nothing called
> ".libs" in the whole of mpfr's source tree.

Are you saying that you are getting an error of some kind about this? 
That directory should be created during compile, so it shouldn't matter 
that it doesn't exist when you unpack the source.

> If you've read so far you are truly one of my heros!  I hope to be able
> to contribute to the community myself once I have built LFS.
> Kind regards,
> Bernard.

More information about the lfs-support mailing list