Hi all,
the linaro CI reported test errors for aarch64 targets. I figured that for aarch64 on linux the compile flags -pthread and -lrt are needed to link caf_shmem and produce an executable. The attached patch addresses this by special case for aarch64-*-linux* similiar to freebsd.
Regtested ok on aarch64-unknown-linux-gnu (cfarm185) and x86_64-linux-gnu / F43. Ok for master?
Regards, Andre
On Thu, 12 Mar 2026 04:46:24 +0000 (UTC) ci_notify@linaro.org wrote:
Dear contributor,
Our automatic CI has detected problems related to your patch(es). Please find some details below.
In master-aarch64, after: | commit gcc-16-7727-gaa09298cb017 | Author: Andre Vehreschild vehre@gcc.gnu.org | Date: Wed Jun 18 09:26:22 2025 +0200 | | Fortran: Enable coarray tests for multi image use [PR88076] | | Change some of regression tests to run on single and multiple images. | Add some new tests. | | ... 29 lines of the commit log omitted.
Produces 157 regressions: | | regressions.sum: | Running gfortran:gfortran.dg/coarray/caf.exp ... | FAIL: gfortran.dg/coarray/alloc_comp_1.f90 -fcoarray=lib -O2 -lcaf_shmem (test for excess errors) | UNRESOLVED: gfortran.dg/coarray/alloc_comp_1.f90 -fcoarray=lib -O2 -lcaf_shmem compilation failed to produce executable | FAIL: gfortran.dg/coarray/alloc_comp_10.f90 -fcoarray=lib -O2 -lcaf_shmem (test for excess errors) | UNRESOLVED: gfortran.dg/coarray/alloc_comp_10.f90 -fcoarray=lib -O2 -lcaf_shmem compilation failed to produce executable | ... and 153 more
Used configuration : *CI config* tcwg_gnu_cross_check_gcc master-aarch64 *configure and test flags:* --target aarch64-linux-gnu
We track this bug report under https://linaro.atlassian.net/browse/GNU-1860. Please let us know if you have a fix.
If you have any questions regarding this report, please ask on linaro-toolchain@lists.linaro.org mailing list.
-----------------8<--------------------------8<--------------------------8<--------------------------
The information below contains the details of the failures, and the ways to reproduce a debug environment:
You can find the failure logs in *.log.1.xz files in
https://ci.linaro.org/job/tcwg_gnu_cross_check_gcc--master-aarch64-build/261... The full lists of regressions and improvements as well as configure and make commands are in
https://ci.linaro.org/job/tcwg_gnu_cross_check_gcc--master-aarch64-build/261... The list of [ignored] baseline and flaky failures are in
https://ci.linaro.org/job/tcwg_gnu_cross_check_gcc--master-aarch64-build/261...
Current build : https://ci.linaro.org/job/tcwg_gnu_cross_check_gcc--master-aarch64-build/261... Reference build : https://ci.linaro.org/job/tcwg_gnu_cross_check_gcc--master-aarch64-build/261...
Instruction to reproduce the build : https://gitlab.com/LinaroLtd/tcwg/ci/interesting-commits/-/raw/master/gcc/sh...
Full commit : See in git+ssh://linaroci@gcc.gnu.org/git/gcc.git
On 3/13/26 13:45, Andre Vehreschild wrote:
Hi all,
the linaro CI reported test errors for aarch64 targets. I figured that for aarch64 on linux the compile flags -pthread and -lrt are needed to link caf_shmem and produce an executable. The attached patch addresses this by special case for aarch64-*-linux* similiar to freebsd.
Amazing - I have been testing caf_shmem for weeks now (first as an additional patch and lately just by bootstrapping the master branch) on aarch64-linux and I have never encountered that problem.
Here's the latest test:
https://gcc.gnu.org/pipermail/gcc-testresults/2026-March/871293.html
Kind regards,
On Fri, Mar 13, 2026 at 02:51:06PM +0100, Toon Moene wrote:
the linaro CI reported test errors for aarch64 targets. I figured that for aarch64 on linux the compile flags -pthread and -lrt are needed to link caf_shmem and produce an executable. The attached patch addresses this by special case for aarch64-*-linux* similiar to freebsd.
Amazing - I have been testing caf_shmem for weeks now (first as an additional patch and lately just by bootstrapping the master branch) on aarch64-linux and I have never encountered that problem.
Here's the latest test:
https://gcc.gnu.org/pipermail/gcc-testresults/2026-March/871293.html
It is needed only for glibc older than 2.34. And it isn't arch related, just glibc version related.
Jakub
Hi Jakub and Richard,
I modified the patch to use -pthread -lcaf_shmem -lrt on all *-linux* based systems. I have re-tested on the aarch64 with an older glibc and x86_64 with a recent one. Both regtest w/o errors.
I am wondering, if there shouldn't be some configure or tcl magic to compute the dependencies for pthreads and shm_open() calls consistently instead of having to guess them. I mean, libgomp uses pthreads, too. And code duplication is always a bad idea.
Ok for mainline?
- Andre
On Fri, 13 Mar 2026 15:00:10 +0100 Jakub Jelinek jakub@redhat.com wrote:
On Fri, Mar 13, 2026 at 02:51:06PM +0100, Toon Moene wrote:
the linaro CI reported test errors for aarch64 targets. I figured that for aarch64 on linux the compile flags -pthread and -lrt are needed to link caf_shmem and produce an executable. The attached patch addresses this by special case for aarch64-*-linux* similiar to freebsd.
Amazing - I have been testing caf_shmem for weeks now (first as an additional patch and lately just by bootstrapping the master branch) on aarch64-linux and I have never encountered that problem.
Here's the latest test:
https://gcc.gnu.org/pipermail/gcc-testresults/2026-March/871293.html
It is needed only for glibc older than 2.34. And it isn't arch related, just glibc version related.
Jakub
Sorry, previous patch had -lrt missing. I should have checked before sending. Therefore now here the correct patch.
- Andre
On Fri, 13 Mar 2026 16:22:41 +0100 Andre Vehreschild vehre@gmx.de wrote:
Hi Jakub and Richard,
I modified the patch to use -pthread -lcaf_shmem -lrt on all *-linux* based systems. I have re-tested on the aarch64 with an older glibc and x86_64 with a recent one. Both regtest w/o errors.
I am wondering, if there shouldn't be some configure or tcl magic to compute the dependencies for pthreads and shm_open() calls consistently instead of having to guess them. I mean, libgomp uses pthreads, too. And code duplication is always a bad idea.
Ok for mainline?
- Andre
On Fri, 13 Mar 2026 15:00:10 +0100 Jakub Jelinek jakub@redhat.com wrote:
On Fri, Mar 13, 2026 at 02:51:06PM +0100, Toon Moene wrote:
the linaro CI reported test errors for aarch64 targets. I figured that for aarch64 on linux the compile flags -pthread and -lrt are needed to link caf_shmem and produce an executable. The attached patch addresses this by special case for aarch64-*-linux* similiar to freebsd.
Amazing - I have been testing caf_shmem for weeks now (first as an additional patch and lately just by bootstrapping the master branch) on aarch64-linux and I have never encountered that problem.
Here's the latest test:
https://gcc.gnu.org/pipermail/gcc-testresults/2026-March/871293.html
It is needed only for glibc older than 2.34. And it isn't arch related, just glibc version related.
Jakub
On Fri, Mar 13, 2026 at 04:25:37PM +0100, Andre Vehreschild wrote:
Andre Vehreschild * Email: vehre ad gmx dot de
From ed6f79a7c238608ad9900826d8ee33d4bd13b586 Mon Sep 17 00:00:00 2001
From: Andre Vehreschild vehre@gcc.gnu.org Date: Fri, 13 Mar 2026 12:24:41 +0100 Subject: [PATCH] Fortran: Fix caf-tests on older glibcs [PR124484]
gcc/testsuite/ChangeLog:
PR Fortran/124484
- gfortran.dg/coarray/caf.exp: Add -pthread and -lrt for
*-linux* targets for caf_shmem testing.
I think the pre-commit hook will reject the above, maybe you need to move the for word from the first line to the start of second, as it might be unhappy the line starts with tab * but isn't followed by space.
Otherwise LGTM.
--- a/gcc/testsuite/gfortran.dg/coarray/caf.exp +++ b/gcc/testsuite/gfortran.dg/coarray/caf.exp @@ -123,7 +123,11 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.[fF]{,90,95,03,08} ]] if { [istarget *-*-freebsd*] } { dg-test $test "-fcoarray=lib -pthread $flags -lcaf_shmem" {} } else {
dg-test $test "-fcoarray=lib $flags -lcaf_shmem" {}
if { [istarget *-linux*] } {dg-test $test "-fcoarray=lib -pthread $flags -lcaf_shmem -lrt" {}} else {dg-test $test "-fcoarray=lib $flags -lcaf_shmem" {}} } cleanup-modules "" }-- 2.53.0
Jakub
Hi Jakub,
thanks for the quick review.
I have commit as gcc-16-8081-g5cd67ad86920
with the changelog changed to:
Fortran: Fix caf-tests on older glibcs [PR124484]
gcc/testsuite/ChangeLog:
PR testsuite/124484 * gfortran.dg/coarray/caf.exp: Add -pthread and -lrt for *-linux* targets for caf_shmem testing.
Regards, Andre
On Fri, 13 Mar 2026 16:31:20 +0100 Jakub Jelinek jakub@redhat.com wrote:
On Fri, Mar 13, 2026 at 04:25:37PM +0100, Andre Vehreschild wrote:
Andre Vehreschild * Email: vehre ad gmx dot de
From ed6f79a7c238608ad9900826d8ee33d4bd13b586 Mon Sep 17 00:00:00 2001
From: Andre Vehreschild vehre@gcc.gnu.org Date: Fri, 13 Mar 2026 12:24:41 +0100 Subject: [PATCH] Fortran: Fix caf-tests on older glibcs [PR124484]
gcc/testsuite/ChangeLog:
PR Fortran/124484
- gfortran.dg/coarray/caf.exp: Add -pthread and -lrt for
*-linux* targets for caf_shmem testing.
I think the pre-commit hook will reject the above, maybe you need to move the for word from the first line to the start of second, as it might be unhappy the line starts with tab * but isn't followed by space.
Otherwise LGTM.
--- a/gcc/testsuite/gfortran.dg/coarray/caf.exp +++ b/gcc/testsuite/gfortran.dg/coarray/caf.exp @@ -123,7 +123,11 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.[fF]{,90,95,03,08} ]] if { [istarget *-*-freebsd*] } { dg-test $test "-fcoarray=lib -pthread $flags -lcaf_shmem" {} } else {
dg-test $test "-fcoarray=lib $flags -lcaf_shmem" {}
if { [istarget *-linux*] } {dg-test $test "-fcoarray=lib -pthread $flags-lcaf_shmem -lrt" {}
} else {dg-test $test "-fcoarray=lib $flags -lcaf_shmem" {}} } cleanup-modules "" }-- 2.53.0
Jakub
On 3/13/26 16:47, Andre Vehreschild wrote:
Hi Jakub,
Otherwise LGTM.
--- a/gcc/testsuite/gfortran.dg/coarray/caf.exp +++ b/gcc/testsuite/gfortran.dg/coarray/caf.exp @@ -123,7 +123,11 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.[fF]{,90,95,03,08} ]] if { [istarget *-*-freebsd*] } { dg-test $test "-fcoarray=lib -pthread $flags -lcaf_shmem" {} } else {
dg-test $test "-fcoarray=lib $flags -lcaf_shmem" {}
if { [istarget *-linux*] } {dg-test $test "-fcoarray=lib -pthread $flags-lcaf_shmem -lrt" {}
} else {dg-test $test "-fcoarray=lib $flags -lcaf_shmem" {}} } cleanup-modules "" }
I was a bit doubtful that unconditionally adding -ptrhead -rt to every linux target out there would work, but apparently it did - my test this afternoon (Debian Testing as of March 2 with glibc-2.42 on aarch64):
https://gcc.gnu.org/pipermail/gcc-testresults/2026-March/871462.html
=== gfortran Summary ===
# of expected passes 74474 # of expected failures 345 # of unsupported tests 208 /dev/shm/bld701060/gcc/gfortran version 16.0.1 20260314 (experimental) [master r16-8091-g4f9e2843084] (GCC)
Kind regards,
linaro-toolchain@lists.linaro.org