[c++, driver] Add -lrt on Solaris
Rainer Orth
ro@CeBiTec.Uni-Bielefeld.DE
Fri Jun 7 16:03:00 GMT 2013
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
More information about the Libstdc++
mailing list