[lfs-support] GCC build first pass: mpc build looks for libgmp.la in the wrong place

Hazel Russman hazeldebian at googlemail.com
Fri Oct 25 09:59:36 PDT 2013


On Tue, 22 Oct 2013 10:16:53 -0500
Bruce Dubbs <bruce.dubbs at gmail.com> wrote:

> Hazel Russman wrote:
> > I am trying to build a 64-bit lfs-7.4 system using a host system
> > based on Slackware-14. Currently I am having a problem with the
> > first pass of building gcc.  During the internal build of libmpc, a
> > search is made for /usr/lib64/libgmp.la. It is not found, so the
> > build crashes.
 
> The proper way is to start over, double checking section 4.4.
> 
>    -- Bruce
> 
So I did that. First I removed the lfs user's .bash_profile and .bashrc
and redid them. Here is the output of printenv directly after logging
in: 
TERM=linux
LC_ALL=POSIX
LFS=/mnt/lfs
PATH=/tools/bin:/bin:/usr/bin
PWD=/home/lfs
LFS_TGT=x86_64-lfs-linux-gnu
PS1=\u:\w$ 
SHLVL=1
HOME=/home/lfs

It seems to show all the environmental variables that ought to be
there and none that ought not.

I deleted everything in $LFS/tools and then unpacked and rebuilt
binutils. I deleted gcc-4.8.1 and gcc-build, unpacked the gcc
tarball, and proceeded exactly as in the book (exactly as I had done
the previous time!). And the mpc build crashed at the same point with
the same message. 

Here is the gcc configuration as stored in gcc-build/Makefile:
# The gcc driver likes to know the arguments it was configured with.
TOPLEVEL_CONFIGURE_ARGUMENTS=../gcc-4.8.1/configure
--target=x86_64-lfs-linux-gnu --prefix=/tools --with-sysroot=/mnt/lfs
--with-newlib --without-headers --with-local-prefix=/tools
--with-native-system-header-dir=/tools/include --disable-nls
--disable-shared --disable-multilib --disable-decimal-float
--disable-threads --disable-libatomic --disable-libgomp
--disable-libitm --disable-libmudflap --disable-libquadmath
--disable-libsanitizer --disable-libssp --disable-libstdc++-v3
--enable-languages=c,c++
--with-mpfr-include=/mnt/lfs/sources/gcc-build/../gcc-4.8.1/mpfr/src
--with-mpfr-lib=/mnt/lfs/sources/gcc-build/mpfr/src/.libs

As far as I can see, it matches the book exactly.

And here, from further down in the same Makefile, is the information on
how to find GMP:

# Where to find GMP
HOST_GMPLIBS = -L$$r/$(HOST_SUBDIR)/gmp/.libs
-L/mnt/lfs/sources/gcc-build/mpfr/src/.libs
-L$$r/$(HOST_SUBDIR)/mpc/src/.libs -lmpc -lmpfr -lgmp HOST_GMPINC =
-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp
-I/mnt/lfs/sources/gcc-build/../gcc-4.8.1/mpfr/src -I$$s/mpc/src 

This is entirely sane, and if mpc looked for it there, there would be
no problem. But it insists on looking in /usr/lib64.

I have grepped around for any code that would explain this and found
the following in gcc-build/mpc/src/libmpc.la: 
dependency_libs=' /usr/lib64/libmpfr.la /usr/lib64/libgmp.la /mnt/lfs/sources/gcc-build/./gmp/.libs/libgmp.la
-lm'
It is the only thing I have found so far that looks remotely relevant.

By now I am less concerned with actually building gcc than with
finding out what is going on! 



More information about the lfs-support mailing list