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: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 22 May 2013 16:52:21 +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> <CAH6eHdSipHmZgpEt7YNxFvb5x24r7BrUmya3gq6zN=xXSjtV-w at mail dot gmail dot com>
Jonathan Wakely <jwakely.gcc@gmail.com> writes:
>> 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.
>
> I see. Would you prefer to disable use of nanosleep on Solaris 9 and
> 10, or to keep using it and link to librt?
I think it's fine for both C++11 programs and libstdc++.so to depend
on librt. Maybe one could restrict linking with -lrt to C++11 mode?
But I doubt that: you can probably link both C++99 and C++11 objects
into a single executable, and with libstdc++.so already depending on
librt, there's not much point in the added complexity.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University