]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
dlopen-deps.inc: treat soname list as ordered alternatives
authorDaniel Turull <daniel.turull@ericsson.com>
Fri, 26 Jun 2026 07:38:07 +0000 (09:38 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 30 Jun 2026 07:10:14 +0000 (08:10 +0100)
The .note.dlopen format defines the soname array as a list of
alternatives (e.g. ["libcrypt.so.2", "libcrypt.so.1"]). The previous
code warned for every soname that was not found, even when an earlier
entry in the list already satisfied the dependency.

Select the first available provider and only warn when no alternative
can be resolved.

AI-Generated: Claude-opus-4.6
Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/systemd/dlopen-deps.inc

index e0b333398c283695dc8be3b45e1c4de21aeaed8c..82a2ccd389ca660064a76e42469340671cbcb0f9 100644 (file)
@@ -66,15 +66,18 @@ python package_generate_dlopen_deps() {
                     elf = oe.qa.ELFFile(f)
                     elf.open()
                     for dep in parse(extract_segment(f, ".note.dlopen"), elf.isLittleEndian()):
+                        # soname list contains alternatives; find the first available provider
+                        found = False
                         for soname in dep["soname"]:
                             if soname in shlibs:
-                                # TODO assumes the first match is good
                                 package, version = list(shlibs[soname].values())[0]
                                 dependency = dep_map[dep["priority"]]
                                 bb.note(f"{pkg}: adding {dependency} on {package} via .note.dlopen")
                                 d.appendVar(f"{dependency}:{pkg}", f" {package} (>= {version})")
-                            else:
-                                bb.warn(f"cannot find {soname}")
+                                found = True
+                                break
+                        if not found:
+                            bb.warn(f"cannot find any provider for dlopen dependency: {dep['soname']}")
                 except oe.qa.NotELFFileError as e:
                     bb.note(f"Cannot extract ELF notes: {e}")
                     pass