This is the mail archive of the
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: Thu, 23 May 2013 12:05:09 +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>
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
> Jonathan Wakely <email@example.com> writes:
>> This alters the configure script to enable C++11 thread library
>> features based on targets that are known to support the features,
>> rather than based on link tests which are disabled by default. With
>> Glibc 2.17 this enables a nanosecond resolution std::system_clock in
>> the default configuration, yay!
>> I've tested this on two versions of Fedora and Debian, but would be
>> grateful for test results on Solaris, Cygwin and BSD targets, and for
>> cross-compilers to any of those targets.
> Apart from the abi_check failure already reported, 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.
> Speaking of Solaris 9, there's another caveat: unlike Solaris 10 and up,
> CLOCK_MONOTONIC isn't defined, while the equivalent non-standard
> CLOCK_HIGHRES is. Instead of handling this in
> libstdc++-v3/src/c++11/chrono.cc directly, I've chosen the following
> route which allows libstdc++ to build on Solaris 9:
> 2013-05-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
> * config/os/solaris/solaris2.9/os_defines.h [!CLOCK_MONOTONIC]
> (CLOCK_MONOTONIC): Define.
The Solaris 9 (i386-pc-solaris2.9) bootstrap has now completed
successfully, so the patch above seems to be sound. Ok for mainline?
Astonishingly, the only failure I see is abi_check. The nanosleep error
above seems to be linker version dependent.
Rainer Orth, Center for Biotechnology, Bielefeld University