record mtime in llvm linker script

This will avoid rebuilds due to the script being more recent than the
rest of the original files.
This commit is contained in:
Rémy Rakic 2024-03-07 12:39:51 +00:00
parent b91ceb88de
commit 1c3fe15f6c

View File

@ -2048,6 +2048,13 @@ fn install_llvm_file(
let link = t!(fs::read_link(source)); let link = t!(fs::read_link(source));
let mut linker_script = t!(fs::File::create(full_dest)); let mut linker_script = t!(fs::File::create(full_dest));
t!(write!(linker_script, "INPUT({})\n", link.display())); t!(write!(linker_script, "INPUT({})\n", link.display()));
// We also want the linker script to have the same mtime as the source, otherwise it
// can trigger rebuilds.
let meta = t!(fs::metadata(source));
if let Ok(mtime) = meta.modified() {
t!(linker_script.set_modified(mtime));
}
} }
} else { } else {
builder.install(&source, destination, 0o644); builder.install(&source, destination, 0o644);