Skip to content

Commit

Permalink
record mtime in llvm linker script
Browse files Browse the repository at this point in the history
This will avoid rebuilds due to the script being more recent than the
rest of the original files.
  • Loading branch information
lqd committed Mar 7, 2024
1 parent b91ceb8 commit 1c3fe15
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2048,6 +2048,13 @@ fn install_llvm_file(
let link = t!(fs::read_link(source));
let mut linker_script = t!(fs::File::create(full_dest));
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 {
builder.install(&source, destination, 0o644);
Expand Down

0 comments on commit 1c3fe15

Please sign in to comment.