denzp / rustc-llvm-proxy

Proxy LLVM calls into Rust own shared library in runtime
MIT License
32 stars 13 forks source link

Link LLVM initialization functions #4

Closed termoshtt closed 6 years ago

termoshtt commented 6 years ago

rustc-llvm-proxy cannot link llvm_sys::target::LLVM_InitializeAllTargets and other initialization function listed at https://github.com/tari/llvm-sys.rs/blob/36cdcf413a0f452ffb0c7c7ba7dd5954b0a59214/src/target.rs#L169.

LLVM C API defines initialization APIs as , e.g. LLVMInitializeAllTargets as static inline functions, and these symbols does not exist in the shared library. llvm-sys/wrapper/target.c create public ABI of these functions to call from Rust. However, this way cannot be used with this crate because it needs to compile C code (target.c) with the LLVM library.

I re-implement these as rust code.

denzp commented 6 years ago

Thanks for the changes! Published in 0.1.4.