This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Enable TLS for ia64-hpux
- From: Zack Weinberg <zack at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org, Jim Wilson <wilson at specifixinc dot com>, Al Stone<ahs3 at fcahs3 dot fc dot hp dot com>
- Date: Mon, 28 Jun 2004 18:43:58 -0700
- Subject: Enable TLS for ia64-hpux
My contact at HP asked why GCC didn't support thread-local storage on
ia64-hpux, and I said 'well, we thought HPUX's linker and runtime
didn't support it, so it's disabled'. And he said 'no, it works,
here's the spec', and today I read over that spec and discovered that
they'd implemented exactly the same model as ia64-linux.
Therefore I would like to propose the following patch for mainline. I
have verified that with this patch applied, gcc.dg/tls/* all succeed
(except for the one all-target XFAIL, of course), on both
ia64-hp-hpux11.22 and ia64-hp-hpux11.23. These are, to my knowledge,
the only released versions of ia64-hpux, and GNU ld does not support
this target in general, so I believe the feature can just be
unconditionally enabled.
However, I do not know everything, and besides which there are a huge
number of unexpected failures on ia64-* right now, so I am going to
hold off applying this patch for at least 24 hours in case there is a
problem.
(HPUX allows the implementation of an additional frill - inlining of
the fast path of __get_tls_address - but I do not have time to do that
right now, and besides I would need to check whether that's possible
on other ia64 operating systems.)
zw
* config/ia64/hpux.h: Do not override TARGET_HAVE_TLS to false.
===================================================================
Index: config/ia64/hpux.h
--- config/ia64/hpux.h 27 Apr 2004 00:12:27 -0000 1.43
+++ config/ia64/hpux.h 29 Jun 2004 01:42:08 -0000
@@ -196,10 +196,6 @@ do { \
#undef TARGET_SECTION_TYPE_FLAGS
#define TARGET_SECTION_TYPE_FLAGS ia64_rwreloc_section_type_flags
-/* HP-UX does not support thread-local storage. */
-#undef TARGET_HAVE_TLS
-#define TARGET_HAVE_TLS false
-
/* ia64 HPUX has the float and long double forms of math functions. */
#undef TARGET_C99_FUNCTIONS
#define TARGET_C99_FUNCTIONS 1