This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch] Default to --enable-libstdcxx-time=auto
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Benjamin De Kosnik <bkoz at redhat dot com>
- Cc: Jonathan Wakely <jwakely dot gcc at gmail dot com>, "libstdc++" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 24 May 2013 23:21:50 +0200
- Subject: Re: [patch] Default to --enable-libstdcxx-time=auto
- References: <CAH6eHdTgTspzbfHhD3uDwDVD3uXAapb_NMZ0jAZ-4-UjfD4H4g at mail dot gmail dot com> <yddip2brtxf dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <yddwqqqqaei dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <20130524132304 dot 1fa972ed at oakwood>
Benjamin De Kosnik <bkoz@redhat.com> writes:
>>> I get the
>> > following testsuite regressions on Solaris 10/x86:
>> >
>> > FAIL: 30_threads/async/54297.cc (test for excess errors)
>> > WARNING: 30_threads/async/54297.cc compilation failed to produce
>> > executable FAIL: 30_threads/condition_variable_any/53830.cc (test
>> > for excess errors) WARNING:
>> > 30_threads/condition_variable_any/53830.cc compilation failed to
>> > produ e executable FAIL: 30_threads/this_thread/3.cc (test for
>> > excess errors) WARNING: 30_threads/this_thread/3.cc compilation
>> > failed to produce executable FAIL: 30_threads/this_thread/4.cc
>> > (test for excess errors) WARNING: 30_threads/this_thread/4.cc
>> > compilation failed to produce executable FAIL:
>> > 30_threads/thread/native_handle/cancel.cc (test for excess errors)
>> > WARNING: 30_threads/thread/native_handle/cancel.cc compilation
>> > failed to produc e executable
>> >
>> > All of them have the same root cause:
>> >
>> > Excess errors:
>> > Undefined first referenced
>> > symbol in file
>> > nanosleep /var/tmp//ccQhmiwd.o (symbol
>> > belongs to implicit dependency /lib/librt.so.1) ld: fatal: symbol
>> > referencing errors. No output written to ./54297.exe collect2:
>> > error: ld returned 1 exit status
>> >
>> > It seems that now every single C++ program needs to be linked with
>> > -lrt, not only libstdc++.so. This will also happen on Solaris 9
>> > (bootstrap still running), while on Solaris 11 nanosleep and the
>> > others were integrated into libc.so.1.
>
> So you'll need conditional LDFLAGS for solaris 9 and 10 only?
Strictly speaking, yes. In Solaris 11, the librt functions were moved
to libc, but librt is left behind as a filter on libc. It were best to
wrap -lrt in -z ignore/-z record (the Solaris equivalents of
--as-needed/--no-as-needed) when linking C++ programs, which is one
reason I think this is best handled with a new libstdc++.spec since most
of the configury is already present in libstdc++, along the lines of
libgfortran.spec.
acinclude.m4 would have to be amended to use AC_SEARCH_LIBS rather than
hardcoding the addition of -lrt to GLIBCXX_LIBS.
For the moment, this patch
http://gcc.gnu.org/ml/gcc-patches/2013-05/msg01488.html
does the job which is far less intrusive than adding libstdc++.spec, but
is certainly suboptimal.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University