This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[testsuite] Always pass -pthread for TLS tests on Tru64 UNIX (PR target/46131)


As indicated in the PR, all TLS execution tests were failing on Tru64
UNIX.  After some investigation, the problem became obvious: due to lack
of native TLS support, Tru64 UNIX relies on emutls, which needs a couple
of libpthread functions.  Since the Tru64 UNIX linker lacks support for
weak definitions, there are also dummy implementations of them in
libgcc.  But here the real functions are needed, so the affected TLS
tests need to be linked with -pthread.  Manual testing indicated that
this fixes the problem as expected.  This patch implements the proper
solution by always passing -pthread in add_options_for_tls, just as on
Solaris 8/9.

Testing in progress, will commit once regtest finishes successfully.

	Rainer


2010-10-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR target/46131
	* lib/target-supports.exp (add_options_for_tls): Pass -pthread for
	*-*-osf*.

diff -r 201f524dd582 gcc/testsuite/lib/target-supports.exp
--- a/gcc/testsuite/lib/target-supports.exp	Thu Oct 28 15:17:34 2010 +0200
+++ b/gcc/testsuite/lib/target-supports.exp	Thu Oct 28 16:32:58 2010 +0200
@@ -613,6 +613,11 @@
 # Add to FLAGS all the target-specific flags needed to use thread-local storage.
 
 proc add_options_for_tls { flags } {
+    # Tru64 UNIX uses emutls, which relies on a couple of pthread functions
+    # which only live in libpthread, so always pass -pthread for TLS.
+    if { [istarget *-*-osf*] } {
+	return "$flags -pthread"
+    }
     # On Solaris 8 and 9, __tls_get_addr/___tls_get_addr only lives in
     # libthread, so always pass -pthread for native TLS.
     # Need to duplicate native TLS check from

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]