problem with using shared library of GMP 5.0.1

Paul Zimmermann Paul.Zimmermann at
Thu Sep 2 10:38:00 CEST 2010


I'm not sure this is a GMP bug, but I report it since other users might have
hit this problem. When compiling GMP 5.0.1 on a Core 2 with the default
configure, then installing it and using it with say MPFR 3.0.0, I get when
building MPFR:

/usr/bin/ld: /tmp/lib/libgmp.a(realloc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/tmp/lib/libgmp.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [] Error 1

If I recompile GMP 5.0.1 with adding -fPIC in CFLAGS, and reinstall it, then
everything works fine.

This problem does not occur with GMP 4.3.2.

chorizo% uname -a
Linux chorizo 2.6.32-24-generic #42-Ubuntu SMP Fri Aug 20 14:21:58 UTC 2010 x86_64 GNU/Linux

chorizo% gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) 

chorizo% ./config.guess 

Paul Zimmermann

More information about the gmp-bugs mailing list