allow loading of llvm plugins on nightly
This commit is contained in:
parent
fb3ea63d9b
commit
4dbdcd1c5c
3 changed files with 13 additions and 0 deletions
|
@ -129,6 +129,16 @@ unsafe fn configure_llvm(sess: &Session) {
|
|||
|
||||
llvm::LLVMInitializePasses();
|
||||
|
||||
for plugin in &sess.opts.debugging_opts.llvm_plugins {
|
||||
let path = CString::new(plugin.as_bytes()).unwrap();
|
||||
let res = libc::dlopen(path.as_ptr(), libc::RTLD_LAZY | libc::RTLD_GLOBAL);
|
||||
if res.is_null() {
|
||||
println!("{}", CStr::from_ptr(libc::dlerror()).to_string_lossy().into_owned());
|
||||
}
|
||||
println!("{:p}", res);
|
||||
println!("{}", plugin);
|
||||
}
|
||||
|
||||
rustc_llvm::initialize_available_targets();
|
||||
|
||||
llvm::LLVMRustSetLLVMOptions(llvm_args.len() as c_int, llvm_args.as_ptr());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue