From eb505e5db4ce1a0a6f37160850b664480da02be5 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 24 May 2023 10:17:30 +0200 Subject: [PATCH] asyncsafe-spin, simple-atomic: Don't use -mcpu-v9 on NetBSD/sparc. Reported by Brandon Applegate in . * lib/asyncsafe-spin.c: Limit the SPARC workaround to Solaris. * lib/simple-atomic.c: Likewise. * m4/sparcv8+.m4 (gl_SPARC_V8PLUS): Likewise. --- ChangeLog | 9 +++++++++ lib/asyncsafe-spin.c | 6 +++--- lib/simple-atomic.c | 6 +++--- m4/sparcv8+.m4 | 8 ++++---- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index bd60b75b8f..06fd474a1a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2023-05-24 Bruno Haible + + asyncsafe-spin, simple-atomic: Don't use -mcpu-v9 on NetBSD/sparc. + Reported by Brandon Applegate in + . + * 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 ssize_t: Fix replacement on 64-bit Windows. diff --git a/lib/asyncsafe-spin.c b/lib/asyncsafe-spin.c index 2a6838adc0..93a0f0476d 100644 --- a/lib/asyncsafe-spin.c +++ b/lib/asyncsafe-spin.c @@ -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: */ diff --git a/lib/simple-atomic.c b/lib/simple-atomic.c index eab87a3ec2..1f43bd771c 100644 --- a/lib/simple-atomic.c +++ b/lib/simple-atomic.c @@ -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: */ diff --git a/m4/sparcv8+.m4 b/m4/sparcv8+.m4 index 95cfa0e586..efe5bcdf86 100644 --- a/m4/sparcv8+.m4 +++ b/m4/sparcv8+.m4 @@ -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], -- 2.39.5