Nan Zhu
2009-Nov-07 03:35 UTC
[LLVMdev] linking share libraries when building whole-program bitcode file
Hi,all I'm working on how to build a whole-program bitcode file for big projects with a general solution,and I met a problem I simplify it as this: llvm-gcc -c -emit-llvm test.c llvm-ld test.o -lpthread //here llvm-ld tells me that "Cannot find library pthread" then I do this: llvm-ld test.o lli -load=/usr/lib/libpthread.so a.out.bc //lli tells me the /usr/lib/libpthread.so has a invalid ELF header What's the problem,my platform is Fedora 11 Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091107/e590e2a9/attachment.html>
Timo Juhani Lindfors
2009-Nov-17 18:25 UTC
[LLVMdev] linking share libraries when building whole-program bitcode file
Nan Zhu <zhunansjtu at gmail.com> writes:> llvm-gcc -c -emit-llvm test.c > > llvm-ld test.o -lpthread //here llvm-ld tells me that "Cannot find library > pthread"$ llvm-gcc -c -emit-llvm test.c $ llvm-ld test.o -lpthread $ ./a.out Error opening '/usr/lib/libpthread.a': /usr/lib/libpthread.a: invalid ELF header -load request ignored. Hello world
Nan Zhu
2009-Nov-18 00:54 UTC
[LLVMdev] linking share libraries when building whole-program bitcode file
my platform is Fedora 11 X86_64, but I have found that llvm-ld will link libpthread as a default action just run llvm-ld test.o and lli test.bc will give the right result 2009/11/18 Timo Juhani Lindfors <timo.lindfors at iki.fi>> Nan Zhu <zhunansjtu at gmail.com> writes: > > llvm-gcc -c -emit-llvm test.c > > > > llvm-ld test.o -lpthread //here llvm-ld tells me that "Cannot find > library > > pthread" > > $ llvm-gcc -c -emit-llvm test.c > $ llvm-ld test.o -lpthread > $ ./a.out > Error opening '/usr/lib/libpthread.a': /usr/lib/libpthread.a: invalid ELF > header > -load request ignored. > Hello world > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091118/5821f439/attachment.html>