gcc/libstdc++-v3
Jonathan Wakely 0aa1786d34 libstdc++: Fix build failure for target with no way to sleep
In previous releases the std::this_thread::sleep_for function was only
declared if the target supports multiple threads. I changed that
recently in r11-2649-g5bbb1f3000c57fd4d95969b30fa0e35be6d54ffb so that
sleep_for could be used single-threaded. But that means that targets
using --disable-threads are now required to provide some way to sleep.
This breaks the build for (at least) AVR when trying to build a hosted
library.

This patch adds a new autoconf macro that is defined when no way to
sleep is available, and uses that to suppress the sleeping functions in
std::this_thread.

The #error in src/c++11/thread.cc is retained for the case where there
is no sleep function available but multiple threads are supported. This
is consistent with previous releases, but that #error could probably be
removed without any consequences.

libstdc++-v3/ChangeLog:

	* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Define NO_SLEEP
	if none of nanosleep, sleep and Sleep is available.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* include/std/thread [_GLIBCXX_NO_SLEEP] (__sleep_for): Do
	not declare.
	[_GLIBCXX_NO_SLEEP] (sleep_for, sleep_until): Do not
	define.
	* src/c++11/thread.cc [_GLIBCXX_NO_SLEEP] (__sleep_for): Do
	not define.
2020-12-09 16:56:54 +00:00
..
config libstdc++: Update powerpc-linux baselines for GCC 10.1 2020-12-03 17:18:28 +00:00
doc libstdc++: Adjust whitespace in documentation 2020-12-08 13:36:45 +00:00
include libstdc++: Fix build failure for target with no way to sleep 2020-12-09 16:56:54 +00:00
libsupc++
po
python libstdc++: Fix std::any pretty printer [PR 68735] 2020-12-02 21:39:08 +00:00
scripts
src libstdc++: Fix build failure for target with no way to sleep 2020-12-09 16:56:54 +00:00
testsuite c++: Fix defaulted <=> fallback to < and == [PR96299] 2020-12-08 15:12:25 -05:00
acinclude.m4 libstdc++: Fix build failure for target with no way to sleep 2020-12-09 16:56:54 +00:00
aclocal.m4
ChangeLog Daily bump. 2020-12-09 00:16:50 +00:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
config.h.in libstdc++: Fix build failure for target with no way to sleep 2020-12-09 16:56:54 +00:00
configure libstdc++: Fix build failure for target with no way to sleep 2020-12-09 16:56:54 +00:00
configure.ac
configure.host
crossconfig.m4
fragment.am
linkage.m4
Makefile.am
Makefile.in
README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.