diff --git a/compiler/rustc_metadata/src/dynamic_lib.rs b/compiler/rustc_metadata/src/dynamic_lib.rs index bdb53e3f75a40..0467df341b8c3 100644 --- a/compiler/rustc_metadata/src/dynamic_lib.rs +++ b/compiler/rustc_metadata/src/dynamic_lib.rs @@ -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());