]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Ignore target feature flags in _AC_FC_LIBRARY_LDFLAGS (#111353)
authorJan André Reuter <j.reuter@fz-juelich.de>
Wed, 3 Dec 2025 11:59:43 +0000 (12:59 +0100)
committerZack Weinberg <zack@owlfolio.org>
Tue, 27 Jan 2026 21:25:54 +0000 (16:25 -0500)
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 <j.reuter@fz-juelich.de>.

* lib/autoconf/fortran.m4 (_AC_FC_LIBRARY_LDFLAGS): Skip arguments
  immediately following ‘-target-feature’.

lib/autoconf/fortran.m4

index 87e00cc670a2e86b8d3d19f6b61857f0adf2c063..5d34f11828078c6a7e4a05b411afa436abdb8f2b 100644 (file)
@@ -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