Closed jgollenz closed 1 year ago
Linking to the plain library bar
results in a working executable. And I cross-checked with example02 (from which I copied most of the files): running ar -t libbar_bc_lib.a
in both cases returns bar.bc
, which in turn results in file format not recognized
when running nm
on the library.
Alright, I found llvmir_attach_obj_target
which did the trick. I'll make a PR to add that to the README if you don't mind. Case closed
Hey there @jgollenz, thanks for this. I have limited bandwidth ATM for this, but a PR would be obviously welcome. I'll properly look at this whenever I find some time.
I am trying to link a static library that was created with
llvmir_attach_library
to a target that then in turn goes through the llvmir stages itself. However, it fails when trying to link the library:What I noticed, is that the object file
bar.cpp.o
is missing. But when I modify thesrc/lib/CMakeLists.txt
, so it can be treated as its own cmake project, everything works fine and the object files are present. Any idea what I might be doing wrong? This is the commit with the example I added