Last active
April 26, 2017 13:27
-
-
Save jperkin/b292bf9049c3f9d91f61aff6b8121706 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: mk/check/check-shlibs-elf.awk | |
=================================================================== | |
RCS file: /cvsroot/pkgsrc/mk/check/check-shlibs-elf.awk,v | |
retrieving revision 1.14 | |
diff -u -r1.14 check-shlibs-elf.awk | |
--- mk/check/check-shlibs-elf.awk 26 Apr 2017 11:19:16 -0000 1.14 | |
+++ mk/check/check-shlibs-elf.awk 26 Apr 2017 13:24:21 -0000 | |
@@ -121,13 +121,14 @@ | |
if (!got_rpath) | |
nrpath = split(system_rpath, rpath, ":") | |
close(cmd) | |
- nedirs = split(extradirs, edirs, " ") | |
for (p in rpath) { | |
if (rpath[p] == wrkdir || | |
substr(rpath[p], 1, length(wrkdir) + 1) == wrkdir "/") { | |
print DSO ": rpath relative to WRKDIR" | |
} | |
} | |
+ nblist = split(blacklist, blist, " ") | |
+ nedirs = split(extradirs, edirs, " ") | |
for (lib in needed) { | |
found = 0 | |
for (p = 1; p <= nrpath; p++) { | |
@@ -137,6 +138,11 @@ | |
} | |
if (!libcache[libfile]) { | |
check_pkg(rpath[p] "/" lib) | |
+ for (b = 1; b <= nblist; b++) { | |
+ if (match(rpath[p] "/" lib, blist[b])) { | |
+ print DSO ": resolved path " rpath[p] "/" lib " matches blacklist " blist[b] | |
+ } | |
+ } | |
for (e = 1; e <= nedirs; e++) { | |
if (rpath[p] == edirs[e] || | |
substr(rpath[p], 1, length(edirs[e]) + 1) == edirs[e] "/") { | |
@@ -169,6 +175,7 @@ | |
readelf = ENVIRON["READELF"] | |
wrkdir = ENVIRON["WRKDIR"] | |
extradirs = ENVIRON["CHECK_WRKREF_EXTRA_DIRS"] | |
+ blacklist = ENVIRON["CHECK_SHLIBS_BLACKLIST"] | |
pkg_info_cmd = ENVIRON["PKG_INFO_CMD"] | |
depends_file = ENVIRON["DEPENDS_FILE"] | |
if (readelf == "") | |
Index: mk/check/check-shlibs.mk | |
=================================================================== | |
RCS file: /cvsroot/pkgsrc/mk/check/check-shlibs.mk,v | |
retrieving revision 1.29 | |
diff -u -r1.29 check-shlibs.mk | |
--- mk/check/check-shlibs.mk 10 Apr 2016 15:58:02 -0000 1.29 | |
+++ mk/check/check-shlibs.mk 26 Apr 2017 13:24:21 -0000 | |
@@ -10,6 +10,14 @@ | |
# | |
# Default value: "yes" for PKG_DEVELOPERs, "no" otherwise. | |
# | |
+# CHECK_SHLIBS_BLACKLIST | |
+# A list of regular expressions that will cause the test to fail | |
+# if they are matched in the resolved runpath. For example, set | |
+# to ^/usr/lib/lib(crypto|ssl) will ensure that OpenSSL is not | |
+# accidentally picked up from the OS. | |
+# | |
+# Default value: empty. | |
+# | |
# Package-settable variables: | |
# | |
# CHECK_SHLIBS_SKIP | |
@@ -68,6 +76,9 @@ | |
. if defined(CHECK_WRKREF) && !empty(CHECK_WRKREF:Mextra) | |
CHECK_SHLIBS_NATIVE_ENV+= CHECK_WRKREF_EXTRA_DIRS=${CHECK_WRKREF_EXTRA_DIRS:Q} | |
. endif | |
+. if defined(CHECK_SHLIBS_BLACKLIST) | |
+CHECK_SHLIBS_NATIVE_ENV+= CHECK_SHLIBS_BLACKLIST=${CHECK_SHLIBS_BLACKLIST:Q} | |
+. endif | |
_check-shlibs: error-check .PHONY | |
@${STEP_MSG} "Checking for missing run-time search paths in ${PKGNAME}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment