public inbox for
help / color / mirror / Atom feed
* [gcc r13-3012] or1k: Only define TARGET_HAVE_TLS when HAVE_AS_TLS
@ 2022-10-01 10:15 Stafford Horne
  0 siblings, 0 replies; only message in thread
From: Stafford Horne @ 2022-10-01 10:15 UTC (permalink / raw)
  To: gcc-cvs

commit r13-3012-gca01d2526917ec6e54b30472d3aedfd46d4ca585
Author: Stafford Horne <>
Date:   Thu Sep 29 15:32:39 2022 +0100

    or1k: Only define TARGET_HAVE_TLS when HAVE_AS_TLS
    This was found when testing buildroot with linuxthreads enabled.  In
    this case, the build passes --disable-tls to the toolchain during
    configuration.  After building the OpenRISC toolchain it was still
    generating TLS code sequences and causing linker failures such as:
     ..../or1k-buildroot-linux-uclibc-gcc -o gpsd-3.24/gpsctl .... -lusb-1.0 -lm -lrt -lnsl
     ..../ld: ..../sysroot/usr/lib/ undefined reference to `__tls_get_addr'
    This patch fixes this by disabling tls for the OpenRISC target when requested
    via --disable-tls.
            * config/or1k/ (TARGET_HAVE_TLS): Only define if
            HAVE_AS_TLS is defined.
    Tested-by: Yann E. MORIN <>

 gcc/config/or1k/ | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/config/or1k/ b/gcc/config/or1k/
index da2f59062ba..0ce7b234417 100644
--- a/gcc/config/or1k/
+++ b/gcc/config/or1k/
@@ -2206,8 +2206,10 @@ or1k_output_mi_thunk (FILE *file, tree thunk_fndecl,
 #define TARGET_LEGITIMATE_ADDRESS_P or1k_legitimate_address_p
+#ifdef HAVE_AS_TLS
 #define TARGET_HAVE_TLS true
 #define TARGET_HAVE_SPECULATION_SAFE_VALUE speculation_safe_value_not_needed

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-01 10:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-01 10:15 [gcc r13-3012] or1k: Only define TARGET_HAVE_TLS when HAVE_AS_TLS Stafford Horne

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).