]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-140239: Check for statx on Android (#140395)
authorJeffrey Bosboom <jbosboom@jeffreybosboom.com>
Tue, 21 Oct 2025 15:54:00 +0000 (08:54 -0700)
committerGitHub <noreply@github.com>
Tue, 21 Oct 2025 15:54:00 +0000 (17:54 +0200)
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).

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

index f196ab0964d2c5048c419cde456a4cff1ba23066..713f022c9949583e009b7a9b7cbd8dde504d8716 100644 (file)
@@ -1 +1 @@
-Check ``statx`` availability only in Linux platforms
+Check ``statx`` availability only on Linux (including Android).
index 95e231f406a9a3efe1f11f1828b3df8e3367f461..f95355e2f57d69b1145f5d1aa492693f26ded3ad 100755 (executable)
--- 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
index 65c375796337543b398e43249af6bb978951c68e..4d0e5a1ca1d00361e6ffb411ae33c90d624c8778 100644 (file)
@@ -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