Linking a bc file

I'm trying to test a bitcode file that I created using the LLVM API. Using llvm-g++, how can I compile.a C++ file and link it against my bc file ? I try to call a single function in the bc file from the c++ main function.

Envoyé de mon iPhone

Hello Alexandre,

I'm trying to test a bitcode file that I created using the LLVM API. Using llvm-g++, how can I compile.a C++ file and link it against my bc file ? I try to call a single function in the bc file from the c++ main function.

You need to have a linker which supports linking of LLVM bitcode. So
far this is darwin linker and gold with extra plugin. This doc might
be helpful: http://llvm.org/docs/GoldPlugin.html

Hi Anton,

I'm trying to test a bitcode file that I created using the LLVM API. Using llvm-g++, how can I compile.a C++ file and link it against my bc file ? I try to call a single function in the bc file from the c++ main function.

You need to have a linker which supports linking of LLVM bitcode. So
far this is darwin linker and gold with extra plugin. This doc might
be helpful: http://llvm.org/docs/GoldPlugin.html

Thanks, this is good to know (I somehow skipped this part when reading
LLVM doc) but I don't need anything fancy like LTO for now. I solved
my simple problem by using llc and then linking native object files.

Alex