diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-04-20 11:19:28 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-04-20 11:26:05 +0200 |
commit | 0353b231d51ab7ea5ead98ac838e7c2ba1b0df89 (patch) | |
tree | c5b0794512587a1062de97153df6f0b236f928d3 /libbuild2/cc/link-rule.cxx | |
parent | 834152a6e3f3e8459b53e49370bfdd82685a700d (diff) |
Track changes to environment in cc rules
Diffstat (limited to 'libbuild2/cc/link-rule.cxx')
-rw-r--r-- | libbuild2/cc/link-rule.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx index 9c72969..0ab61b1 100644 --- a/libbuild2/cc/link-rule.cxx +++ b/libbuild2/cc/link-rule.cxx @@ -37,7 +37,7 @@ namespace build2 link_rule:: link_rule (data&& d) : common (move (d)), - rule_id (string (x) += ".link 2") + rule_id (string (x) += ".link 3") { static_assert (sizeof (match_data) <= target::data_size, "insufficient space"); @@ -2427,10 +2427,13 @@ namespace build2 l4 ([&]{trace << "linker mismatch forcing update of " << t;}); } - // Hash and compare any changes to the environment. + // Then the linker environment checksum (original and our modifications). // - if (dd.expect (env_cs.string ()) != nullptr) - l4 ([&]{trace << "environment mismatch forcing update of " << t;}); + { + bool e (dd.expect (env_checksum) != nullptr); + if (dd.expect (env_cs.string ()) != nullptr || e) + l4 ([&]{trace << "environment mismatch forcing update of " << t;}); + } // Next check the target. While it might be incorporated into the linker // checksum, it also might not (e.g., VC link.exe). |