[v3] Link libstdc++ with -lpthread on IRIX 6 (PR target/47852)

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Thu Jan 12 10:22:00 GMT 2012


When PR target/47852 was filed last year, it turned out that this seemed
to be the same problem as PR target/45693 on Tru64 UNIX, i.e. stub
implementations of pthread functions getting in the way, although I
couldn't really figure out how this happens.  Since the problem on IRIX
didn't show up anywhere in the testsuite and seemed to be a weird corner
case, I all but forgot about it.

Recently, though, a couple of 30_threads testcases started to fail:

FAIL: 30_threads/future/cons/move_assign.cc execution test
FAIL: 30_threads/shared_future/cons/assign.cc execution test
FAIL: 30_threads/shared_future/cons/move_assign.cc execution test

like this:

terminate called after throwing an instance of 'std::system_error'
  what():  Function not implemented
Abort

It turns out that __gthread_cond_broadcast in

  void
  condition_variable::notify_all() noexcept
  {
    int __e = __gthread_cond_broadcast(&_M_cond);

    // XXX not in spec
    // EINVAL
    if (__e)
      __throw_system_error(__e);
  }

returns ENOSYS due to a stub for pthread_cond_broadcast in libc.
Linking libstdc++.so with -lpthread fixes those tests.

I've relinked libstdc++.so with -lpthread using the patch below and
rerun the libstdc++-v3 testsuite, where all 3 testcases pass now.

I'll include the patch in the next full mips-sgi-irix6.5 bootstrap this
weekend.  Ok for mainline if that passes?

Thanks.
	Rainer


2011-02-25  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR target/47852
	* configure.host (irix6.5*): Add -lpthread to OPT_LDFLAGS.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: irix6-libstdc++-pthread.patch
Type: text/x-patch
Size: 707 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20120112/fbdf71f5/attachment.bin>
-------------- next part --------------

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


More information about the Libstdc++ mailing list