Patchwork [v3] Link with -pthread on Tru64 UNIX (PR target/45693)

mail settings
Submitter Rainer Orth
Date Oct. 28, 2010, 2:41 p.m.
Message ID <ydd39rq1irs.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Download mbox | patch
Permalink /patch/69469/
State New
Headers show


Rainer Orth - Oct. 28, 2010, 2:41 p.m.
As indicated in the PR, all C++ EH tests on Tru64 UNIX were failing
since TLS (emutls in this case) was enabled by an unrelated patch.  The
problem is the same as in PR PR target/46131: emutls relies on a couple
of libpthread functions.  While there are dummy implementations in
libgcc, of course we need the real thing here.  The proper solution is
to link with -pthread here (instead of, e.g., linking with
-lpthread in g++), so EH doesn't always work, even if linked with
another driver or in a mixed-language problem.  Manual testing indicated
that this fixes the problem as expected.  alpha-dec-osf5.1b testing in
progress, will commit once completed successfully.


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

	PR target/45693
	* (osf*): Add -pthread to OPT_LDFLAGS.


diff -r 201f524dd582 libstdc++-v3/
--- a/libstdc++-v3/	Thu Oct 28 15:17:34 2010 +0200
+++ b/libstdc++-v3/	Thu Oct 28 16:32:58 2010 +0200
@@ -261,6 +261,12 @@ 
+  osf*)
+    # relies on emutls on Tru64 UNIX, which only works with the
+    # real functions implemented in, not with the dummies in
+    # libgcc, so always pass -pthread.
+    OPT_LDFLAGS="${OPT_LDFLAGS} -pthread"
+    ;;