LLVMInitializeNativeTarget error

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:


... but if I uncomment the initializeNativeTarget line I get the
following error from mono:

Unhandled Exception: System.EntryPointNotFoundException:
  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

The LLVM bindings are generated by my F# code so they are not in the
repo, but here is the Target binding for example:

Do you have any ideas for what I need to fix in order for
initializeNativeTarget to work?

Thanks for any suggestions,

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:


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