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 -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
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.htmlThanks, 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
Seemingly Similar Threads
- [LLVMdev] Linking a bc file
- [LLVMdev] What's the difference between using llvm-link and using llvm gold plugin?
- [LLVMdev] Dropped support for IR-level extended linking support (archives, etc.)
- [LLVMdev] Difficulties in using gold plugin. ("ar" not working properly)
- [LLVMdev] What's the difference between using llvm-link and using llvm gold plugin?