wafsamba: Do not remove BUILTINS as duplicates
authorAndreas Schneider <asn@samba.org>
Mon, 17 Dec 2018 20:40:55 +0000 (21:40 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 20 Dec 2018 11:16:39 +0000 (12:16 +0100)
BUILTINS add object files to the target, so we can't remove them as
duplicates.

The issue e.g happens when tevent wants to link libreplace:

   20:04:10 deps removing dups from tevent of type LIBRARY: {'replace'}
   also in LIBRARY talloc

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/samba_deps.py

index d6b7c0f88d6bd9262af3cc8b08265175f86e5d9c..f8c38809bd2296288374cd66788cdd8fdb2c7538 100644 (file)
@@ -719,6 +719,11 @@ def reduce_objects(bld, tgt_list):
                 if t.sname in rely_on:
                     dup = dup.difference(rely_on[t.sname])
                 if dup:
+                    # Do not remove duplicates of BUILTINS
+                    d = next(iter(dup))
+                    if BUILTIN_LIBRARY(bld, d):
+                        continue
+
                     debug('deps: removing dups from %s of type %s: %s also in %s %s',
                           t.sname, t.samba_type, dup, t2.samba_type, l)
                     new = new.difference(dup)