mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-71052: Add Android build script and instructions (#116426)
This commit is contained in:
parent
50f9b0b1e0
commit
3ec57307e7
7 changed files with 401 additions and 17 deletions
33
configure.ac
33
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"
|
||||
blocked_funcs="chroot initgroups setegid seteuid setgid sethostname
|
||||
setregid setresgid setresuid setreuid setuid"
|
||||
|
||||
# These functions are unimplemented and always return an error.
|
||||
unimplemented_funcs="sem_open sem_unlink"
|
||||
# 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"
|
||||
|
||||
for name in $privileged_funcs $unimplemented_funcs; do
|
||||
# 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 $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], [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue