Skip to content

Commit

Permalink
Pass -bnoipath when adding rust upstream dynamic crates
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai Luo authored and daltenty committed Dec 6, 2024
1 parent bc145ce commit 18f8657
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2753,6 +2753,13 @@ fn add_upstream_rust_crates(
.find(|(ty, _)| *ty == crate_type)
.expect("failed to find crate type in dependency format list");

if sess.target.is_like_aix {
// Unlike GNU's ld, AIX linker doesn't feature `-soname=...` when output
// a shared library. Instead, AIX linker offers `(no)ipath`. See
// https://www.ibm.com/docs/en/aix/7.3?topic=l-ld-command.
cmd.link_or_cc_arg("-bnoipath");
}

for &cnum in &codegen_results.crate_info.used_crates {
// We may not pass all crates through to the linker. Some crates may appear statically in
// an existing dylib, meaning we'll pick up all the symbols from the dylib.
Expand Down

0 comments on commit 18f8657

Please sign in to comment.