Re: [PATCH] PR 125324 Fix - -fcoarray=shared should imply -pthread / gfortran.dg/coarray_51.f90 FAIL

Jerry D <[email protected]>
Newsgroups gmane.comp.gcc.patches,gmane.comp.gcc.fortran
Message-ID <[email protected]>
[PING]

On 5/27/26 9:35 AM, Jerry D wrote:
> As stated in the PR, this issue is possibly related to the version of glibc 
> installed on some systems. I can't test this on so many systems, so I want to 
> see if the auto testers pick it up. The patch is fairly simple. I copied Tobias 
> as the original reporter.
> 
> Assisted by Claude Sonnet 4.6 to be clear. See attached.
> 
> OK for mainline? If accepted probably should be backported to 16.
> 
> Jerry
> 
> ---
> fortran: also link -lpthread when -fcoarray=shared is used
> 
>   [PR125324]
> 
> When the driver auto-links -lcaf_shmem for -fcoarray=shared it must also
> link -lpthread because the shmem CAF runtime uses POSIX threads internally.
> 
>      PR fortran/125324
> 
> gcc/fortran/ChangeLog:
> 
>      * gfortranspec.cc (lang_specific_driver): Also append -lpthread
>      when need_caf_shmem is set.
> 
> Assisted by: Claude Sonnet 4.6
> ---
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.