<div dir="ltr"><div>Hi Francis,</div><div><br></div><div>You can use the StaticLibraryDefinitionGenerator class to expose symbols from a static library (archive). You create an instance using its static Load() method, then add the instance to the LLJIT by calling JITDylib::addGenerator(). I haven't tried this on Windows, though.<br></div><div><br></div><div>Geoff<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 22, 2021 at 8:37 AM Francis ANDRE via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Hello everyone</p>
<p>Unless I misunderstood the class LLJIT, there is no function to
add a archive (.lib on Windows or .a on Linux) to the instance of
LLJIT, but one can only add an object or a IR module. I am trying
to JIT the code below and need this Windows library: <span style="display:inline"><span>legacy_stdio_definitions.lib</span></span></p>
<font face="monospace"><span style="display:inline"><span>HelloWorld.c</span></span><br>
<span style="display:inline"><span>extern int printf(char*, ...);</span></span><br>
<span style="display:inline"><span>int main() {</span></span><br>
<span style="display:inline"><span> printf("Hello World!\n");</span></span><br>
<span style="display:inline"><span> return 0;</span></span><span style="display:inline"><span></span></span><br>
<span style="display:inline"><span>}</span></span></font>
<p><span style="display:inline"><span><font face="monospace">What did I
miss?</font></span></span></p>
<p><span style="display:inline"><span><font face="monospace">Rdgs</font></span></span></p>
<p><span style="display:inline"><span><font face="monospace">FA</font><br>
</span></span></p>
<p><span style="display:inline"><span><font face="monospace"><br>
</font></span></span></p>
<p><span style="display:inline"><span></span></span></p>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>