[llvm-dev] How to link .bc files and produce executable?

PenYiWang via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 25 22:11:28 PDT 2019


Hi

I use llvm-link to link some bitcode files : llvm-link a.bc b.bc c.bc -o
test.bc

And then I use llc to produce object file : llc -filetype=obj  test.bc -o
./test.o

And then I use clang to produce executable : clang test.o -o test
but there are some error message like this:

In function `_do_handshake':
llvm-link:(.text+0x3c3ba): undefined reference to `rpl_fcntl'
llvm-link:(.text+0x3c3e6): undefined reference to `rpl_fcntl'
llvm-link:(.text+0x3c404): undefined reference to `gnutls_handshake'

It seems like that it cannot find functions in library.

What command options I should use so that  I can get a executable
successfully?

I am not familiar with clang/llvm's toolchain.

Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190926/3e53ab11/attachment.html>


More information about the llvm-dev mailing list