Skip to content

Commit

Permalink
libpkg: add options to ignore required shlibs
Browse files Browse the repository at this point in the history
Since libpkg no longer does any automatic filtering of DT_NEEDED entries
while generating the shlibs_required list, it will be necessary to
manually filter required shared libraries in some cases.

Sponsored by:	The FreeBSD Foundation
  • Loading branch information
ifreund authored and bapt committed Dec 11, 2024
1 parent 6462d8a commit 16937e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libpkg/pkg.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,13 @@ pkg_addshlib_required(struct pkg *pkg, const char *name)
assert(pkg != NULL);
assert(name != NULL && name[0] != '\0');

if (match_ucl_lists(name,
pkg_config_get("SHLIB_REQUIRE_IGNORE_GLOB"),
pkg_config_get("SHLIB_REQUIRE_IGNORE_REGEX"))) {
dbg(3, "ignoring shlib %s required by package %s", name, pkg->name);
return (EPKG_OK);
}

/* silently ignore duplicates in case of shlibs */
tll_foreach(pkg->shlibs_required, s) {
if (STREQ(s->item, name))
Expand Down
10 changes: 10 additions & 0 deletions libpkg/pkg_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,16 @@ static struct config_entry c[] = {
"FILES_IGNORE_REGEX",
NULL,
},
{
PKG_ARRAY,
"SHLIB_REQUIRE_IGNORE_GLOB",
NULL,
},
{
PKG_ARRAY,
"SHLIB_REQUIRE_IGNORE_REGEX",
NULL,
},
{
PKG_ARRAY,
"PKG_DEBUG_FLAGS",
Expand Down

0 comments on commit 16937e4

Please sign in to comment.