]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-145616: Detect Android sysconfig ABI correctly on 32-bit ARM Android on 64-bit...
authorRobert Kirkman <31490854+robertkirkman@users.noreply.github.com>
Thu, 26 Mar 2026 12:27:36 +0000 (07:27 -0500)
committerGitHub <noreply@github.com>
Thu, 26 Mar 2026 12:27:36 +0000 (13:27 +0100)
When Python is running on 32-bit ARM Android on a 64-bit ARM kernel, `os.uname().machine` is `armv8l`. Such devices run the same userspace code as `armv7l` devices, so apply the same `armeabi_v7a` Android ABI to them, which works.

Lib/sysconfig/__init__.py
Lib/test/test_sysconfig.py
Misc/NEWS.d/next/Library/2026-03-07-02-44-52.gh-issue-145616.x8Mf23.rst [new file with mode: 0644]

index 6507a7b5b0f695379033c07b0de817064afaa5f0..1418293dcbac0b718d48b22fc58ad7ed27cb0157 100644 (file)
@@ -694,11 +694,15 @@ def get_platform():
         release = get_config_var("ANDROID_API_LEVEL")
 
         # Wheel tags use the ABI names from Android's own tools.
+        # When Python is running on 32-bit ARM Android on a 64-bit ARM kernel,
+        # 'os.uname().machine' is 'armv8l'. Such devices run the same userspace
+        # code as 'armv7l' devices.
         machine = {
             "x86_64": "x86_64",
             "i686": "x86",
             "aarch64": "arm64_v8a",
             "armv7l": "armeabi_v7a",
+            "armv8l": "armeabi_v7a",
         }[machine]
     elif osname == "linux":
         # At least on Linux/Intel, 'machine' is the processor --
index e43f91eb9238f9c8f0dbdec37f9b02f272f999cf..6cd568eb3d0412c5803b93d49b4d9d6e2c7716e9 100644 (file)
@@ -375,6 +375,7 @@ class TestSysConfig(unittest.TestCase, VirtualEnvironmentMixin):
             'i686': 'x86',
             'aarch64': 'arm64_v8a',
             'armv7l': 'armeabi_v7a',
+            'armv8l': 'armeabi_v7a',
         }.items():
             with self.subTest(machine):
                 self._set_uname(('Linux', 'localhost', '3.18.91+',
@@ -583,6 +584,7 @@ class TestSysConfig(unittest.TestCase, VirtualEnvironmentMixin):
             "i686": "i686-linux-android",
             "aarch64": "aarch64-linux-android",
             "armv7l": "arm-linux-androideabi",
+            "armv8l": "arm-linux-androideabi",
         }[machine]
         self.assertEndsWith(suffix, f"-{expected_triplet}.so")
 
diff --git a/Misc/NEWS.d/next/Library/2026-03-07-02-44-52.gh-issue-145616.x8Mf23.rst b/Misc/NEWS.d/next/Library/2026-03-07-02-44-52.gh-issue-145616.x8Mf23.rst
new file mode 100644 (file)
index 0000000..131570a
--- /dev/null
@@ -0,0 +1 @@
+Detect Android sysconfig ABI correctly on 32-bit ARM Android on 64-bit ARM kernel