gcc 7.3 bootstrap: ld is skipping incompatible mpc/mpfr/gmp libs

Michael Brunnbauer brunni@netestate.de
Tue Mar 20 16:20:00 GMT 2018


hi all,

I'm trying to build gcc 7.3 on an x86 32 bit system with support for 32
and 64 bit binaries and get linking problems with mpc/mpfr/gmp during the 
bootstrap process, e.g.:

 ld: skipping incompatible /usr/lib/libgmp.so when searching for -lgmp
 ld: skipping incompatible /usr/lib/libgmp.a when searching for -lgmp

I first had gmp-5.0.1/mpc-0.8.1/mpfr-2.4.2 and switched to gmp-6.1.2/mpc-1.1.0/
mpfr-4.0.1 without success. The version is probably not the problem because 
this is ld complaining - as if libgmp had the wrong architecture. Do I need 
the libraries in a 64 bit version also for a proper bootstrap? Or what could
be the problem here?

My system:
----------

fiano:~# uname -a
Linux fiano.netestate.de 3.16.55 #1 SMP Tue Mar 6 14:15:19 CET 2018 x86_64 GNU/Linux
fiano:~# gcc --version
gcc (GCC) 4.9.4
fiano:~# gcc -dumpmachine
i686-pc-linux-gnu
fiano:~# ld --version
GNU ld (GNU Binutils) 2.30
fiano:~# file /usr/lib/libgmp.so
/usr/lib/libgmp.so: symbolic link to libgmp.so.10.3.2
fiano:~# file /usr/lib/libgmp.so.10.3.2
/usr/lib/libgmp.so.10.3.2: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped

glibc is version 2.27

What I am doing:
----------------

unset LC_CTYPE # normal value de_DE leads to a glibc locale assert
mkdir objdir
cd objdir
../configure --prefix=/usr/gcc-biarch --enable-cpp --enable-targets=all \
--enable-languages=c,c++ --disable-libmudflap --disable-libquadmath
make bootstrap

What happens:
-------------

After a long time:
make[3]: Leaving directory `/home/bold/base/gcc-7.3.0/objdir/libdecnumber'
make[3]: Entering directory `/home/bold/base/gcc-7.3.0/objdir/gcc'
/home/bold/base/gcc-7.3.0/objdir/./prev-gcc/xg++ -B/home/bold/base/gcc-7.3.0/objdir/./prev-gcc/ -B/usr/gcc-biarch/x86_64-pc-linux-gnu/bin/ -nostdinc++ -B/home/bold/base/gcc-7.3.0/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -B/home/bold/base/gcc-7.3.0/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs  -I/home/bold/base/gcc-7.3.0/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu  -I/home/bold/base/gcc-7.3.0/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include  -I/home/bold/base/gcc-7.3.0/libstdc++-v3/libsupc++ -L/home/bold/base/gcc-7.3.0/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/home/bold/base/gcc-7.3.0/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -no-pie   -g -O2 -gtoggle -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc  -o cc1 c/c-lang.o c-family/stub-objc.o attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o c/c-array-notation.o c/c-fold.o c/gimple-parser.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o c-family/c-gimplify.o c-family/c-indentation.o c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o c-family/c-cilkplus.o c-family/array-notation-common.o c-family/cilk.o c-family/c-ubsan.o c-family/c-attribs.o c-family/c-warn.o i386-c.o glibc-c.o \
  cc1-checksum.o libbackend.a main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a   -lmpc -lmpfr -lgmp -rdynamic -ldl  -L./../zlib -lz
/usr/lib/gcc/i686-pc-linux-gnu/4.9.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libmpc.so when searching for -lmpc
/usr/lib/gcc/i686-pc-linux-gnu/4.9.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libmpc.a when searching for -lmpc
/usr/lib/gcc/i686-pc-linux-gnu/4.9.4/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lmpc
/usr/lib/gcc/i686-pc-linux-gnu/4.9.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libmpfr.so when searching for -lmpfr
/usr/lib/gcc/i686-pc-linux-gnu/4.9.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libmpfr.a when searching for -lmpfr
/usr/lib/gcc/i686-pc-linux-gnu/4.9.4/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lmpfr
/usr/lib/gcc/i686-pc-linux-gnu/4.9.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libgmp.so when searching for -lgmp
/usr/lib/gcc/i686-pc-linux-gnu/4.9.4/../../../../i686-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libgmp.a when searching for -lgmp
/usr/lib/gcc/i686-pc-linux-gnu/4.9.4/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
make[3]: *** [cc1] Error 1
make[3]: Leaving directory `/home/bold/base/gcc-7.3.0/objdir/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/home/bold/base/gcc-7.3.0/objdir'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/home/bold/base/gcc-7.3.0/objdir'
make: *** [bootstrap] Error 2

thnx,
cu,
brunni

-- 
++  Michael Brunnbauer
++  netEstate GmbH
++  Geisenhausener Straße 11a
++  81379 München
++  Tel +49 89 32 19 77 80
++  Fax +49 89 32 19 77 89 
++  E-Mail brunni@netestate.de
++  http://www.netestate.de/
++
++  Sitz: München, HRB Nr.142452 (Handelsregister B München)
++  USt-IdNr. DE221033342
++  Geschäftsführer: Michael Brunnbauer, Franz Brunnbauer
++  Prokurist: Dipl. Kfm. (Univ.) Markus Hendel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20180320/db81fedb/attachment.sig>


More information about the Gcc-help mailing list