pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg_install fails when archivers/xz is installed

On 2020-07-28 11:55, Greg Troxel wrote:
Jason Bacon <> writes:

The problem seems to be simply this:

If OS == CentOS7 && /usr/include/lzma.h exists during bootstrap, then
installing archivers/xz will break all pkg_install binaries, because
they try ${PREFIX}/lib/ first even though they were linked
against /usr/lib64/
As I understand it, ELF has a list of needed libraries and a list of
paths, and each library is looked up in the list of paths.  Use objdump
-x to look.  On NetBSD, /opt/pkg/sbin/pkg_add looks like:

Dynamic Section:
   RPATH                /usr/pkg/lib

So I think we need to ensure that pkg_install binaries always use
/usr/lib64/ if that's what it linked against.  In fact, I
wonder if they should ever be looking for anything in ${PREFIX}/lib.
I would expect they need both.  On my netbsd-8 system, they need pkgsrc
openssl, and they need libarchive.

Unfortunately there is no "get this librrary from this place, and this
other library from this other place", as I understand it.

To me, this is a reason to set pkgsrc to never use base system libzma.
Or perhaps, to have all uses of libzma follow the same builtin logic.

Similar on CentOS:

  RPATH                /usr/pkg/lib

Does it actually use pkgsrc openssl or base?  Maybe I'm misinterpreting something, but it seems to me that pkg_install can't depend on any other packages because all packages depend on pkg_install.  It seems to use only builtins and bundled deos:

# grep include Makefile
.include "../../mk/"
.include "../../mk/"
.include "../../archivers/bzip2/"
.include "../../archivers/xz/"
.include "../../archivers/libarchive/"
.include "../../devel/zlib/"
.include "../../security/openssl/"
.include ""
.include "../../mk/"

# ls work/
bzip2  libarchive  libfetch  libnbcompat  netpgp pkg_install-20200701  zlib

On my NetBSD system:

NetBSD netbsddev.acadix  bacon ~ 1003: (pkgsrc): ldd /usr/pkg/sbin/pkg_create
        -lssl.12 => /usr/lib/
        -lcrypto.12 => /usr/lib/
        -lcrypt.1 => /lib/
        -lc.12 => /usr/lib/
        -larchive.4 => /usr/lib/
        -lbz2.1 => /usr/lib/
        -lexpat.2 => /usr/lib/
        -llzma.2 => /usr/lib/
        -lpthread.1 => /usr/lib/
        -lz.1 => /usr/lib/

So I'm not seeing why RPATH is pointing to ${PREFIX}/lib.

Home | Main Index | Thread Index | Old Index