summaryrefslogtreecommitdiff
path: root/mk/check
diff options
context:
space:
mode:
authorjperkin <jperkin@pkgsrc.org>2020-10-09 16:00:16 +0000
committerjperkin <jperkin@pkgsrc.org>2020-10-09 16:00:16 +0000
commit813ca3f29d3cfd38bbfaab53d33d6047d40f31fc (patch)
tree732435334056d016c8dc29a43d6f5fb73662aa49 /mk/check
parente0aeccc1444a3c2e58134e0216d3b7ead5afc215 (diff)
downloadpkgsrc-813ca3f29d3cfd38bbfaab53d33d6047d40f31fc.tar.gz
mk: Handle missing system libraries on Big Sur.
The new release of macOS removes system libraries from the file system, only providing access to them via a linker cache and dlopen(). This obviously breaks many assumptions about how libraries work on Unix systems, and so we unfortunately need to cripple various checks when running on those systems. Introduce DARWIN_NO_SYSTEM_LIBS which, when defined, will trigger alternate behaviour in the infrastructure. Currently this is in two places: * In CHECK_SHLIBS, skip any path beginning with /usr/lib. * In registered package metadata, any path beginning with /usr/lib is removed from REQUIRES. The former fixes all package builds, while the second will be necessary for package managers such as pkgin, as they will no longer be able to verify that those files are available on the target system. This is obviously a gross hack, and removes our ability to ensure that the target system is suitable for the packages we are attempting to install, but Apple have left us with no alternative, and users will unfortunately be left to find out at runtime instead. It's likely this will need to be extended to /System/Library paths too, but this is required first to actually get packages building before we can start running bulk builds.
Diffstat (limited to 'mk/check')
-rw-r--r--mk/check/check-shlibs-macho.awk5
-rw-r--r--mk/check/check-shlibs.mk5
2 files changed, 8 insertions, 2 deletions
diff --git a/mk/check/check-shlibs-macho.awk b/mk/check/check-shlibs-macho.awk
index 51b750b6e6e..2237242e70d 100644
--- a/mk/check/check-shlibs-macho.awk
+++ b/mk/check/check-shlibs-macho.awk
@@ -1,4 +1,4 @@
-# $NetBSD: check-shlibs-macho.awk,v 1.7 2018/06/07 07:00:10 dbj Exp $
+# $NetBSD: check-shlibs-macho.awk,v 1.8 2020/10/09 16:00:16 jperkin Exp $
#
# Read a list of potential Mach-O binaries from stdin.
@@ -73,6 +73,8 @@ function checkshlib(DSO, needed, found) {
while ((cmd | getline) > 0) {
if ($0 !~ /^\t/)
continue
+ if (skip_system_libs && $0 ~ /^\t\/usr\/lib/)
+ continue
needed[$1] = ""
}
close(cmd)
@@ -119,6 +121,7 @@ BEGIN {
wrkdir = ENVIRON["WRKDIR"]
pkg_info_cmd = ENVIRON["PKG_INFO_CMD"]
depends_file = ENVIRON["DEPENDS_FILE"]
+ skip_system_libs = ENVIRON["SKIP_SYSTEM_LIBS"]
}
{ checkshlib($0); }
diff --git a/mk/check/check-shlibs.mk b/mk/check/check-shlibs.mk
index 229cc13b772..90978cdf8b8 100644
--- a/mk/check/check-shlibs.mk
+++ b/mk/check/check-shlibs.mk
@@ -1,4 +1,4 @@
-# $NetBSD: check-shlibs.mk,v 1.32 2020/03/23 09:24:35 jperkin Exp $
+# $NetBSD: check-shlibs.mk,v 1.33 2020/10/09 16:00:16 jperkin Exp $
#
# This file verifies that all libraries used by the package can be found
# at run-time.
@@ -64,6 +64,9 @@ CHECK_SHLIBS_NATIVE_ENV+= PLATFORM_RPATH=${_OPSYS_SYSTEM_RPATH:Q}
CHECK_SHLIBS_NATIVE_ENV+= READELF=${TOOLS_PATH.readelf:Q}
. elif ${OBJECT_FMT} == "Mach-O"
CHECK_SHLIBS_NATIVE= ${PKGSRCDIR}/mk/check/check-shlibs-macho.awk
+. if defined(DARWIN_NO_SYSTEM_LIBS)
+CHECK_SHLIBS_NATIVE_ENV+= SKIP_SYSTEM_LIBS=1
+. endif
. endif
CHECK_SHLIBS_NATIVE_ENV+= CROSS_DESTDIR=${_CROSS_DESTDIR:Q}
CHECK_SHLIBS_NATIVE_ENV+= PKG_INFO_CMD=${PKG_INFO:Q}