Skip to content

Commit 56b8c94

Browse files
jynjyn514
jyn
authored andcommitted
don't pass -L .../auxiliary unless it exists
this avoids warnings from macOS ld
1 parent 6b77d59 commit 56b8c94

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
@@ -1778,6 +1778,10 @@ impl<'test> TestCx<'test> {
17781778
self.config.target.contains("vxworks") && !self.is_vxworks_pure_static()
17791779
}
17801780

1781+
fn has_aux_dir(&self) -> bool {
1782+
!self.props.aux_builds.is_empty() || !self.props.aux_crates.is_empty()
1783+
}
1784+
17811785
fn aux_output_dir(&self) -> PathBuf {
17821786
let aux_dir = self.aux_output_dir_name();
17831787

@@ -2324,7 +2328,11 @@ impl<'test> TestCx<'test> {
23242328
}
23252329

23262330
if let LinkToAux::Yes = link_to_aux {
2327-
rustc.arg("-L").arg(self.aux_output_dir_name());
2331+
// if we pass an `-L` argument to a directory that doesn't exist,
2332+
// macOS ld emits warnings which disrupt the .stderr files
2333+
if self.has_aux_dir() {
2334+
rustc.arg("-L").arg(self.aux_output_dir_name());
2335+
}
23282336
}
23292337

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

0 commit comments

Comments
 (0)