diff options
author | 2020-04-05 16:21:42 +0200 | |
---|---|---|
committer | 2020-04-08 16:32:06 +0200 | |
commit | b9ae276e6e46e53673af2c6aa12e0289ecd98805 (patch) | |
tree | 3a28dfac3f897dbcb15cb0e629f5ea4c9d16eced | |
parent | d6ae7fa22d87ffe3f2d71b4b8197698f27453886 (diff) | |
download | buildroot-b9ae276e6e46e53673af2c6aa12e0289ecd98805.tar.gz buildroot-b9ae276e6e46e53673af2c6aa12e0289ecd98805.tar.bz2 |
package/pkg-generic.mk: also replace /lib by STAGING_DIR/lib in .la files
After the staging installation, we replace a number of paths in libtool
.la files so that those paths point to STAGING_DIR instead of a location
in the build machine.
However, we replace only paths that start with /usr. And it turns out
that the linux-pam package is configured with --libdir=/lib (linux-pam
seems to always be installed in /lib rather than /usr/lib).
Due to this, libpam.la contains the following line:
libdir='/lib'
When building a configuration that has:
- BR2_ROOTFS_MERGED_USR=y
- BR2_PACKAGE_LINUX_PAM=y
- BR2_PACKAGE_POLKIT=y
on a system that has its system-wide PAM library installed in /lib,
the build fails with:
/lib/libpam.so: file not recognized: File format not recognized
For some reason, libtool searches only in STAGING_DIR/usr/lib, but
when BR2_ROOTFS_MERGED_USR=y, STAGING_DIR/lib points to
STAGING_DIR/usr/lib, so libtool finds libpam.la. And this libpam.la
contains a bogus libdir='/lib' path. libtool then goes on, finds
/lib/libpam.so, and links with it, causing the build failure.
By doing the proper replacement of libdir='/lib', we have a correct
libpam.la, and solve the build issue.
There is no autobuilder failure associated to this issue, as it
requires /lib/libpam.so to exist. This is the case on ArchLinux, on
which Xogium reported the issue, which can also be reproduced in an
ArchLinux container.
Reported-by: Xogium <contact@xogium.me>
Cc: Xogium <contact@xogium.me>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Tested-by: Yann E. MORIN <yann.morin.1998@free.fr>
[yann.morin.1998@free.fr:
- tested by manually creating a symlink to libpam.so in /lib
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
(cherry picked from commit 7ae7c82dd617cb76dd9f4e43b32eea151528d818)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r-- | package/pkg-generic.mk | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index a5ed64e5f0..e31585779d 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -315,6 +315,7 @@ $(BUILD_DIR)/%/.stamp_staging_installed: $(if $(TOOLCHAIN_EXTERNAL_INSTALL_DIR),\ -e "s:$(TOOLCHAIN_EXTERNAL_INSTALL_DIR):@TOOLCHAIN_EXTERNAL_INSTALL_DIR@:g") \ -e "s:\(['= ]\)/usr:\\1@STAGING_DIR@/usr:g" \ + -e "s:\(['= ]\)/lib:\\1@STAGING_DIR@/lib:g" \ $(if $(TOOLCHAIN_EXTERNAL_INSTALL_DIR),\ -e "s:@TOOLCHAIN_EXTERNAL_INSTALL_DIR@:$(TOOLCHAIN_EXTERNAL_INSTALL_DIR):g") \ -e "s:@STAGING_DIR@:$(STAGING_DIR):g" \ |