aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2021-02-16 21:10:24 -0800
committerDan Willemsen <dwillemsen@google.com>2021-02-16 21:24:19 -0800
commitd948d44e8858597a19cae32f1d4443dd60a826eb (patch)
tree80215366c89f20b888129df59f717d54b43ad133
parent40a931e3d4a7c650568675604446734181ae0fc1 (diff)
downloadcpython3-d948d44e8858597a19cae32f1d4443dd60a826eb.tar.gz
Disable getentropy on Mac to support 10.10android-s-preview-1
According to the headers, getentropy became available in MacOSX 10.12 We still have some builders on Mac 10.10 that are downstream consumers of this python executable. I don't expect them to live for that much longer, but in the meantime, disable the getentropy call that's causing them problems. Bug: 180443630 Test: run built py3-cmd binary on a 10.10 machine Change-Id: I0145301d12e497df08bb94a1ffa679efa2d8e6fd
-rw-r--r--android/darwin_x86_64/pyconfig/pyconfig.h2
-rwxr-xr-xandroid/regen.sh2
2 files changed, 3 insertions, 1 deletions
diff --git a/android/darwin_x86_64/pyconfig/pyconfig.h b/android/darwin_x86_64/pyconfig/pyconfig.h
index 30b9b466c4..4deb9a07b5 100644
--- a/android/darwin_x86_64/pyconfig/pyconfig.h
+++ b/android/darwin_x86_64/pyconfig/pyconfig.h
@@ -425,7 +425,7 @@
#define HAVE_GETC_UNLOCKED 1
/* Define to 1 if you have the `getentropy' function. */
-#define HAVE_GETENTROPY 1
+/* #undef HAVE_GETENTROPY */
/* Define to 1 if you have the `getgrgid_r' function. */
#define HAVE_GETGRGID_R 1
diff --git a/android/regen.sh b/android/regen.sh
index 0145ff1210..1c0e235c33 100755
--- a/android/regen.sh
+++ b/android/regen.sh
@@ -39,6 +39,8 @@ cd tmp
../../../configure
if [ $DIR == "darwin_x86_64" ]; then
+ # getentropy is not safe on <10.12, which we still target
+ sed -ibak "s%#define HAVE_GETENTROPY 1%/* #undef HAVE_GETENTROPY */%" pyconfig.h
# utimensat and futimens are not safe on <10.13, which we still target
sed -ibak "s%#define HAVE_UTIMENSAT 1%/* #undef HAVE_UTIMENSAT */%" pyconfig.h
sed -ibak "s%#define HAVE_FUTIMENS 1%/* #undef HAVE_FUTIMENS */%" pyconfig.h