Timothy Shiu
2011-May-11 21:33 UTC
[LLVMdev] compiling with libstdc++.a that "could not read symbol"
Hi there, I have a question on my linux box where I cant link properly. I've tried configure option --enable-shared or --disable-shared. The following are the message I got. Is there anything I can do to fix this linking/lib problem? thanks in advance, Tim ps. make[3]: Entering directory `/remote/dept5428a/clientstore/timoshiu/timoshiu_esp_main_llvm/obj/lib/Transforms/Hello' 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 /linux/depot/gcc-4.2.2-static/bin/../lib/gcc/x86_64-redhat-linux/4.2.2/../../../../lib64/libstdc++.a:could not read symbols: Bad value collect2: ld returned 1 exit status make[3]: *** [/remote/dept5428a/clientstore/timoshiu/timoshiu_esp_main_llvm/obj/Debug+Asserts/lib/LLVMHello.so] Error 1 make[3]: Leaving directory `/remote/dept5428a/clientstore/timoshiu/timoshiu_esp_main_llvm/obj/lib/Transforms/Hello' make[2]: *** [Hello/.makeall] Error 2 make[2]: Leaving directory `/remote/dept5428a/clientstore/timoshiu/timoshiu_esp_main_llvm/obj/lib/Transforms' make[1]: *** [Transforms/.makeall] Error 2 make[1]: Leaving directory `/remote/dept5428a/clientstore/timoshiu/timoshiu_esp_main_llvm/obj/lib' make: *** [all] Error 1 -- Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110511/13a19dcf/attachment.html>
Duncan Sands
2011-May-12 08:31 UTC
[LLVMdev] compiling with libstdc++.a that "could not read symbol"
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 -fPIClibstdc++.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.