We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e7c646 commit 162365eCopy full SHA for 162365e
src/driver/jit.rs
@@ -311,7 +311,11 @@ fn dep_symbol_lookup_fn(
311
.find(|(crate_type, _data)| *crate_type == rustc_session::config::CrateType::Executable)
312
.unwrap()
313
.1;
314
- for &cnum in &crate_info.used_crates {
+ // `used_crates` is in reverse postorder in terms of dependencies. Reverse the order here to
315
+ // get a postorder which ensures that all dependencies of a dylib are loaded before the dylib
316
+ // itself. This helps the dynamic linker to find dylibs not in the regular dynamic library
317
+ // search path.
318
+ for &cnum in crate_info.used_crates.iter().rev() {
319
let src = &crate_info.used_crate_source[&cnum];
320
match data[cnum.as_usize() - 1] {
321
Linkage::NotLinked | Linkage::IncludedFromDylib => {}
0 commit comments