summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/dlopen-deps.inc
Commit message (Collapse)AuthorAgeFilesLines
* systemd: handle llvm-objcopy behaviour when reading .note.dlopen sectionRoss Burton2024-11-231-3/+11
| | | | | | | | | | | | | | | | | | | | There are two behavioural differences between the objcopy in binutils and llvm which resulted in build failures when building systemd with clang: 1) If the section specified in --dump-section doesn't exist, binutils set an exit code of 0 whereas llvm sets 1. This means we need to handle the exit code so that we raise exceptions on unexpected failures, but return an empty byte string if the segment isn't found. 2) binutils writes the section to the file name directly, whereas llvm writes to a temporary file and renames. This means we can't read the open fd directly, and instead need to re-open the file to read it. (From OE-Core rev: 98879a8dbd1b7887b43a074193925bf1a55d44e7) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd: extract dependencies from .note.dlopen ELF segmentsRoss Burton2024-11-211-0/+73
First, this is likely not the final implementation, but a RFC and prototype. Some binaries don't dynamically link to libraries, but instead at runtime dlopen() them. This means extra work for distributions as the dependencies are not detected automatically, so libraries may be missing. systemd is one such project which does this, and in an attempt to solve the packaging problem it also embeds the names of the libraries that can potentially be opened at runtime into ELF notes. These can be read to generate package dependencies. For example: packages/cortexa57-poky-linux/systemd/libsystemd-shared: RRECOMMENDS: added "libkmod (['>= 33']) libzstd (['>= 1.5.6'])" packages/cortexa57-poky-linux/systemd/libsystemd: RRECOMMENDS: added "libzstd (['>= 1.5.6'])" I expect this code to be changed before merging. Whilst systemd is the main user of his approach right now, I expect to see it used in more places in the future so there's a reasonably good argument to merge it into the core shlibs code. Also it currently manually extracts and parses the data, whereas maybe we should incorporate pyelftools into meta/lib/oe and use that to parse ELF files across all of OE. This also means we can remove the explicit dependency on libkmod in udev, which now comes in via libsystemd-shared. (From OE-Core rev: 905da779bcfe98f105adac708e0045ce8ffe5636) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>