https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123406

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
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


If another newlib target gains funlockfile support then we might want to match
on something more specific like $with_newlib-$host instead of
$with_newlib-$target_os but this should work for now, and it should be pretty
obvious where and how to extend it if needed.

Reply via email to