]> Savannah Git Hosting - gnulib.git/commitdiff
asyncsafe-spin, simple-atomic: Don't use -mcpu-v9 on NetBSD/sparc.
authorBruno Haible <bruno@clisp.org>
Wed, 24 May 2023 08:17:30 +0000 (10:17 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 4 Jun 2023 19:18:44 +0000 (21:18 +0200)
Reported by Brandon Applegate in
<https://lists.gnu.org/archive/html/bug-gettext/2023-05/msg00042.html>.

* lib/asyncsafe-spin.c: Limit the SPARC workaround to Solaris.
* lib/simple-atomic.c: Likewise.
* m4/sparcv8+.m4 (gl_SPARC_V8PLUS): Likewise.

ChangeLog
lib/asyncsafe-spin.c
lib/simple-atomic.c
m4/sparcv8+.m4

index bd60b75b8f988b85009177149d97acc5a375229d..06fd474a1a262d44322ebdb1c6f10c32c5c2ce1b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-05-24  Bruno Haible  <bruno@clisp.org>
+
+       asyncsafe-spin, simple-atomic: Don't use -mcpu-v9 on NetBSD/sparc.
+       Reported by Brandon Applegate in
+       <https://lists.gnu.org/archive/html/bug-gettext/2023-05/msg00042.html>.
+       * lib/asyncsafe-spin.c: Limit the SPARC workaround to Solaris.
+       * lib/simple-atomic.c: Likewise.
+       * m4/sparcv8+.m4 (gl_SPARC_V8PLUS): Likewise.
+
 2023-05-21  Bruno Haible  <bruno@clisp.org>
 
        ssize_t: Fix replacement on 64-bit Windows.
index 2a6838adc0fc97431aeeafd1b29b2db69c8bd63c..93a0f0476d3a28258d781b3ccd48d7ec2b72aa3e 100644 (file)
@@ -136,11 +136,11 @@ do_unlock (asyncsafe_spinlock_t *lock)
 #   endif
 
 #  elif (((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \
-          && !defined __sparc__ && !defined __ANDROID__) \
+          && !(defined __sun && defined __sparc__) && !defined __ANDROID__) \
          || __clang_major__ >= 3) \
         && !defined __ibmxl__
-/* Use GCC built-ins (available in GCC >= 4.1, except on SPARC, and
-   clang >= 3.0).
+/* Use GCC built-ins (available in GCC >= 4.1, except on Solaris/SPARC and
+   Android, and clang >= 3.0).
    Documentation:
    <https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html>  */
 
index eab87a3ec2fe8bac1e1a4dc98db593ab93bc8010..1f43bd771cbcae90b2a447ce17cd0ae81e104c18 100644 (file)
@@ -67,11 +67,11 @@ 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 __ANDROID__) \
+       && !(defined __sun && defined __sparc__) && !defined __ANDROID__) \
       || __clang_major__ >= 3) \
      && !defined __ibmxl__
-/* Use GCC built-ins (available in GCC >= 4.1, except on SPARC, and
-   clang >= 3.0).
+/* Use GCC built-ins (available in GCC >= 4.1, except on Solaris/SPARC and
+   Android, and clang >= 3.0).
    Documentation:
    <https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html>  */
 
index 95cfa0e586ace91e012737d21708b6a4aefc28f8..efe5bcdf86a8bf052c1ba8a414ffddd2baea358e 100644 (file)
@@ -1,5 +1,5 @@
-# sparcv8+.m4 serial 1
-dnl Copyright (C) 2020-2022 Free Software Foundation, Inc.
+# sparcv8+.m4 serial 2
+dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -18,8 +18,8 @@ AC_DEFUN([gl_SPARC_V8PLUS],
 [
   AC_REQUIRE([AC_CANONICAL_HOST])
 
-  case "$host_cpu" in
-    sparc*)
+  case "$host" in
+    sparc*-*-solaris*)
       if test -n "$GCC"; then
         AC_CACHE_CHECK([whether SPARC v8+ instructions are supported],
           [gl_cv_sparc_v8plus],