https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123406
--- Comment #5 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #3)
> diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
> index c5093bb84464..36b5e9b07a60 100644
> --- a/libstdc++-v3/acinclude.m4
> +++ b/libstdc++-v3/acinclude.m4
> @@ -5828,7 +5828,13 @@ AC_LANG_SAVE
> ::putc_unlocked(' ', f);
> ::funlockfile(f);
> ::fclose(f);
> - ], [ac_stdio_locking=yes], [ac_stdio_locking=no])
> + ],[
> + case "$with_newlib-$target_os" in
> + yes-cygwin*) ac_stdio_locking=yes ;;
> + yes-*) ac_stdio_locking=no ;; # PR libstdc++/122172
> + *) ac_stdio_locking=yes ;;
> + esac
> + ],[ac_stdio_locking=no])
> AC_MSG_RESULT($ac_stdio_locking)
>
> if test "$ac_stdio_locking" = yes; then
> diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
> index 6c00894cbee6..02102c645477 100755
> --- a/libstdc++-v3/configure
> +++ b/libstdc++-v3/configure
> @@ -55067,7 +55067,13 @@ main ()
> }
> _ACEOF
> if ac_fn_cxx_try_compile "$LINENO"; then :
> - ac_stdio_locking=yes
> +
> + case "$with_newlib-$target_os" in
> + yes-cygwin*) ac_stdio_locking=yes ;;
> + yes-*) ac_stdio_locking=no ;; # PR libstdc++/122172
> + *) ac_stdio_locking=yes ;;
> + esac
> +
> else
> ac_stdio_locking=no
> fi
>
Something like that, yes, thanks. Though, I was thinking an include test for
newlib.h (found elsewhere in libstdc++ configure.ac) so we won't rely on
--with-newlib.