Skip to content

Commit fde9966

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

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
@@ -2135,6 +2135,10 @@ impl<'test> TestCx<'test> {
21352135
self.config.target.contains("vxworks") && !self.is_vxworks_pure_static()
21362136
}
21372137

2138+
fn has_aux_dir(&self) -> bool {
2139+
!self.props.aux_builds.is_empty() || !self.props.aux_crates.is_empty()
2140+
}
2141+
21382142
fn build_all_auxiliary(&self, rustc: &mut Command) -> PathBuf {
21392143
let aux_dir = self.aux_output_dir_name();
21402144

@@ -2612,7 +2616,11 @@ impl<'test> TestCx<'test> {
26122616
}
26132617

26142618
if let LinkToAux::Yes = link_to_aux {
2615-
rustc.arg("-L").arg(self.aux_output_dir_name());
2619+
// if we pass an `-L` argument to a directory that doesn't exist,
2620+
// macOS ld emits warnings which disrupt the .stderr files
2621+
if self.has_aux_dir() {
2622+
rustc.arg("-L").arg(self.aux_output_dir_name());
2623+
}
26162624
}
26172625

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

0 commit comments

Comments
 (0)