On Mon 2026-03-02 14:20:14, Rainer Orth wrote:
> I'd do this differently, following many other targets:
> 
> #ifndef HAVE_AS_TLS
> #define HAVE_AS_TLS 0
> #endif

Alright, here's a revised patch.  I've once again verified that the x86_64
host, sparc target crosscompiler builds.

Filip


-- 8< --


Since r16-6798, it wasn't possible to build a sparc GCC without having
a sparc assembler installed.  That shoudn't be the case since there are
usecases for just compiling into assembly.

The problem was sparc.h doing '#define TARGET_TLS HAVE_AS_TLS'.
Building GCC failed when HAVE_AS_TLS wasn't defined which is the case
when one doesn't have an assembler with TLS installed during
./configure.

This patch addresses the problem.

        PR target/123926

gcc/ChangeLog:

        * config/sparc/sparc.h (HAVE_AS_TLS): Do '#ifndef HAVE_AS_TLS
        #define HAVE_AS_TLS 1'.
---
 gcc/config/sparc/sparc.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index fd406f36c8a..16e31901ca6 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -1620,6 +1620,10 @@ extern int sparc_indent_opcode;
       }                                        \
   } while (0)
 
+#ifndef HAVE_AS_TLS
+#define HAVE_AS_TLS 0
+#endif
+
 /* TLS support defaults to GNU extensions.  The original Sun flavor must be
    activated in separate configuration files.  */
 #define TARGET_TLS HAVE_AS_TLS
-- 
2.51.0

Reply via email to