We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4dbdcd1 commit 9f406ceCopy full SHA for 9f406ce
compiler/rustc_codegen_llvm/src/llvm_util.rs
@@ -130,13 +130,12 @@ unsafe fn configure_llvm(sess: &Session) {
130
llvm::LLVMInitializePasses();
131
132
for plugin in &sess.opts.debugging_opts.llvm_plugins {
133
- let path = CString::new(plugin.as_bytes()).unwrap();
134
- let res = libc::dlopen(path.as_ptr(), libc::RTLD_LAZY | libc::RTLD_GLOBAL);
135
- if res.is_null() {
136
- println!("{}", CStr::from_ptr(libc::dlerror()).to_string_lossy().into_owned());
+ let path = path::Path::new(plugin);
+ let res = DynamicLibrary::open(path);
+ match res {
+ Ok(_) => debug!("configure_llvm: {}", plugin),
137
+ Err(e) => bug!("couldn't load plugin: {}", e),
138
}
- println!("{:p}", res);
139
- println!("{}", plugin);
140
141
142
rustc_llvm::initialize_available_targets();
0 commit comments