[COFF] don't replace import library if contents are unchanged
authorBob Haarman <llvm@inglorion.net>
Tue, 23 Jan 2018 00:36:42 +0000 (00:36 +0000)
committerBob Haarman <llvm@inglorion.net>
Tue, 23 Jan 2018 00:36:42 +0000 (00:36 +0000)
commit4ce341ffb6744b68732df723ccd46ec300f52acf
treeffaa37650f820c554f31c558fa64e45e8211a169
parent48b32f4cedc1021c774b68ddff1fb9b338c751c0
[COFF] don't replace import library if contents are unchanged

Summary:
This detects when an import library is about to be overwritten with a
newly built one with the same contents, and keeps the old library
instead. The use case for this is to avoid needlessly rebuilding
targets that depend on the import library in build systems that rely
on timestamps to determine whether a target requires rebuilding.

This feature was requested in PR35917.

Reviewers: rnk, ruiu, zturner, pcc

Reviewed By: ruiu

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D42326

llvm-svn: 323164
lld/COFF/Driver.cpp
lld/test/COFF/unchanged-importlib.test [new file with mode: 0644]