http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28811
--- Comment #18 from __vic <d.v.a at ngs dot ru> 2012-06-27 10:19:18 UTC --- GCC 4.7.1 still fails to link .so against static libstdc++.a in 64-bit mode: $ g++ -shared -fPIC -static-libgcc -static-libstdc++ -o 1.so 1.cpp /usr/bin/ld: /opt/gcc-4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../lib64/libstdc++.a(globals_io.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /opt/gcc-4.6.1/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../lib64/libstdc++.a: could not read symbols: Bad value collect2: ld returned 1 exit status make: *** [1.so] Error 1 32-bit mode is working: $ g++ -m32 -shared -fPIC -static-libgcc -static-libstdc++ -o 1.so 1.cpp