On Wed, Feb 11, 2026 at 10:58:32AM +0100, Tobias Burnus wrote:
> Jerry D wrote:
> > + 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" {}
> > + cleanup-modules ""
> > + }
>
> As mentioned in 13/13, the current implementation seems to assume that POSIX
> threads are available; additionally, -lpthread or -pthread might be needed
> for linking. In any case, it seems as if some check is required whether
> caf_shmem is actually available; otherwise, the shmem tests have to be
> skipped.
>
Unfortunately, I don't know how to fix. In libgomp/configure.txt one sees
% more libgomp/configure.txt
# This is the target specific configuration file. This is invoked by the
# autoconf generated configure script. Putting it in a separate shell file
# lets us skip running autoconf when modifying target specific information.
# This file switches on the shell variable ${target}, and sets the
# following shell variables:
# config_path An ordered list of directories to search for
# sources and headers. This is relative to the
# config subdirectory of the source tree.
# XCFLAGS Add extra compile flags to use.
# XLDFLAGS Add extra link flags to use.
# tmake_file A list of machine-description-specific
# makefile fragments.
...
*-*-freebsd*)
# Need to link with -lpthread so libgomp.so is self-contained.
XLDFLAGS="${XLDFLAGS} -lpthread"
;;
It looks like AIX also needs -lpthread added to its linker flags.
In libgfortran/configure.host, there are target specific checks,
but adding the above with would unconditional add -lpthread to
the linker flags even if caf_shmem is not used.
--
Steve