Skip to content

Commit 675f447

Browse files
jynjyn514
jyn
authored andcommitted
don't pass -L .../auxiliary unless it exists
this avoids warnings from macOS ld
1 parent f1e5b36 commit 675f447

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: src/tools/compiletest/src/runtest.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,10 @@ impl<'test> TestCx<'test> {
10961096
self.config.target.contains("vxworks") && !self.is_vxworks_pure_static()
10971097
}
10981098

1099+
fn has_aux_dir(&self) -> bool {
1100+
!self.props.aux.builds.is_empty() || !self.props.aux.crates.is_empty()
1101+
}
1102+
10991103
fn aux_output_dir(&self) -> PathBuf {
11001104
let aux_dir = self.aux_output_dir_name();
11011105

@@ -1649,7 +1653,11 @@ impl<'test> TestCx<'test> {
16491653
}
16501654

16511655
if let LinkToAux::Yes = link_to_aux {
1652-
rustc.arg("-L").arg(self.aux_output_dir_name());
1656+
// if we pass an `-L` argument to a directory that doesn't exist,
1657+
// macOS ld emits warnings which disrupt the .stderr files
1658+
if self.has_aux_dir() {
1659+
rustc.arg("-L").arg(self.aux_output_dir_name());
1660+
}
16531661
}
16541662

16551663
rustc.args(&self.props.compile_flags);

0 commit comments

Comments
 (0)