[LLVMdev] linking share libraries when building whole-program bitcode file

Nan Zhu zhunansjtu at gmail.com
Tue Nov 17 16:54:50 PST 2009


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>


More information about the llvm-dev mailing list