From afddfa8176cf8969055c6319504069b250723d3d Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 25 Jan 2021 03:28:08 -0600 Subject: [PATCH 1/3] Make dyld search work with SYSTEM_VERSION_COMPAT=1 In macOS Big Sur, if the executable was compiled with `MACOSX_DEPLOYMENT_TARGET=10.15` or below, then SYSTEM_VERSION_COMPAT=1 is the default which means that Big Sur reports itself as 10.16 which means that `__builtin_available(macOS 11.0)` will not be triggered. This can be observed by using the python 3.9.1 universal2 installer and using it on x86_64 Big Sur or with Rossetta 2 on arm64 Big Sur. (Not an issue with native arm64 as that part is compiled with `MACOSX_DEPLOYMENT_TARGET=11.0`) --- Modules/_ctypes/callproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index 56ccc2f1e0b5da8..2a75f62421c44cd 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -1449,7 +1449,7 @@ static PyObject *py_dyld_shared_cache_contains_path(PyObject *self, PyObject *ar PyObject *name, *name2; char *name_str; - if (__builtin_available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *)) { + if (__builtin_available(macOS 10.16, iOS 14.0, tvOS 14.0, watchOS 7.0, *)) { int r; if (!PyArg_ParseTuple(args, "O", &name)) From 519a9dcfa23a123f295c55e0ba7d0782c843322b Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Thu, 28 Jan 2021 06:44:47 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Misc/NEWS.d/next/macOS/2021-01-28-06-44-47.bpo-43052.NoLlgY.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/macOS/2021-01-28-06-44-47.bpo-43052.NoLlgY.rst diff --git a/Misc/NEWS.d/next/macOS/2021-01-28-06-44-47.bpo-43052.NoLlgY.rst b/Misc/NEWS.d/next/macOS/2021-01-28-06-44-47.bpo-43052.NoLlgY.rst new file mode 100644 index 000000000000000..e33b5fd06f45332 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2021-01-28-06-44-47.bpo-43052.NoLlgY.rst @@ -0,0 +1 @@ +`_dyld_shared_cache_contains_path` now works with SYSTEM_VERSION_COMPAT=1 \ No newline at end of file From ef584874aef2ec37180f059f6b04e11648d4c351 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 28 Jan 2021 10:25:58 -0600 Subject: [PATCH 3/3] fix HAVE_PWRITEV_RUNTIME too --- Modules/posixmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 4468fd08e17a53d..8edd4726d9b11d3 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -82,7 +82,7 @@ # define HAVE_SYMLINKAT_RUNTIME __builtin_available(macOS 10.10, iOS 8.0, *) # define HAVE_FUTIMENS_RUNTIME __builtin_available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) # define HAVE_UTIMENSAT_RUNTIME __builtin_available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) -# define HAVE_PWRITEV_RUNTIME __builtin_available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *) +# define HAVE_PWRITEV_RUNTIME __builtin_available(macOS 10.16, tvOS 14.0, watchOS 7.0, *) # define HAVE_POSIX_SPAWN_SETSID_RUNTIME __builtin_available(macOS 10.15, *)