From: Jan André Reuter Date: Wed, 3 Dec 2025 11:59:43 +0000 (+0100) Subject: Ignore target feature flags in _AC_FC_LIBRARY_LDFLAGS (#111353) X-Git-Tag: v2.72.90~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=16de3c26a54dced1d1ef548de7bd4aa45ea2a773;p=thirdparty%2Fautoconf.git Ignore target feature flags in _AC_FC_LIBRARY_LDFLAGS (#111353) Ignore target specific feature flags passed via '-target-feature'. When encountered, ignore the flag passed after. These flags might contain a '-l', e.g. '-target-feature -lwp', causing non-existent libraries to be picked up, failing later checks, or the build of the application. This can e.g. be encountered when '-march=native' is passed to configure during a build with LLVM on Zen 4 machines. Reported by, and patch written by, Jan André Reuter . * lib/autoconf/fortran.m4 (_AC_FC_LIBRARY_LDFLAGS): Skip arguments immediately following ‘-target-feature’. --- diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4 index 87e00cc67..5d34f1182 100644 --- a/lib/autoconf/fortran.m4 +++ b/lib/autoconf/fortran.m4 @@ -676,6 +676,12 @@ while test $[@%:@] != 1; do ;; esac ;; + -target-feature) + # for target specific feature flags, ignore the next argument, + # which may include a feature starting with -l + # (e.g -target-feature -lwp) + shift; + ;; -[[LRuYz]]) # These flags, when seen by themselves, take an argument. # We remove the space between option and argument and re-iterate