[lfs-dev] gcc pass 1/2 instructions re mpfr/gmp/mpc.

Pierre Labastie pierre.labastie at neuf.fr
Sat Mar 1 08:17:26 PST 2014

Le 27/02/2014 21:49, Pierre Labastie a écrit :
> Oops, sorry for bad wording. Of course, you can install gcc without the other
> libraries, but the compiler cannot compile anything: the compilation stage
> (cc1) cannot run without all three libraries. Hum, cc1 is installed in
> /usr/libexec/i486-slackware-linux/4.7.1, so I realize that I have installed a
> 32 bit version of Slackware [beginner error, I looove learning :-( ]. Anyway,
> I am almost sure that the lib{gmp,mpfr,mpc} dependency is the same on x86_64.
> Though there may be some added complexity due to the lib{,64} "duality"...
> With what I have installed up to now (I wanted to reproduce Hazel Russman's
> results, so I have installed a small part of the distro. Needs to be
> completed...):
> ------------------------
> bash-4.2# ldd /usr/libexec/gcc/i486-slackware-linux/4.7.1/cc1
> 	linux-gate.so.1 (0xf776d000)
> 	libmpc.so.2 => not found
> 	libmpfr.so.4 => not found
> 	libgmp.so.10 => /usr/lib/libgmp.so.10 (0xf7703000)
> 	libdl.so.2 => /lib/libdl.so.2 (0xf76fe000)
> 	libz.so.1 => /lib/libz.so.1 (0xf76e7000)
> 	libm.so.6 => /lib/libm.so.6 (0xf76bb000)
> 	libc.so.6 => /lib/libc.so.6 (0xf7536000)
> 	/lib/ld-linux.so.2 (0xf776e000)
> -------------------------
> So something must be wrong when Hazel Russman said she had not installed gmp.
> She surely could run gcc. Maybe there is a fallback when gmp is not there? I
> have now to get a 64 bit Slackware and start testing...
> @akh, thanks for the indications on how to use Slackware. It'll save much time.


So, I eventually managed to install slackware (only packages for passing the
host reqs, running jhalfs, and running the slackware package management
system. The key point (I think) is that I haven't installed the package
"gmp-5.0.5-x86_64-1", and that it does not prevent gcc to run, simply because
libgmp.so.10.0.5 is also included in elflibs (actually, it is in one of Hazel
Russmann's posts).

And I get exactly the same error:

/bin/sh ../libtool --tag=CC   --mode=link gcc  -g -O2  -version-info 3:0:0
-static-libstdc++ -static-libgcc  -o libmpc.la -rpath /tools/lib abs.lo
acos.lo acosh.lo add.lo add_fr.lo add_si.lo add_ui.lo arg.lo asin.lo asinh.lo
atan.lo atanh.lo clear.lo cmp.lo cmp_si_si.lo conj.lo cos.lo cosh.lo
div_2si.lo div_2ui.lo div.lo div_fr.lo div_ui.lo exp.lo fma.lo fr_div.lo
fr_sub.lo get_prec2.lo get_prec.lo get_version.lo get_x.lo imag.lo init2.lo
init3.lo inp_str.lo log.lo log10.lo mem.lo mul_2si.lo mul_2ui.lo mul.lo
mul_fr.lo mul_i.lo mul_si.lo mul_ui.lo neg.lo norm.lo out_str.lo pow.lo
pow_fr.lo pow_ld.lo pow_d.lo pow_si.lo pow_ui.lo pow_z.lo proj.lo real.lo
urandom.lo set.lo set_prec.lo set_str.lo set_x.lo set_x_x.lo sin.lo sin_cos.lo
sinh.lo sqr.lo sqrt.lo strtoc.lo sub.lo sub_fr.lo sub_ui.lo
swap.lo tan.lo tanh.lo uceil_log2.lo ui_div.lo ui_ui_sub.lo  -lmpfr -lgmp -lm
libtool: link: warning: library `/usr/lib64/libmpfr.la' was moved.
libtool: link: ar rc .libs/libmpc.a  abs.o acos.o acosh.o add.o add_fr.o
add_si.o add_ui.o arg.o asin.o asinh.o atan.o atanh.o clear.o cmp.o
cmp_si_si.o conj.o cos.o cosh.o div_2si.o div_2ui.o div.o div_fr.o div_ui.o
exp.o fma.o fr_div.o fr_sub.o get_prec2.o get_prec.o get_version.o get_x.o
imag.o init2.o init3.o inp_str.o log.o log10.o mem.o mul_2si.o mul_2ui.o mul.o
mul_fr.o mul_i.o mul_si.o mul_ui.o neg.o norm.o out_str.o pow.o pow_fr.o
pow_ld.o pow_d.o pow_si.o pow_ui.o pow_z.o proj.o real.o urandom.o set.o
set_prec.o set_str.o set_x.o set_x_x.o sin.o sin_cos.o sinh.o sqr.o sqrt.o
strtoc.o sub.o sub_fr.o sub_ui.o swap.o tan.o tanh.o uceil_log2.o ui_div.o
libtool: link: ranlib .libs/libmpc.a
/bin/sed: can't read /usr/lib64/libgmp.la: No such file or directory
libtool: link: `/usr/lib64/libgmp.la' is not a valid libtool archive
make[5]: *** [libmpc.la] Error 1
make[5]: Leaving directory `/mnt/lfs/sources/gcc-build/mpc/src'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/mnt/lfs/sources/gcc-build/mpc'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/mnt/lfs/sources/gcc-build/mpc'
make[2]: *** [all-mpc] Error 2
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build'

Adding --with-gmp-include=$(pwd)gmp --with-gmp-lib=$pwd/gmp/.libs *does not help*.

Actually, I wonder whether it would not be cleaner to use host gmp, mpfr and
mpc completely, for building gcc pass1. Those libraries are installed anyway
with recent gcc. The only requirement would be that the headers be installed too.

Well, I have just read the thread "GCC build first pass: mpc build looks for
libgmp.la in the wrong place" to the end (should have done that before, I
know!). Basically, the build only fails when libmpfr.la is on the host and
libgmp.la is not. But if any is on the host, the build system uses paths on
the host. I'll try to reproduce this on Debian.


More information about the lfs-dev mailing list