This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [c++, driver] Add -lrt on Solaris
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, "libstdc++" <libstdc++ at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>, Jason Merrill <jason at redhat dot com>, Benjamin Kosnik <bkoz at redhat dot com>
- Date: Fri, 07 Jun 2013 18:03:47 +0200
- Subject: Re: [c++, driver] Add -lrt on Solaris
- References: <yddk3m5diwb dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <CAH6eHdTZRyZs78eGn65i7nygpdTzkJ4KGRaTFA+E7h0X9Na00g at mail dot gmail dot com>
Jonathan Wakely <jwakely.gcc@gmail.com> writes:
> On 7 June 2013 16:45, Rainer Orth wrote:
>>
>> Follow libgfortran's lead and introduce libstdc++.spec. Here,
>> target-specific linker switches can be determined by the libstdc++
>> configury, with configuration well localized, and one can easily handle
>> stuff like linking -lrt with -z ignore/-z record
>> resp. --as-needed/--no-as-needed. This provides us with a general
>> extension mechanism for linking C++ programs, which can be used for
>> other purposes if the need arises.
>
> Could this later be extended to serve as the basis for a -cxxthread
> switch that does platform-specific things to allow the C++11 thread
> library to be used? I don't like that users must use -pthread for
Sure.
> std::thread and std::mutex to work, because they shouldn't need to
> know or care whether it uses Pthreads internally, or some other thread
> model.
Exactly: that's the sort of implementation detail users shouldn't need
to know or care about.
>> The downside of course is that the testsuite needs to be taught about
>> that file by passing the appropriate -B switches to find it at compile
>> time.
>
> Is that only necessary for testing an uninstalled libstdc++? In other
> words, would the spec file be installed and used automatically for an
> installed libstdc++?
Of course: that's what gfortran does with libgfortran.spec: it gets
installed into $libdir and is searched there automatically.
>> One way or another, this needs to be adressed to fix the libstdc++
>> testsuite failures on Solaris.
>
> The other option is to make --enable-libstdcxx-time=auto only
> effective for Solaris 11, but I think you said you'd prefer to keep it
> for 9 and 10.
Right: if the target (independent of Solaris) has the necessary support
for some feature, libstdc++ should be able to use it. You wouldn't
think about disabling thread support before Solaris 11 to avoid linking
libstdc++.so with -lpthread?
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University