[llvm-dev] LLJIT: Help: how to add a archive?

Geoff Levner via llvm-dev
Mon, 22 Mar 2021 08:52:23 -0000

Hi Francis,

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.

Geoff

On Mon, Mar 22, 2021 at 8:37 AM Francis ANDRE via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hello everyone
>
> 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: legacy_stdio_definitions.lib
> HelloWorld.c
> extern int printf(char*, ...);
> int main() {
>    printf("Hello World!\n");
>    return 0;
> }
>
> What did I miss?
>
> Rdgs
>
> FA
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20210322/9e355748/attachment.html>