summaryrefslogtreecommitdiffstats
path: root/meta/classes/package.bbclass
diff options
context:
space:
mode:
authorMike Crowe <mac@mcrowe.com>2021-12-07 15:27:35 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-12-12 11:27:23 +0000
commit9546d1935af6b866973ea1a1ea2847f4e318c6ad (patch)
treec5c85e10f5d054c761d58c7e2da43d5335ec7239 /meta/classes/package.bbclass
parent1426525375cd5a1568598cc1634b14664bcc0750 (diff)
downloadpoky-9546d1935af6b866973ea1a1ea2847f4e318c6ad.tar.gz
package: Only snap libraries if they would be processed by ldconfig OS-12840
PACKAGE_SNAP_LIB_SYMLINKS renames libraries based on their SONAME so that they can be found directly rather than going via symlinks that would be created by ldconfig. For example, without PACKAGE_SNAP_LIB_SYMLINKS in ${libdir} we have: libharfbuzz.so.0 -> libharfbuzz.so.0.20600.4 libharfbuzz.so.0.20600.4 but with PACKAGE_SNAP_LIB_SYMLINKS="1" we have just: libharfbuzz.so.0 Unfortunately, this renaming is done based on the SONAME which breaks packages like mesa which install a single library with multiple hard links: -rwxr-xr-x root/root 13593488 2021-12-07 12:26 ./usr/lib/dri/i915_dri.so -rwxr-xr-x root/root 13137328 2021-12-07 12:26 ./usr/lib/dri/i965_dri.so hrwxr-xr-x root/root 0 2021-12-07 12:26 ./usr/lib/dri/iris_dri.so link to ./usr/lib/dri/i915_dri.so hrwxr-xr-x root/root 0 2021-12-07 12:26 ./usr/lib/dri/kms_swrast_dri.so link to ./usr/lib/dri/i915_dri.so hrwxr-xr-x root/root 0 2021-12-07 12:26 ./usr/lib/dri/nouveau_vieux_dri.so link to ./usr/lib/dri/i965_dri.so hrwxr-xr-x root/root 0 2021-12-07 12:26 ./usr/lib/dri/r200_dri.so link to ./usr/lib/dri/i965_dri.so hrwxr-xr-x root/root 0 2021-12-07 12:26 ./usr/lib/dri/radeon_dri.so link to ./usr/lib/dri/i965_dri.so hrwxr-xr-x root/root 0 2021-12-07 12:26 ./usr/lib/dri/swrast_dri.so link to ./usr/lib/dri/i915_dri.so The SONAME for i915_dri.so (and therefore all the other names that link to the same file) is libgallium_dri.so. This means that PACKAGE_SNAP_LIB_SYMLINKS causes do_package to successfully rename the first name found to libgallium_dri.so. A similar thing happens to i965_dri.so with its SONAME of libmesa_dri_drivers.so. The order is not deterministic, so this means that although every build will be missing one name, it's not always the same one. -rwxr-xr-x root/root 13593488 2021-11-30 15:17 ./usr/lib/dri/i915_dri.so hrwxr-xr-x root/root 0 2021-11-30 15:17 ./usr/lib/dri/kms_swrast_dri.so link to ./usr/lib/dri/i915_dri.so hrwxr-xr-x root/root 0 2021-11-30 15:17 ./usr/lib/dri/libgallium_dri.so link to ./usr/lib/dri/i915_dri.so -rwxr-xr-x root/root 13137328 2021-11-30 15:17 ./usr/lib/dri/libmesa_dri_drivers.so hrwxr-xr-x root/root 0 2021-11-30 15:17 ./usr/lib/dri/nouveau_vieux_dri.so link to ./usr/lib/dri/libmesa_dri_drivers.so hrwxr-xr-x root/root 0 2021-11-30 15:17 ./usr/lib/dri/r200_dri.so link to ./usr/lib/dri/libmesa_dri_drivers.so hrwxr-xr-x root/root 0 2021-11-30 15:17 ./usr/lib/dri/radeon_dri.so link to ./usr/lib/dri/libmesa_dri_drivers.so hrwxr-xr-x root/root 0 2021-11-30 15:17 ./usr/lib/dri/swrast_dri.so link to ./usr/lib/dri/i915_dri.so This renaming means that the library cannot be found at runtime. The simplest way to avoid this renaming is to only snap libraries that would be processed by ldconfig. (From OE-Core rev: 8571182ece1602ce8e030c98aef17cdc5718a037) Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Phil Blundell <pb@pbcl.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r--meta/classes/package.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 84eafbd529..09cd376f4a 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1878,7 +1878,7 @@ python package_do_shlibs() {
1878 sonames.add(prov) 1878 sonames.add(prov)
1879 if libdir_re.match(os.path.dirname(file)): 1879 if libdir_re.match(os.path.dirname(file)):
1880 needs_ldconfig = True 1880 needs_ldconfig = True
1881 if snap_symlinks and (os.path.basename(file) != this_soname): 1881 if needs_ldconfig and snap_symlinks and (os.path.basename(file) != this_soname):
1882 renames.append((file, os.path.join(os.path.dirname(file), this_soname))) 1882 renames.append((file, os.path.join(os.path.dirname(file), this_soname)))
1883 return (needs_ldconfig, needed, sonames, renames) 1883 return (needs_ldconfig, needed, sonames, renames)
1884 1884