From 903eeb2c681f2008602bf48265ec628e4fdc9225 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 21 Mar 2018 10:38:22 +0200 Subject: Strip out_root when hashing linker input paths This allows moving out_root of simple projects (no rpath, -I$out_root, or similar) without causing a re-link which we use for testing. --- build2/cc/link-rule.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'build2/cc/link-rule.cxx') diff --git a/build2/cc/link-rule.cxx b/build2/cc/link-rule.cxx index 04e2e7d..4379362 100644 --- a/build2/cc/link-rule.cxx +++ b/build2/cc/link-rule.cxx @@ -1034,10 +1034,11 @@ namespace build2 struct data { - sha256& cs; - bool& update; - timestamp mt; - } d {cs, update, mt}; + sha256& cs; + const dir_path& out_root; + bool& update; + timestamp mt; + } d {cs, bs.root_scope ()->out_path (), update, mt}; auto lib = [&d, this] (const file* l, const string& p, lflags f, bool) { @@ -1055,7 +1056,7 @@ namespace build2 l = &l->member->as (); d.cs.append (f); - d.cs.append (l->path ().string ()); + hash_path (d.cs, l->path (), d.out_root); } else d.cs.append (p); @@ -1593,7 +1594,7 @@ namespace build2 f = nullptr; // Timestamp checked by hash_libraries(). } else - cs.append (f->path ().string ()); + hash_path (cs, f->path (), rs.out_path ()); } else f = pt->is_a (); // Consider executable mtime (e.g., linker). @@ -1607,7 +1608,7 @@ namespace build2 // Treat it as input for both MinGW and VC (mtime checked above). // if (!manifest.empty ()) - cs.append (manifest.string ()); + hash_path (cs, manifest, rs.out_path ()); // Treat .libs as inputs, not options. // -- cgit v1.1