[LLVMdev] compiling with libstdc++.a that "could not read symbol"

Duncan Sands baldrick at free.fr
Thu May 12 01:31:51 PDT 2011


Hi Tim,

> llvm[3]: Linking Debug+Asserts Loadable Module LLVMHello.so
> /depot/qsc/QSCF/bin/ld:
> /linux/depot/gcc-4.2.2-static/bin/../lib/gcc/x86_64-redhat-linux/4.2.2/../../../../lib64/libstdc++.a(string-inst.o):
> relocation R_X86_64_32 against `std::basic_string<char, std::char_traits<char>,
> std::allocator<char> >::_Rep::_S_empty_rep_storage' can not be used when making
> a shared object; recompile with -fPIC

libstdc++.a wasn't built with -fPIC, so can't be linked with when building
a shared library (in this case LLVMHello.so).  So this looks like a problem
with your GCC installation, not with LLVM.  I expect you to have the same
problem when building any shared library that needs to link with libstdc++.

Ciao, Duncan.



More information about the llvm-dev mailing list