File tree 1 file changed +5
-6
lines changed
compiler/rustc_codegen_llvm/src
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -130,13 +130,12 @@ unsafe fn configure_llvm(sess: &Session) {
130
130
llvm:: LLVMInitializePasses ( ) ;
131
131
132
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( ) ) ;
133
+ let path = path:: Path :: new ( plugin) ;
134
+ let res = DynamicLibrary :: open ( path) ;
135
+ match res {
136
+ Ok ( _) => debug ! ( "configure_llvm: {}" , plugin) ,
137
+ Err ( e) => bug ! ( "couldn't load plugin: {}" , e) ,
137
138
}
138
- println ! ( "{:p}" , res) ;
139
- println ! ( "{}" , plugin) ;
140
139
}
141
140
142
141
rustc_llvm:: initialize_available_targets ( ) ;
You can’t perform that action at this time.
0 commit comments