From 03b326da636ea3382caa85d6666c0f5f17cf6ae0 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Sun, 4 Oct 2020 22:19:40 +0200 Subject: [PATCH] Use `RTLD_DEEPBIND` for loading dylibs/proc-macros --- compiler/rustc_metadata/src/dynamic_lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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());