Hi gcc-patches mailing list, Peter0x44 via Sourceware Forge <[email protected]> has requested that the following forgejo pull request be published on the mailing list.
Created on: 2026-06-07 18:44:21+00:00 Latest update: 2026-07-04 13:45:25+00:00 Changes: 2 changed files, 2 additions, 2 deletions Head revision: Peter0x44/gcc-TEST ref libgomp-gfortran-path commit 421b440ad352a4267fa664ecf26a36f5d7b56395 Base revision: gcc/gcc-TEST ref trunk commit 9c36ceaacc080a70f3f664a2eb5f9b32227f5cf5 r17-2138-g9c36ceaacc080a Merge base: 9c36ceaacc080a70f3f664a2eb5f9b32227f5cf5 Full diff url: https://forge.sourceware.org/gcc/gcc-TEST/pulls/172.diff Discussion: https://forge.sourceware.org/gcc/gcc-TEST/pulls/172 Requested Reviewers: The gfortran detection logic in libgomp's configure uses "test -x" to check whether the $GFORTRAN program is executable. However, "test -x" only succeeds for absolute or relative paths that name an existing file; it fails for bare program names (e.g. "x86_64-w64-mingw32-gfortran") that are found via $PATH lookup. This causes FC to be incorrectly set to "no" in cross-compilation environments where $GFORTRAN is a bare command name rather than a full path. As a result, the Fortran OpenMP module (omp_lib.mod) is never installed, and programs that "use omp_lib" fail with: Fatal Error: Cannot open module file 'omp_lib.mod' for reading The fix adds a "command -v" fallback for testing whether a command is available on $PATH. The bug was introduced in r0-98199-g2122aa973ed (2010-01-26), so the Fortran OpenMP module has been missing from cross-compiled installs for 16 years. libgomp/ChangeLog: * configure.ac: Also accept $GFORTRAN when it can be found via PATH lookup using "command -v", not only when "test -x" succeeds on the bare name. * configure: Regenerate. Changed files: - M: libgomp/configure - M: libgomp/configure.ac Peter Damianov (1): libgomp: Fix gfortran detection when program is found via PATH libgomp/configure | 2 +- libgomp/configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Range-diff against v1: 1: 34e539bd4b21 = 1: 421b440ad352 libgomp: Fix gfortran detection when program is found via PATH -- 2.54.0
