Backport: Port AC_F77_LIBRARY_LDFLAGS to oneAPI HPC Toolkit

When compiling with ifx, a ./configure script generated by GNU Autconf
reports an error message similar to:

    checking for Fortran 77 libraries of ifx...  -loopopt=0 \
        -L/lib/../lib64 -L/lib/../lib64/ -L/usr/lib/../lib64 \
        -L/usr/lib/../lib64/ -L/lib64 -L/lib/ -L/usr/lib64 -L/usr/lib \
        -lifport -lifcoremt -limf -lsvml -lm -lipgo -lirc -lpthread \
        -lirc_s  -ldl
    configure: WARNING: FLIBS does not work
    checking for ifx flag to add single underscore to external names... none
    checking for dummy main to link with Fortran 77 libraries... unknown
    configure: error: in '/path/to/build/dir':
    configure: error: linking to Fortran libraries from C fails
    See `config.log' for more details
    make: *** [build/config.status] Error 1

Examining the config.log file shows that the error causing ./configure to exit was:

    ld: cannot find -loopopt=0

The patch drops the first 2 parameters passed to clang, i.e.:
`-mllvm -loopopt=0` parameters are dropped when checking for the libraries.

Resolves: RHEL-40719

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
Frédéric Bérat 2024-06-11 14:29:47 +02:00
parent 06c6890ed7
commit 18090ed2d8
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From ae26b9b44c183c41b84fc36ff70082713295d621 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 22 Jul 2020 12:56:19 -0700
Subject: [PATCH] Port AC_F77_LIBRARY_LDFLAGS to oneAPI HPC Toolkit
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Problem reported by Bill Dieter in:
https://lists.gnu.org/r/bug-autoconf/2020-07/msg00089.html
* lib/autoconf/fortran.m4 (_AC_FC_LIBRARY_LDFLAGS):
Defend against clang -mllvm -loopopt=0.
---
lib/autoconf/fortran.m4 | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4
index 0a0c4168..59a8859b 100644
--- a/lib/autoconf/fortran.m4
+++ b/lib/autoconf/fortran.m4
@@ -698,6 +698,7 @@ while test $[@%:@] != 1; do
-zallextract*| -zdefaultextract)
ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg"
;;
+ -mllvm) ${2+shift};; # Defend against 'clang -mllvm -loopopt=0'.
# Ignore everything else.
esac
done
--
2.45.0

View File

@ -6,7 +6,7 @@
Summary: A GNU tool for automatically configuring source code
Name: autoconf
Version: 2.69
Release: 29%{?dist}
Release: 29%{?dist}.1
License: GPLv2+ and GFDL
Source0: http://ftpmirror.gnu.org/autoconf/autoconf-%{version}.tar.xz
Source1: config.site
@ -14,6 +14,8 @@ Source2: autoconf-init.el
URL: http://www.gnu.org/software/autoconf/
Patch1: autoconf-2.69-perl-5.22-autoscan.patch
# Backport: see RHEL-40719
Patch2: 0001-Port-AC_F77_LIBRARY_LDFLAGS-to-oneAPI-HPC-Toolkit.patch
BuildArch: noarch
@ -135,6 +137,9 @@ fi
%changelog
* Wed Jun 12 2024 Frederic Berat <fberat@redhat.com> - 2.69-29.1
- Fix issues with Fortran detection and oneAPI HPC Toolkit (RHEL-40719)
* Mon Jun 28 2021 Honza Horak <hhorak@redhat.com> - 2.69-29
- Bump release number to avoid installing reverted RPM in CStream
Resolves: #1956598