diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 9c58f5b179fd8..31adab64f609d 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -660,6 +660,15 @@ impl<'a> Builder<'a> { } } + /// Get the paths to all of the compiler's codegen backends. + fn codegen_backends(&self, compiler: Compiler) -> impl Iterator { + fs::read_dir(self.sysroot_codegen_backends(compiler)) + .into_iter() + .flatten() + .filter_map(Result::ok) + .map(|entry| entry.path()) + } + pub fn rustdoc(&self, host: Interned) -> PathBuf { self.ensure(tool::Rustdoc { host }) } @@ -750,6 +759,9 @@ impl<'a> Builder<'a> { match mode { Mode::Std => { self.clear_if_dirty(&my_out, &self.rustc(compiler)); + for backend in self.codegen_backends(compiler) { + self.clear_if_dirty(&my_out, &backend); + } }, Mode::Test => { self.clear_if_dirty(&my_out, &libstd_stamp);