Skip to content

Commit 56064d5

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

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/tools/compiletest/src/runtest.rs

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

1061+
fn has_aux_dir(&self) -> bool {
1062+
!self.props.aux_builds.is_empty() || !self.props.aux_crates.is_empty()
1063+
}
1064+
10611065
fn aux_output_dir(&self) -> PathBuf {
10621066
let aux_dir = self.aux_output_dir_name();
10631067

@@ -1612,7 +1616,11 @@ impl<'test> TestCx<'test> {
16121616
}
16131617

16141618
if let LinkToAux::Yes = link_to_aux {
1615-
rustc.arg("-L").arg(self.aux_output_dir_name());
1619+
// if we pass an `-L` argument to a directory that doesn't exist,
1620+
// macOS ld emits warnings which disrupt the .stderr files
1621+
if self.has_aux_dir() {
1622+
rustc.arg("-L").arg(self.aux_output_dir_name());
1623+
}
16161624
}
16171625

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

0 commit comments

Comments
 (0)