aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbuild2/cc/link-rule.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx
index db82507..eb44142 100644
--- a/libbuild2/cc/link-rule.cxx
+++ b/libbuild2/cc/link-rule.cxx
@@ -2509,12 +2509,19 @@ namespace build2
// appear after the preceding static library of which this binless
// library is a dependency.
//
+ // Note that we omit the duplicate suppression if we are linking the
+ // whole archive since the previous instance may not necessarily do
+ // the same (see GH issue #411; we could have complicated things and
+ // stored the flag in appended_libraries but it doesn't feel
+ // worthwhile in this case).
+ //
// From the process_libraries() semantics we know that this callback
// is always called and always after the options callbacks.
//
- appended_library* al (l != nullptr
- ? &d.ls.append (*l, d.args.size ())
- : d.ls.append (ns, d.args.size ()));
+ appended_library* al (
+ f & lflag_whole ? nullptr :
+ l != nullptr ? &d.ls.append (*l, d.args.size ()) :
+ d.ls.append (ns, d.args.size ()));
if (al != nullptr && al->end != appended_library::npos) // Closed.
{