https://github.com/python/cpython/commit/70affe0dc74e6679aa20889373d409208abb8b3d
commit: 70affe0dc74e6679aa20889373d409208abb8b3d
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: vstinner <[email protected]>
date: 2026-03-27T20:43:23+01:00
summary:

[3.14] gh-145616: Detect Android sysconfig ABI correctly on 32-bit ARM Android 
on 64-bit ARM kernel (GH-145617) (#146464)

gh-145616: Detect Android sysconfig ABI correctly on 32-bit ARM Android on 
64-bit ARM kernel (GH-145617)

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.
(cherry picked from commit 3a2b81e919103c0be3bc60a47aaa74d34fea6e9e)

Co-authored-by: Robert Kirkman <[email protected]>

files:
A Misc/NEWS.d/next/Library/2026-03-07-02-44-52.gh-issue-145616.x8Mf23.rst
M Lib/sysconfig/__init__.py
M Lib/test/test_sysconfig.py

diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py
index 2ecbff222fe3a5..03c1a0d586d11d 100644
--- a/Lib/sysconfig/__init__.py
+++ b/Lib/sysconfig/__init__.py
@@ -698,11 +698,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 --
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
index 09eff11179ea58..4a6547ebf6de7f 100644
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -379,6 +379,7 @@ def test_get_platform(self):
             'i686': 'x86',
             'aarch64': 'arm64_v8a',
             'armv7l': 'armeabi_v7a',
+            'armv8l': 'armeabi_v7a',
         }.items():
             with self.subTest(machine):
                 self._set_uname(('Linux', 'localhost', '3.18.91+',
@@ -587,6 +588,7 @@ def test_android_ext_suffix(self):
             "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
index 00000000000000..131570a0e03daa
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2026-03-07-02-44-52.gh-issue-145616.x8Mf23.rst
@@ -0,0 +1 @@
+Detect Android sysconfig ABI correctly on 32-bit ARM Android on 64-bit ARM 
kernel

_______________________________________________
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