summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorMalcolm Smith <smith@chaquo.com>2024-03-21 23:52:29 (GMT)
committerGitHub <noreply@github.com>2024-03-21 23:52:29 (GMT)
commit3ec57307e70ee6f42410e844d3399bbd598917ba (patch)
tree6a8a4241ab77eb831818110235cd67d6f1263bf1 /configure.ac
parent50f9b0b1e0fb181875751cef951351ed007b6397 (diff)
downloadcpython-3ec57307e70ee6f42410e844d3399bbd598917ba.zip
cpython-3ec57307e70ee6f42410e844d3399bbd598917ba.tar.gz
cpython-3ec57307e70ee6f42410e844d3399bbd598917ba.tar.bz2
gh-71052: Add Android build script and instructions (#116426)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac35
1 files changed, 24 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index cd17977..cdfafc2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4934,13 +4934,21 @@ fi
if test "$ac_sys_system" = "Linux-android"; then
# When these functions are used in an unprivileged process, they crash rather
# than returning an error.
- privileged_funcs="chroot initgroups setegid seteuid setgid setregid setresgid
- setresuid setreuid setuid"
-
- # These functions are unimplemented and always return an error.
- unimplemented_funcs="sem_open sem_unlink"
+ blocked_funcs="chroot initgroups setegid seteuid setgid sethostname
+ setregid setresgid setresuid setreuid setuid"
+
+ # These functions are unimplemented and always return an error
+ # (https://android.googlesource.com/platform/system/sepolicy/+/refs/heads/android13-release/public/domain.te#1044)
+ blocked_funcs="$blocked_funcs sem_open sem_unlink"
+
+ # Before API level 23, when fchmodat is called with the unimplemented flag
+ # AT_SYMLINK_NOFOLLOW, instead of returning ENOTSUP as it should, it actually
+ # follows the symlink.
+ if test "$ANDROID_API_LEVEL" -lt 23; then
+ blocked_funcs="$blocked_funcs fchmodat"
+ fi
- for name in $privileged_funcs $unimplemented_funcs; do
+ for name in $blocked_funcs; do
AS_VAR_PUSHDEF([func_var], [ac_cv_func_$name])
AS_VAR_SET([func_var], [no])
AS_VAR_POPDEF([func_var])
@@ -5303,11 +5311,16 @@ then
])
fi
-AC_CHECK_FUNCS([clock_nanosleep], [], [
- AC_CHECK_LIB([rt], [clock_nanosleep], [
- AC_DEFINE([HAVE_CLOCK_NANOSLEEP], [1])
- ])
-])
+# On Android before API level 23, clock_nanosleep returns the wrong value when
+# interrupted by a signal (https://issuetracker.google.com/issues/216495770).
+if ! { test "$ac_sys_system" = "Linux-android" &&
+ test "$ANDROID_API_LEVEL" -lt 23; }; then
+ AC_CHECK_FUNCS([clock_nanosleep], [], [
+ AC_CHECK_LIB([rt], [clock_nanosleep], [
+ AC_DEFINE([HAVE_CLOCK_NANOSLEEP], [1])
+ ])
+ ])
+fi
AC_CHECK_FUNCS([nanosleep], [], [
AC_CHECK_LIB([rt], [nanosleep], [