From 11b477a588efd5369afa29cf65c7fb58377d0649 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 20 Jun 2017 10:18:11 +0200 Subject: Fix bug in bmi{} rule chaining --- build2/cc/link.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'build2') diff --git a/build2/cc/link.cxx b/build2/cc/link.cxx index 6d12c4a..a91fa1e 100644 --- a/build2/cc/link.cxx +++ b/build2/cc/link.cxx @@ -602,7 +602,7 @@ namespace build2 ps.push_back (p.as_prerequisite ()); // Source. // Add our lib*{} (see the export.* machinery for details) and - // bmi*{} (both original and chanined; see module search logic) + // bmi*{} (both original and chained; see module search logic) // prerequisites. // // Note that we don't resolve lib{} to liba{}/libs{} here @@ -634,8 +634,14 @@ namespace build2 // if (pt != nullptr && i != j) // Don't add self (note: both +1). { + // This is sticky: pt might have come before us and if it + // was a group, then we would have picked up a member. So + // here we may have to "unpick" it. + // + bool group (j < i && !p.prerequisite.belongs (t)); + unmark (pt); - ps.emplace_back (prerequisite (*pt)); + ps.emplace_back (prerequisite (group ? *pt->group : *pt)); } } } -- cgit v1.1