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

            Bug ID: 124512
           Summary: libgfortran shmem caf: NetBSD has no
                    pthread_condattr_setpshared
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: prlw1 at cam dot ac.uk
  Target Milestone: ---

Failed to build e797ddb06215bfac on NetBSD 11.99.5.

commit 136940891b16ba795d87f40a5e986c143721b683 (HEAD)
Author: Andre Vehreschild <[email protected]>
Date:   Thu Feb 12 11:17:47 2026 -0800

    Fortran: Add a shared memory coarray implementation [PR88076]

introduced a couple of calls to

   pthread_mutexattr_setpshared (&mattr, PTHREAD_PROCESS_SHARED)

in libgfortran/caf/shmem/thread_support.c namely in initialize_shared_mutex().


Unfortunately NetBSD doesn't support PTHREAD_PROCESS_SHARED - according
to https://man.netbsd.org/pthread_mutexattr_setpshared.3

BUGS

     The pthread_mutexattr_getpshared() and pthread_mutexattr_setpshared()
     functions are hidden by default since only thread shared attributes are
     supported.

(i.e., not per process)

$ nm -g /lib/libpthread.so | grep mutexattr
000000000000b036 T __libc_mutexattr_destroy
                 U __libc_mutexattr_destroy_stub
000000000000b025 T __libc_mutexattr_init
000000000000b0c0 T __libc_mutexattr_settype
                 U __libc_mutexattr_settype_stub
000000000000b036 T pthread_mutexattr_destroy
000000000000b1c2 T pthread_mutexattr_getprioceiling
000000000000b125 T pthread_mutexattr_getprotocol
000000000000b083 T pthread_mutexattr_gettype
000000000000b025 T pthread_mutexattr_init
000000000000b1ff T pthread_mutexattr_setprioceiling
000000000000b162 T pthread_mutexattr_setprotocol
000000000000b0c0 T pthread_mutexattr_settype

so an AC_CHECK_FUNCS should fail to find it - but I don't know what the
consequences are - thoughts?

Reply via email to