[PATCH] Fix spurious failures on Solaris 2.6 and below
Eric Botcazou
ebotcazou@libertysurf.fr
Thu Feb 17 11:03:00 GMT 2005
Hi,
We always have had the following failures on Solaris 2.6 and below:
FAIL: thread/pthread1.cc (test for excess errors)
WARNING: thread/pthread1.cc compilation failed to produce executable
FAIL: thread/pthread2.cc (test for excess errors)
WARNING: thread/pthread2.cc compilation failed to produce executable
FAIL: thread/pthread3.cc (test for excess errors)
WARNING: thread/pthread3.cc compilation failed to produce executable
FAIL: thread/pthread4.cc (test for excess errors)
WARNING: thread/pthread4.cc compilation failed to produce executable
FAIL: thread/pthread5.cc (test for excess errors)
WARNING: thread/pthread5.cc compilation failed to produce executable
FAIL: thread/pthread6.cc (test for excess errors)
WARNING: thread/pthread6.cc compilation failed to produce executable
FAIL: thread/pthread7-rope.cc (test for excess errors)
WARNING: thread/pthread7-rope.cc compilation failed to produce executable
They come from the Solaris-specific tweak present in every pthread*.cc file:
#if defined(__sun) && defined(__svr4__)
pthread_setconcurrency (thread_pairs * 2);
#endif
It turns out that pthread_setconcurrency is only available in Solaris 7 and
later, so we need to differentiate the Solaris versions. It's easy: the
macro _XOPEN_VERSION is at most 4 up to Solaris 2.6, while it is at least 500
from Solaris 7 and on.
The patch has been tested on Solaris 2.5.1, 2.6, 7 (all branches) and I have
manually verified with gcc -E that the call to pthread_setconcurrency is
still present on Solaris 7. OK for all active branches?
2005-02-17 Eric Botcazou <ebotcazou@libertysurf.fr>
* testsuite/thread/pthread1.cc: Do not invoke pthread_setconcurrency
on Solaris 2.6 and below.
* testsuite/thread/pthread2.cc: Likewise.
* testsuite/thread/pthread3.cc: Likewise.
* testsuite/thread/pthread4.cc: Likewise.
* testsuite/thread/pthread5.cc: Likewise.
* testsuite/thread/pthread6.cc: Likewise.
* testsuite/thread/pthread7-rope.cc: Likewise.
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libstdc++_pthread_sol26.diff
Type: text/x-diff
Size: 3952 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20050217/c5cfa68f/attachment.bin>
More information about the Libstdc++
mailing list