Skip to content

Commit

Permalink
libpkg: make shlib handling portable
Browse files Browse the repository at this point in the history
All shared objects NEEDED by an ELF file are added to shlibs_required
by pkg-create rather than filtering them based on the host system ELF
hints file and installed libraries.

The ALLOW_BASE_SHLIBS option is deprecated and ignored.

Before running the solver, pkg now scans /lib and /usr/lib (taking
--rootdir into account) and builds a list of system-provided shlibs that
is used as an input to the solver. If pkg detects that it is targeting a
pkgbase system this scan for system shlibs is skipped as the base
packages will provide all necessary shlibs.

The detection of a pkgbase system is implemented by checking if
/usr/bin/uname is tracked in the pkg database.

The main user-facing change is that pkg-create now adds *all* shared
objects listed as NEEDED by an ELF file to shlibs_required. In general
this should not cause issues due to the solver taking the shlibs
provided by the base system into account but there may be exceptions.
An option to filter these entries will be added in the next commit.

References:	freebsd#2331
Sponsored by:	The FreeBSD Foundation
  • Loading branch information
ifreund committed Dec 9, 2024
1 parent cb54627 commit 53a5f92
Show file tree
Hide file tree
Showing 17 changed files with 205 additions and 921 deletions.
3 changes: 2 additions & 1 deletion libpkg/Makefile.autosetup
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ SRCS= backup_lib.c \
pkg_elf.c \
pkg_abi_macho.c \
binfmt_macho.c \
ssh.c elfhints.c \
ssh.c \
system_shlibs.c \
pkg_arch.c \
pkg_cudf.c \
pkg_jobs_universe.c pkg_printf.c \
Expand Down
Loading

0 comments on commit 53a5f92

Please sign in to comment.