Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 1c3fe15

Browse files
committed
record mtime in llvm linker script
This will avoid rebuilds due to the script being more recent than the rest of the original files.
1 parent b91ceb8 commit 1c3fe15

File tree

1 file changed

+7
-0
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+7
-0
lines changed

src/bootstrap/src/core/build_steps/dist.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,6 +2048,13 @@ fn install_llvm_file(
20482048
let link = t!(fs::read_link(source));
20492049
let mut linker_script = t!(fs::File::create(full_dest));
20502050
t!(write!(linker_script, "INPUT({})\n", link.display()));
2051+
2052+
// We also want the linker script to have the same mtime as the source, otherwise it
2053+
// can trigger rebuilds.
2054+
let meta = t!(fs::metadata(source));
2055+
if let Ok(mtime) = meta.modified() {
2056+
t!(linker_script.set_modified(mtime));
2057+
}
20512058
}
20522059
} else {
20532060
builder.install(&source, destination, 0o644);

0 commit comments

Comments
 (0)