https://github.com/python/cpython/commit/c788bfb80e0e8b312d31db810de4c090a1059a71
commit: c788bfb80e0e8b312d31db810de4c090a1059a71
branch: main
author: Jeffrey Bosboom <[email protected]>
committer: vstinner <[email protected]>
date: 2025-10-21T17:54:00+02:00
summary:

gh-140239: Check for statx on Android (#140395)

Android has Linux's statx, but MACHDEP is "android" on Android, so
configure doesn't check for statx on Android.  Base the check for statx
on ac_sys_system instead, which is "Linux-android" on Android, "Linux"
on other Linux distributions, and "AIX" on AIX (which has an
incompatible function named statx).

files:
M Misc/NEWS.d/next/Build/2025-10-17-11-33-45.gh-issue-140239._k-GgW.rst
M configure
M configure.ac

diff --git 
a/Misc/NEWS.d/next/Build/2025-10-17-11-33-45.gh-issue-140239._k-GgW.rst 
b/Misc/NEWS.d/next/Build/2025-10-17-11-33-45.gh-issue-140239._k-GgW.rst
index f196ab0964d2c5..713f022c994958 100644
--- a/Misc/NEWS.d/next/Build/2025-10-17-11-33-45.gh-issue-140239._k-GgW.rst
+++ b/Misc/NEWS.d/next/Build/2025-10-17-11-33-45.gh-issue-140239._k-GgW.rst
@@ -1 +1 @@
-Check ``statx`` availability only in Linux platforms
+Check ``statx`` availability only on Linux (including Android).
diff --git a/configure b/configure
index 95e231f406a9a3..f95355e2f57d69 100755
--- a/configure
+++ b/configure
@@ -20392,16 +20392,21 @@ then :
 fi
 
 
-# Check statx availability in Linux
-if test "$MACHDEP" = "linux"; then
-  ac_fn_c_check_func "$LINENO" "statx" "ac_cv_func_statx"
+# os.statx uses Linux's statx function.  AIX also has a function named statx,
+# but it's unrelated.  Check only on Linux (including Android).
+case $ac_sys_system in #(
+  Linux*) :
+    ac_fn_c_check_func "$LINENO" "statx" "ac_cv_func_statx"
 if test "x$ac_cv_func_statx" = xyes
 then :
   printf "%s\n" "#define HAVE_STATX 1" >>confdefs.h
 
 fi
 
-fi
+ ;; #(
+  *) :
+     ;;
+esac
 
 # Force lchmod off for Linux. Linux disallows changing the mode of symbolic
 # links. Some libc implementations have a stub lchmod implementation that 
always
diff --git a/configure.ac b/configure.ac
index 65c37579633754..4d0e5a1ca1d003 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5258,10 +5258,11 @@ AC_CHECK_FUNCS([ \
   wait wait3 wait4 waitid waitpid wcscoll wcsftime wcsxfrm wmemcmp writev \
 ])
 
-# Check statx availability in Linux
-if test "$MACHDEP" = "linux"; then
-  AC_CHECK_FUNCS([statx])
-fi
+# os.statx uses Linux's statx function.  AIX also has a function named statx,
+# but it's unrelated.  Check only on Linux (including Android).
+AS_CASE([$ac_sys_system],
+  [Linux*], [AC_CHECK_FUNCS([statx])]
+)
 
 # Force lchmod off for Linux. Linux disallows changing the mode of symbolic
 # links. Some libc implementations have a stub lchmod implementation that 
always

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to