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’.
;;
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