From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: Re: Fix link errors on Android 4.3
Date: Wed, 11 Jan 2023 18:11:08 +0100 [thread overview]
Message-ID: <2030744.8DbOzPnMyl@nimes> (raw)
In-Reply-To: <7865076.SKYDtnEIZr@nimes>
> 2023-01-11 Bruno Haible <bruno@clisp.org>
>
> Fix link errors on Android 4.3.
> * lib/asyncsafe-spin.c: Don't use the GCC >= 4.1 builtins on Android.
> * lib/pthread-spin.c: Likewise.
> * lib/simple-atomic.c: Likewise.
Actually there's no problem when building with clang, because clang apparently
does not generate a reference to an external function here. So, let me limit
the last change to builds with GCC.
diff --git a/lib/asyncsafe-spin.c b/lib/asyncsafe-spin.c
index 66e1669924..9964473828 100644
--- a/lib/asyncsafe-spin.c
+++ b/lib/asyncsafe-spin.c
@@ -134,9 +134,9 @@ 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__ && !defined __ANDROID__
+ && !defined __ibmxl__
/* Use GCC built-ins (available in GCC >= 4.1, except on SPARC, and
clang >= 3.0).
Documentation:
diff --git a/lib/pthread-spin.c b/lib/pthread-spin.c
index e551f733cf..4031975f0b 100644
--- a/lib/pthread-spin.c
+++ b/lib/pthread-spin.c
@@ -162,9 +162,10 @@ 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__ && !defined __ANDROID__
+ && !defined __ibmxl__
/* Use GCC built-ins (available in GCC >= 4.1 and clang >= 3.0).
Documentation:
<https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html> */
diff --git a/lib/simple-atomic.c b/lib/simple-atomic.c
index ffa126613c..eab87a3ec2 100644
--- a/lib/simple-atomic.c
+++ b/lib/simple-atomic.c
@@ -67,9 +67,9 @@ 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__ && !defined __ANDROID__
+ && !defined __ibmxl__
/* Use GCC built-ins (available in GCC >= 4.1, except on SPARC, and
clang >= 3.0).
Documentation:
prev parent reply other threads:[~2023-01-11 17:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-11 9:53 Fix link errors on Android 4.3 Bruno Haible
2023-01-11 17:11 ` Bruno Haible [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2030744.8DbOzPnMyl@nimes \
--to=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).