https://gcc.gnu.org/g:802eeb0ce083461a9f48e22c5d08ab862d88e0fd

commit r17-4836-g802eeb0ce083461a9f48e22c5d08ab862d88e0fd
Author: LIU Hao <[email protected]>
Date:   Fri Sep 25 16:50:32 2026 +0800

    libgfortran: Set `enable_caf_shmem` to true for Cygwin and MinGW hosts
    
    In libgfortran/caf/shmem/thread_support.{h,c}, pthread.h is included only
    when `!defined(WIN32) && !defined(__CYGWIN__)`. For Cygwin and MinGW hosts,
    native named mutexes and semaphores are used and a pthread library is not
    needed.
    
    This commit overrides the result of the previous check for pthread, so
    libcaf_shmem is always built for these hosts even when a pthread library
    isn't available.
    
    libgfortran/ChangeLog:
    
            * configure.ac: Set `enable_caf_shmem` to true for Cygwin and MinGW 
hosts.
            * configure: Regenerate.
    
    Signed-off-by: LIU Hao <[email protected]>
    Signed-off-by: Jonathan Yong <[email protected]>

Diff:
---
 libgfortran/configure    | 3 +++
 libgfortran/configure.ac | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/libgfortran/configure b/libgfortran/configure
index e81d6d7c6d16..223ec82667c9 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -18480,6 +18480,9 @@ case ${host} in
     # These versions define PTHREAD_PROCESS_SHARED but the functionality
     # is not available at runtime, so the configure check misleads.
     enable_caf_shmem=false;;
+  *-*-cygwin* | *-*-mingw*)
+    # The specific implementation for these platforms does not use pthread.
+    enable_caf_shmem=true;;
 esac
  if test x$enable_caf_shmem = xtrue; then
   ENABLE_CAF_SHMEM_TRUE=
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index a63e1c4480c3..c50112df91c6 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -380,6 +380,9 @@ case ${host} in
     # These versions define PTHREAD_PROCESS_SHARED but the functionality
     # is not available at runtime, so the configure check misleads.
     enable_caf_shmem=false;;
+  *-*-cygwin* | *-*-mingw*)
+    # The specific implementation for these platforms does not use pthread.
+    enable_caf_shmem=true;;
 esac
 AM_CONDITIONAL([ENABLE_CAF_SHMEM], [test x$enable_caf_shmem = xtrue])

Reply via email to