Example output for maven-bin-3.6.2 (bug 704618):
* QA Notice: Unresolved soname dependencies:
*
* /usr/share/maven-bin-3.6/lib/jansi-native/freebsd32/libjansi.so:
libc.so.7 libutil.so.9
* /usr/share/maven-bin-3.6/lib/jansi-native/freebsd64/libjansi.so:
libc.so.7 libutil.so.9
*
This warning comes up when a library or executable has one or
more soname dependencies (found in its NEEDED.ELF.2 metadata)
that could not be resolved by usual means. If you run ldd
on files like these then it will report a "not found" error
for each unresolved soname dependency. In order to correct
problems with soname dependency resolution, use one or more
of the approaches described in the following sections.
Content of the NEEDED.ELF.2 metadata file may be useful
for debugging purposes. Find the NEEDED.ELF.2 file in the
${D}/../build-info/ directory after the ebuild src_install
phase completes, or in the /var/db/pkg/*/*/ directory for an
installed package. Each line of the NEEDED.ELF.2 file contains
semicolon separated values for a single ELF file. The soname
dependencies are found in the DT_NEEDED column:
E_MACHINE;path;DT_SONAME;DT_RUNPATH;DT_NEEDED;multilib category
External dependencies
For packages that install pre-built binaries, it may be possible
to resolve soname dependencies simply by adding dependencies
for one or more other packages that are known to provide the
needed sonames.
Removal of unecessary files
For packages that install pre-built binaries, it may be possible
to resolve soname dependencies simply by removing unnecessary
files which have unresolved soname dependencies. For example,
some pre-built binary packages include binaries intended for
irrelevant architectures or operating systems, and these files
can simply be removed because they are unnecessary.
Addition of DT_RUNPATH entries
If the relevant dependencies are installed in a location that
is not included in the dynamic linker search path, then it's
necessary for files to include a DT_RUNPATH entry which refers
to the appropriate directory. The special $ORIGIN value can
be used to create a relative path reference in DT_RUNPATH,
where $ORIGIN is a placeholder for the directory where the
file having the DT_RUNPATH entry is located.
For pre-built binaries, it may be necessary to fix up
DT_RUNPATH using patchelf --set-rpath. For example, use
patchelf --set-rpath '$ORIGIN' if a given binary should link
to libraries found in the same directory as the binary itself,
or use patchelf --set-rpath '$ORIGIN/libs' if a given binary
should link to libraries found in a subdirectory named libs
found in the same directory as the binary itself.
For binaries built from source, a flag like
-Wl,-rpath,/path/of/directory/containing/libs will create
binaries with the desired DT_RUNPATH entry.
Bug: https://bugs.gentoo.org/704320
Signed-off-by: Zac Medico
---
doc/qa.docbook | 74 +++
lib/_emerge/EbuildPhase.py | 63 ++---
lib/portage/dep/soname/SonameAtom.py | 12 ++-
lib/portage/util/_dyn_libs/soname_deps_qa.py | 98
4 files changed, 232 insertions(+), 15 deletions(-)
create mode 100644 lib/portage/util/_dyn_libs/soname_deps_qa.py
diff --git a/doc/qa.docbook b/doc/qa.docbook
index 28ff6cf8e..cf8a3bc8d 100644
--- a/doc/qa.docbook
+++ b/doc/qa.docbook
@@ -127,6 +127,80 @@
+
+ Unresolved soname dependencies
+
+
+QA Notice: Unresolved soname dependencies
+
+
+
+ This warning comes up when a library or executable has one or more
+ soname dependencies (found in its NEEDED.ELF.2 metadata) that could
+ not be resolved by usual means. If you run ldd on
+ files like these then it will report a "not found" error for each
+ unresolved soname dependency. In order to correct problems with
+ soname dependency resolution, use one or more of the approaches
+ described in the following sections.
+
+
+ Content of the NEEDED.ELF.2 metadata file may be useful for
+ debugging purposes. Find the NEEDED.ELF.2 file in the
+ ${D}/../build-info/ directory after the ebuild src_install phase
+ completes, or in the /var/db/pkg/*/*/ directory for an installed
+ package. Each line of the NEEDED.ELF.2 file contains semicolon
+ separated values for a single ELF file. The soname dependencies are
+ found in the DT_NEEDED column:
+
+ E_MACHINE;path;DT_SONAME;DT_RUNPATH;DT_NEEDED;multilib category
+
+
+
+ External dependencies
+
+ For packages that install pre-built binaries, it may be possible to
+ resolve soname dependencies simply by adding dependencies for one
+ or more other packages that are known to provide the needed sonames.
+
+
+
+ Removal of unecessary files
+
+ For packages that install pre-built binaries, it may be possible to
+ resolve soname dependencies simply by removing unnecessary files
+ which have unresolved soname dependencies. For example, some pre-built
+