This change adjusts the libstdc++ configuration for VxWorks to set ac_has_nanosleep=yes, which enables the use of nanosleep from the library.
While this technically depends on the kernel configuration (INCLUDE_POSIX_TIMERS) this is the normal configuration in all the environments we have been given to work with for the past decade and activating this improves the library in our experience. Tested in accordance with the description in https://gcc.gnu.org/ml/gcc-patches/2019-12/msg00911.html Best Regards, Olivier 2019-12-13 Corentin Gay <g...@adacore.com> libstdc++/ * acinclude.m4 (vxworks*): New entry. Set ac_has_nanosleep=yes. * configure: Regenerate.
--- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1408,6 +1408,11 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [ ac_has_nanosleep=yes ac_has_sched_yield=yes ;; + # VxWorks has nanosleep as soon as the kernel is configured with + # INCLUDE_POSIX_TIMERS, which is normally/most-often the case. + vxworks*) + ac_has_nanosleep=yes + ;; gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) AC_MSG_CHECKING([for at least GNU libc 2.17]) AC_TRY_COMPILE( diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index fa86ca1e731..717f5c1d21d 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -20871,6 +20871,11 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_has_nanosleep=yes ac_has_sched_yield=yes ;; + # VxWorks has nanosleep as soon as the kernel is configured with + # INCLUDE_POSIX_TIMERS, which is normally/most-often the case. + vxworks*) + ac_has_nanosleep=yes + ;; gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for at least GNU libc 2.17" >&5 $as_echo_n "checking for at least GNU libc 2.17... " >&6; } -- 2.17.1