Skip to content

Commit

Permalink
Use RTLD_DEEPBIND for loading dylibs/proc-macros
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-schievink committed Oct 4, 2020
1 parent a835b48 commit 03b326d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_metadata/src/dynamic_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ mod dl {
let s = CString::new(filename.as_bytes()).unwrap();

let mut dlerror = error::lock();
let ret = unsafe { libc::dlopen(s.as_ptr(), libc::RTLD_LAZY | libc::RTLD_LOCAL) };
let ret = unsafe {
libc::dlopen(s.as_ptr(), libc::RTLD_LAZY | libc::RTLD_LOCAL | libc::RTLD_DEEPBIND)
};

if !ret.is_null() {
return Ok(ret.cast());
Expand Down

0 comments on commit 03b326d

Please sign in to comment.