Skip to content

Commit 79c9cbb

Browse files
committed
Fix breakage on arm64_32 platforms
We just avoid the special handling needed for Apple M1. Fixes openssl#26135 Reviewed-by: Matt Caswell <[email protected]> Reviewed-by: Saša Nedvědický <[email protected]> Reviewed-by: Tom Cosgrove <[email protected]> (Merged from openssl#26145)
1 parent ffa1cf6 commit 79c9cbb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: crypto/threads_pthread.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,16 @@ typedef struct rcu_cb_item *prcu_cb_item;
9494

9595
# if defined(__GNUC__) && defined(__ATOMIC_ACQUIRE) && !defined(BROKEN_CLANG_ATOMICS) \
9696
&& !defined(USE_ATOMIC_FALLBACKS)
97-
# if defined(__APPLE__) && defined(__clang__) && defined(__aarch64__)
97+
# if defined(__APPLE__) && defined(__clang__) && defined(__aarch64__) && defined(__LP64__)
9898
/*
9999
* For pointers, Apple M1 virtualized cpu seems to have some problem using the
100100
* ldapr instruction (see https://github.com/openssl/openssl/pull/23974)
101101
* When using the native apple clang compiler, this instruction is emitted for
102102
* atomic loads, which is bad. So, if
103103
* 1) We are building on a target that defines __APPLE__ AND
104104
* 2) We are building on a target using clang (__clang__) AND
105-
* 3) We are building for an M1 processor (__aarch64__)
105+
* 3) We are building for an M1 processor (__aarch64__) AND
106+
* 4) We are building with 64 bit pointers
106107
* Then we should not use __atomic_load_n and instead implement our own
107108
* function to issue the ldar instruction instead, which produces the proper
108109
* sequencing guarantees

0 commit comments

Comments
 (0)