Hi.

I verified this patch works by successfully compiling sparc GCC (just the
compiler, not the libraries) on my x86_64 linux machine.  I didn't try
bootstraping nor regtesting since I don't have a sparc machine readily
available and since it doesn't seem relevant for this patch.

Configured with (though the --disable-multilib and --disable-libsanitizer
shouldn't matter):
--target=sparc-linux --disable-multilib --disable-libsanitizer 
--disable-bootstrap

Ok to push?

Thanks,
Filip Kastl


-- 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 (TARGET_TLS): Use '#ifdef HAVE_AS_TLS ...
        #define TARGET_TLS 1' instead of '#define TARGET_TLS HAVE_AS_TLS'.

Signed-off-by: Filip Kastl <[email protected]>
---
 gcc/config/sparc/sparc.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index fd406f36c8a..8393308f476 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -1622,7 +1622,11 @@ extern int sparc_indent_opcode;
 
 /* TLS support defaults to GNU extensions.  The original Sun flavor must be
    activated in separate configuration files.  */
-#define TARGET_TLS HAVE_AS_TLS
+#ifdef HAVE_AS_TLS
+#define TARGET_TLS 1
+#else
+#define TARGET_TLS 0
+#endif
 
 #ifdef HAVE_AS_LEON
 #define AS_LEON_FLAG "-Aleon"
-- 
2.51.0

Reply via email to