summaryrefslogtreecommitdiffstats
path: root/Include/internal
diff options
context:
space:
mode:
authorDiego Russo <diego.russo@arm.com>2024-10-16 13:13:07 (GMT)
committerGitHub <noreply@github.com>2024-10-16 13:13:07 (GMT)
commitfeda9aa73ab95d17a291db22c416146f8e70edeb (patch)
tree3cda4862cb41df69a1d4b192cb6701aa55a178c3 /Include/internal
parent51410d8bdcfe0fd215f94a098dc6cd0919c648a1 (diff)
downloadcpython-feda9aa73ab95d17a291db22c416146f8e70edeb.zip
cpython-feda9aa73ab95d17a291db22c416146f8e70edeb.tar.gz
cpython-feda9aa73ab95d17a291db22c416146f8e70edeb.tar.bz2
gh-125444: Fix illegal instruction for older Arm architectures (#125574)
On Arm v5 it is not possible to get the thread ID via c13 register hence the illegal instruction. The c13 register started to provide thread ID since Arm v6K architecture variant. Other variants of Arm v6 (T2, Z and base) don’t provide the thread ID via c13. For the sake of simplicity we group v5 and v6 together and consider that instructions for Arm v7 only.
Diffstat (limited to 'Include/internal')
-rw-r--r--Include/internal/mimalloc/mimalloc/prim.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Include/internal/mimalloc/mimalloc/prim.h b/Include/internal/mimalloc/mimalloc/prim.h
index 8a60d52..322ab29 100644
--- a/Include/internal/mimalloc/mimalloc/prim.h
+++ b/Include/internal/mimalloc/mimalloc/prim.h
@@ -151,9 +151,9 @@ static inline mi_threadid_t _mi_prim_thread_id(void) mi_attr_noexcept {
// If you test on another platform and it works please send a PR :-)
// see also https://akkadia.org/drepper/tls.pdf for more info on the TLS register.
#elif defined(__GNUC__) && ( \
- (defined(__GLIBC__) && (defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__))) \
+ (defined(__GLIBC__) && (defined(__x86_64__) || defined(__i386__) || (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__))) \
|| (defined(__APPLE__) && (defined(__x86_64__) || defined(__aarch64__))) \
- || (defined(__BIONIC__) && (defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__))) \
+ || (defined(__BIONIC__) && (defined(__x86_64__) || defined(__i386__) || (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__))) \
|| (defined(__FreeBSD__) && (defined(__x86_64__) || defined(__i386__) || defined(__aarch64__))) \
|| (defined(__OpenBSD__) && (defined(__x86_64__) || defined(__i386__) || defined(__aarch64__))) \
)