Skip to content

Commit

Permalink
Rollup merge of #137337 - dalvescb:master, r=petrochenkov
Browse files Browse the repository at this point in the history
Add verbatim linker to AIXLinker

This adds support for the "verbatim" native link modifier on AIX, will successfully pass the `native-link-modifier-verbatim-linker test case`
  • Loading branch information
jhpratt authored Mar 8, 2025
2 parents f5a1ef7 + 917d2eb commit 19b6743
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_ssa/src/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1655,9 +1655,9 @@ impl<'a> Linker for AixLinker<'a> {
}
}

fn link_dylib_by_name(&mut self, name: &str, _verbatim: bool, _as_needed: bool) {
fn link_dylib_by_name(&mut self, name: &str, verbatim: bool, _as_needed: bool) {
self.hint_dynamic();
self.link_or_cc_arg(format!("-l{name}"));
self.link_or_cc_arg(if verbatim { String::from(name) } else { format!("-l{name}") });
}

fn link_dylib_by_path(&mut self, path: &Path, _as_needed: bool) {
Expand All @@ -1668,7 +1668,7 @@ impl<'a> Linker for AixLinker<'a> {
fn link_staticlib_by_name(&mut self, name: &str, verbatim: bool, whole_archive: bool) {
self.hint_static();
if !whole_archive {
self.link_or_cc_arg(format!("-l{name}"));
self.link_or_cc_arg(if verbatim { String::from(name) } else { format!("-l{name}") });
} else {
let mut arg = OsString::from("-bkeepfile:");
arg.push(find_native_static_library(name, verbatim, self.sess));
Expand Down

0 comments on commit 19b6743

Please sign in to comment.