Shilpa B via llvm-dev
2016-Mar-17 05:04 UTC
[llvm-dev] Linking two LLVM IR files with native functions
Hi, I am looking at JIT compiling a Matlab program using LLVM. I was able to generate the LLVM IR (.ll) for a given Matlab program but this IR has a call to native C++ function. So I generated the LLVM IR (.ll) for the C++ file containing the native C++ function using clang. Now, these two .ll files can be linked together by generating .bc files. But I could generate .bc file only for the C++ .ll file but not for Matlab .ll as it says the function definition could not be found... So how could I link these two .ll files. Thanks, Shilpa -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160317/f391823a/attachment.html>
Tim Northover via llvm-dev
2016-Mar-17 14:49 UTC
[llvm-dev] Linking two LLVM IR files with native functions
On 16 March 2016 at 22:04, Shilpa B via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Now, these two .ll files can be linked together by generating .bc files. But > I could generate .bc file only for the C++ .ll file but not for Matlab .ll > as it says the function definition could not be found...That's very weird, it looks more like a linker error than an llvm-as error. What are you running to try and convert the Matlab .ll file to a .bc.> So how could I link these two .ll files.Clang should be able to accept .ll files directly (as should llvm-link, I think): "clang cpp_impl.ll matlab.ll -omatlab". Cheers. Tim.