http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53798
Bug #: 53798 Summary: [4.7] Bootstrap fails on Linux x86_64 with pre-built libmpc/mpfr/gmp due to multilib path problem Classification: Unclassified Product: gcc Version: 4.7.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap AssignedTo: unassig...@gcc.gnu.org ReportedBy: windw...@gmx.com GCC 4.7.1 fails to bootstrap on Linux x86_64 due to a multilib problem if pre-built libraries for MPC, MPFR and GMP are used and their installation directory is set using --with-[mpc|mpfr|gmp] (see output at the end). Obviously these libraries reside in different paths for 32 bit and 64 bit. The main configure script (line 5108 and following) evaluates the --with-[mpc|mpfr|gmp]=PATH parameters and extends $gmplibs with "-LPATH/lib". The resulting GMPLIBS is used in ./Makefile.in and ./gcc/Makefile.in, and causes the bootstrapping to fail in either 32 or 64 bit multilib stage (depending on the parameters). Besides the redundancy if all libraries reside in the same path, $gmplibs can only be correct for either 32 or 64 bit. Workaround: Assumption: 32 bit libraries reside in PATH/lib, the 64 bit versions in PATH/lib64 Use --with-[mpc|mpfr|gmp]=PATH and add --with-gmp-lib=PATH/lib64. The configure script will generate GMPLIBS with (at least) -LPATH/lib64 and -LPATH/lib. GNU ld will ignore the incompatible version while searching for lib[mpc|mpfr|gmp]. /opt/SP/build/gcc/gcc-4.7.1-build/./prev-gcc/g++ -B/opt/SP/build/gcc/gcc-4.7.1-build/./prev-gcc/ -B/opt/SP/gcc/gcc-4.7.1/x86_64-unknown-linux-gnu/bin/ -nostdinc++ -B/opt/SP/build/gcc/gcc-4.7.1-build/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/opt/SP/build/gcc/gcc-4.7.1-build/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -I/opt/SP/build/gcc/gcc-4.7.1-build/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -I/opt/SP/build/gcc/gcc-4.7.1-build/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include -I/opt/SP/build/gcc/gcc-4.7.1/libstdc++-v3/libsupc++ -L/opt/SP/build/gcc/gcc-4.7.1-build/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/opt/SP/build/gcc/gcc-4.7.1-build/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -g -O2 -gtoggle -DIN_GCC -fno-exceptions -fno-rtti -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc -o jc1 \ java/class.o java/decl.o java/expr.o java/constants.o java/lang.o java/typeck.o java/except.o java/verify-glue.o java/verify-impl.o java/zextract.o java/jcf-io.o java/win32-host.o java/jcf-parse.o java/mangle.o java/mangle_name.o java/builtins.o java/resource.o java/jcf-depend.o java/jcf-path.o java/boehm.o java/java-gimplify.o main.o libbackend.a libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a -L../zlib -lz libcommon.a ../libcpp/libcpp.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a attribs.o -L/opt/SP/gcc/gcc-4.7.1/lib -L/opt/SP/gcc/gcc-4.7.1/lib -L/opt/SP/gcc/gcc-4.7.1/lib -lmpc -lmpfr -lgmp -rdynamic -ldl -L../zlib -lz /opt/SP/gcc/gcc-4.7.1/bin/ld: __gmpfr_emin: TLS definition in /opt/SP/gcc/gcc-4.7.1/lib64/libmpfr.so.4 section .tdata mismatches non-TLS definition in /usr/lib/../lib64/libmpfr.a(exceptions.o) section .data /opt/SP/gcc/gcc-4.7.1/lib64/libmpfr.so.4: could not read symbols: Bad value collect2: error: ld returned 1 exit status gmake[3]: *** [jc1] Error 1 gmake[3]: Leaving directory `/opt/SP/build/gcc/gcc-4.7.1-build/gcc'