From 325cc17a476fd57f353c6671d3e14ebf3deeb0ec Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 11 Jan 2023 10:50:41 +0100 Subject: [PATCH] Fix link errors on Android 4.3. * lib/asyncsafe-spin.c: Don't use the GCC >= 4.1 builtins on Android, when building with GCC. * lib/pthread-spin.c: Likewise. * lib/simple-atomic.c: Likewise. --- ChangeLog | 8 ++++++++ lib/asyncsafe-spin.c | 2 +- lib/pthread-spin.c | 3 ++- lib/simple-atomic.c | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 88ae4120ee..f6df46ab86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2023-01-11 Bruno Haible + + Fix link errors on Android 4.3. + * lib/asyncsafe-spin.c: Don't use the GCC >= 4.1 builtins on Android, + when building with GCC. + * lib/pthread-spin.c: Likewise. + * lib/simple-atomic.c: Likewise. + 2023-01-10 Bruno Haible memset_explicit tests: Fix signature check. diff --git a/lib/asyncsafe-spin.c b/lib/asyncsafe-spin.c index 7a74c32077..9964473828 100644 --- a/lib/asyncsafe-spin.c +++ b/lib/asyncsafe-spin.c @@ -134,7 +134,7 @@ do_unlock (asyncsafe_spinlock_t *lock) # endif # elif (((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \ - && !defined __sparc__) \ + && !defined __sparc__ && !defined __ANDROID__) \ || __clang_major__ >= 3) \ && !defined __ibmxl__ /* Use GCC built-ins (available in GCC >= 4.1, except on SPARC, and diff --git a/lib/pthread-spin.c b/lib/pthread-spin.c index ca3e88755a..4031975f0b 100644 --- a/lib/pthread-spin.c +++ b/lib/pthread-spin.c @@ -162,7 +162,8 @@ pthread_spin_destroy (pthread_spinlock_t *lock) return 0; } -# elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) \ +# elif (((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \ + && !defined __ANDROID__) \ || __clang_major__ >= 3) \ && !defined __ibmxl__ /* Use GCC built-ins (available in GCC >= 4.1 and clang >= 3.0). diff --git a/lib/simple-atomic.c b/lib/simple-atomic.c index 4e52447ed6..eab87a3ec2 100644 --- a/lib/simple-atomic.c +++ b/lib/simple-atomic.c @@ -67,7 +67,7 @@ atomic_compare_and_swap_ptr (uintptr_t volatile *vp, require to link with -latomic. */ # if (((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \ - && !defined __sparc__) \ + && !defined __sparc__ && !defined __ANDROID__) \ || __clang_major__ >= 3) \ && !defined __ibmxl__ /* Use GCC built-ins (available in GCC >= 4.1, except on SPARC, and -- 2.39.5