You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a small testbed compiler that I am working on for which I wrote a small runtime lib that leverages libc functions. Programs that use the libc-based runtime can be executed with the inkwell wrappers over the llvm JIT/execution engine functions. All good if you want to write a C-based runtime lib.
I wrote another small runtime lib in rust. This will not link correctly when I try to execute it with the JIT functions, but works great if I do something like this and produce a binary:
Is there a way to get the LLVM JIT execution engine functions to consider additional link paths? I tried updating ldconfig, but it didn't seem to make a difference. Does anybody know where the LLVM JIT functions actually look to get paths for linking? I am assuming that they use ldconfig (on linux) - but updating the ldconfig cache didn't seem to help.
In the set of commands shown above I generate an IR file for my .fud program. I then run clang, passing it the local path to my rust static runtime lib, the generated .ll file and the full path to libstd-0fbbe72b9e0d57dc.so on my machine. A working binary is created and in this way I am compiling rust-based functions into my .fud runtime which is pretty cool. I can also make this happen using llc + lld, but if feels pretty clunky to do it that way due to the big set of ld flags required. Here comes the question... If I want to provide an option to generate a binary directly from my .fud compiler is there a way to do it without resorting to calling out to llc + ld or calling out to clang (or gcc) as shown above?
Admittedly these questions are leaning towards RTFM territory, but if anybody has quick answers some feedback would be great.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello All,
I have a small testbed compiler that I am working on for which I wrote a small runtime lib that leverages libc functions. Programs that use the libc-based runtime can be executed with the inkwell wrappers over the llvm JIT/execution engine functions. All good if you want to write a C-based runtime lib.
I wrote another small runtime lib in rust. This will not link correctly when I try to execute it with the JIT functions, but works great if I do something like this and produce a binary:
Clang: IR + StaticLib + Rust stdlib*.so -> Binary
A lot of questions start here.
Admittedly these questions are leaning towards RTFM territory, but if anybody has quick answers some feedback would be great.
thanks,
Steve
Beta Was this translation helpful? Give feedback.
All reactions