diff --git a/libpkg/pkg_config.c b/libpkg/pkg_config.c index 54061b5..ccca357 100644 --- a/libpkg/pkg_config.c +++ b/libpkg/pkg_config.c @@ -390,6 +390,12 @@ static struct config_entry c[] = { "VALID_URL_SCHEME", "pkg+http,pkg+https,https,http,ftp,file,ssh", }, + { + PKG_BOOL, + "ALLOW_BASE_SHLIBS", + "NO", + "Enable base libraries analysis", + }, }; static bool parsed = false; diff --git a/libpkg/pkg_elf.c b/libpkg/pkg_elf.c index 945ebe0..8327c32 100644 --- a/libpkg/pkg_elf.c +++ b/libpkg/pkg_elf.c @@ -92,10 +92,16 @@ filter_system_shlibs(const char *name, char *path, size_t pathlen) return (EPKG_FATAL); } - /* match /lib, /lib32, /usr/lib and /usr/lib32 */ - if (strncmp(shlib_path, "/lib", 4) == 0 || - strncmp(shlib_path, "/usr/lib", 8) == 0) - return (EPKG_END); /* ignore libs from base */ + if (pkg_object_bool(pkg_config_get("ALLOW_BASE_SHLIBS"))) { + if (strncmp(shlib_path, "/usr/lib32", 10) == 0) { + return (EPKG_END); + } + } else { + /* match /lib, /lib32, /usr/lib and /usr/lib32 */ + if (strncmp(shlib_path, "/lib", 4) == 0 || + strncmp(shlib_path, "/usr/lib", 8) == 0) + return (EPKG_END); /* ignore libs from base */ + } if (path != NULL) strncpy(path, shlib_path, pathlen);