Skip to content

Commit 19b6743

Browse files
authoredMar 8, 2025
Rollup merge of #137337 - dalvescb:master, r=petrochenkov
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`
2 parents f5a1ef7 + 917d2eb commit 19b6743

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎compiler/rustc_codegen_ssa/src/back/linker.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1655,9 +1655,9 @@ impl<'a> Linker for AixLinker<'a> {
16551655
}
16561656
}
16571657

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.