Hello all,

The attached patch from Steve enables all tests to pass on FreeBSD.

I am aware that Tobias suggests we add or adjust a *spec.in file to include the -pthread automatically when gfortran is invoked. We need to do this as a follow on.

With the attached patch I am now at 22 patches pending in trunk and it is
getting too onerous for me to manage this here.

The set has been successfully tested on x86_64, both -m32 and -m64, Darwin, FreeBSD, and others.

I really need approval for the whole set so we can get it exposed and deal with fixes as-needed.

OK to push please?

Regards,

Jerry

Author: Steve Kargl <[email protected]>
Date:   Mon Feb 23 10:18:00 2026 -0800

    Fortran: Use -pthread on target *-*-freebsd*

            PR fortran/88076

    gcc/testsuite/ChangeLog:

            * gfortran.dg/coarray/caf.exp: If the target is a FreeBSD
            system add -pthread when running tests.

commit 5da4bdb1d92bffba91d4f7cbb9ea7f7bc274190b
Author: Steve Kargl <[email protected]>
Date:   Mon Feb 23 10:18:00 2026 -0800

    Fortran: Use -pthread on target *-*-freebsd*
    
            PR fortran/88076
    
    gcc/testsuite/ChangeLog:
    
            * gfortran.dg/coarray/caf.exp: If the target is a FreeBSD
            system add -pthread when running tests.

diff --git a/gcc/testsuite/gfortran.dg/coarray/caf.exp b/gcc/testsuite/gfortran.dg/coarray/caf.exp
index 02c3591f377..3db249a920f 100644
--- a/gcc/testsuite/gfortran.dg/coarray/caf.exp
+++ b/gcc/testsuite/gfortran.dg/coarray/caf.exp
@@ -120,7 +120,11 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ]]
         foreach flags $option_list {
             verbose "Testing $nshort (libcaf_shmem), $flags" 1
             set gfortran_aux_module_flags "-fcoarray=lib $flags -lcaf_shmem"
-            dg-test $test "-fcoarray=lib $flags -lcaf_shmem" {}
+            if { [istarget *-*-freebsd*] } {
+                dg-test $test "-fcoarray=lib -pthread $flags -lcaf_shmem" {}
+            } else {
+                dg-test $test "-fcoarray=lib $flags -lcaf_shmem" {}
+            }
             cleanup-modules ""
         }
     }

Reply via email to