[LLVMdev] LLVMInitializeNativeTarget error

Keith Sheppard keithshep at gmail.com
Mon May 30 06:32:06 PDT 2011


Hi, I've made some progress...

Apparently the LLVMInitializeNativeTarget symbol never makes it's way
into the shared library which makes sense since it's declared static
in the header. So it works if I directly call the
LLVMInitializeX86Target function as in the following updated version:

<https://github.com/keithshep/llvm-fs/blob/c52273a68bf89f205e8e29ce852a5cb050c262c6/test/simpletest2.fs>

It seems like a hack to do it this way though. Is there any technical
reason LLVMInitializeNativeTarget can't be built into the shared
library? Would the LLVM group be open to accepting a patch for making
this function available in the library?

Thanks, Keith

On Sun, May 29, 2011 at 1:57 PM, Keith Sheppard <keithshep at gmail.com> wrote:
> Hello All,
>
> I'm building an F# binding for LLVM and it seems to be working for the
> parts of Core and BitWriter that I've tested but I've hit problems
> with Target/ExecutionEngine. The following test code works with the
> initializeNativeTarget line commented out like so:
>
> <https://github.com/keithshep/llvm-fs/blob/b7050b841108dc703e58563a4cff8845603c950d/test/simpletest2.fs>
>
> ... but if I uncomment the initializeNativeTarget line I get the
> following error from mono:
>
> Unhandled Exception: System.EntryPointNotFoundException:
> LLVMInitializeNativeTarget
>  at (wrapper managed-to-native)
> LLVM.Generated.Target:initializeNativeTargetNative ()
>  at Simpletest2.main (System.String[] _arg5) [0x00000] in <filename unknown>:0
>
> I'm using LLVM on OS X 10.5 and since enable-shared is needed for use
> with mono it was configured as:
> ./configure --enable-shared --prefix=/Users/keith/lib
> --exec-prefix=/Users/keith/bin
>
> The LLVM bindings are generated by my F# code so they are not in the
> repo, but here is the Target binding for example:
> <https://gist.github.com/997985>
>
> Do you have any ideas for what I need to fix in order for
> initializeNativeTarget to work?
>
> Thanks for any suggestions,
> Keith
>
> --
> keithsheppard.name
>



-- 
keithsheppard.name




More information about the llvm-dev mailing list