From ebd7afc12d9a3852c48b9468b050c6c7313e4b7f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 5 Jun 2024 06:04:53 +0200 Subject: Include top-level libraries in -rpath duplicate suppression logic --- libbuild2/cc/link-rule.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx index 08a60b9..9b0fbfd 100644 --- a/libbuild2/cc/link-rule.cxx +++ b/libbuild2/cc/link-rule.cxx @@ -2660,7 +2660,9 @@ namespace build2 if ((c ? f.compare (p, string::npos, e) : icasecmp (f.c_str () + p, e)) == 0) + { append (f); + } } } @@ -2671,6 +2673,11 @@ namespace build2 { // Top-level shared library dependency. // + // As above, suppress duplicates. + // + if (find (d.ls.begin (), d.ls.end (), &l) != d.ls.end ()) + return; + if (!l.path ().empty ()) // Not binless. { // It is either matched or imported so should be a cc library. -- cgit v1.1