[Bug libgomp/41418] Can't build libgomp without --enable-languages=fortran

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41418

--- Comment #24 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Thomas Schwinge <[email protected]>:

https://gcc.gnu.org/g:e5efa9eff99da897f0bbd69455d8f7856985b2db

commit r17-3286-ge5efa9eff99da897f0bbd69455d8f7856985b2db
Author: Thomas Schwinge <[email protected]>
Date:   Tue Jul 28 20:46:16 2026 +0200

    libgomp: Revise libgomp/Fortran support conditionals

    Subversion r152931 (Git commit 0046b1a727f73f0848733e28219069426b2dc218)
    "Fix libgomp without --enable-languages=fortran", and its follow-up
    Subversion r156232 (Git commit d0709b6aeec6b00e71011502fa311751fc138147)
    "configure.ac: Test for executability of GFORTRAN",
    Subversion r156264 (Git commit 2122aa973ed2c829caee5b010a60ad01922a3650)
    "configure.ac: Test for executability of _the first word_ of GFORTRAN"
    fixed the libgomp target library build in case that
    '--enable-languages=fortran' was not in effect: in that case, disable
    libgomp/Fortran support.

    These changes certainly do the right thing in GCC configurations where
    '$GFORTRAN' would be expected to be "just compiled" (built with the GCC
    top-level build system).  However, in case that it's "pre-installed"
(provided
    externally, as determined by the GCC top-level build system), these changes
    didn't work, and instead kept libgomp/Fortran support disabled, instead of
    enabling it.  "Pre-installed" 'GFORTRAN="x86_64-w64-mingw32-gfortran
[...]"' is
    not accepted by the current 'test -x [...]' check, for instance, as
discussed
    in "libgomp: Fix gfortran detection when program is found via PATH",
    <https://inbox.sourceware.org/[email protected]>
    <https://forge.sourceware.org/gcc/gcc/pulls/172>,
   
<https://inbox.sourceware.org/bmm.hj9f44xa6a.gcc.gcc-TEST.Peter0x44.172.1.0@forge-stage.sourceware.org>.

    That proposed "libgomp: Fix gfortran detection when program is found via
PATH"
    patch has the issue that it picks up the "gfortran [...] found via PATH"
also
    in the case when GCC is configured without '--enable-languages=fortran' in
    effect, and it then still builds and installs the libgomp/Fortran support
files
    in GCC configurations without Fortran support enabled.

    Instead of "libgomp: Fix gfortran detection when program is found via PATH"
as
    proposed, we may revise libgomp/Fortran support conditionals generally, and
    handle that in a conceptually simpler way: revert the three aforementioned
    commits (in other words: simply again assign 'FC="$GFORTRAN"' (like
    'libgfortran/configure.ac' also is doing), and conditionalize 'USE_FORTRAN'
on
    whether '--enable-languages=fortran' is in effect.  In other words: in case
    that '--enable-languages=fortran' is in effect, assume that the
    'GFORTRAN=[...]' passed to the libgomp build is functional -- no matter
where
    it's coming from: "just compiled" or "pre-installed".

            PR libgomp/41418
            libgomp/
            * configure.ac (FC): Revert ealier changes; just set to
'"$GFORTRAN"'.
            (USE_FORTRAN): Conditionalize on '--enable-languages=fortran' being
in
            effect.
            * configure: Regenerate.

    Reported-by: Peter Damianov <[email protected]>
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.