qt6-build.eclass: skip matching fma in 6.5.3+

Should no longer hard fail if lack AVX2 while have FMA, however it does
(still) require to disable AVX2 if lacking anything else for any reason
(e.g. broken VMs, oddball hardware, perhaps even users intentionally
disabling a feature because they have a problem with it).

Generally few users should see their flags modified.

Feel the ideal would be for upstream to simply not use features that
are disabled rather than error about an incomplete set, or just not
use AVX2 if incomplete.

Bug: https://bugs.gentoo.org/898644
Bug: https://bugs.gentoo.org/908420
Bug: https://bugs.gentoo.org/913843
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
This commit is contained in:
Ionen Wolkens
2023-09-13 08:58:55 -04:00
parent 4d49088705
commit d863cc9d8e

View File

@@ -258,12 +258,13 @@ _qt6-build_match_cpu_flags() {
[[ ${intrin} ]] && flags+=( -mno-${intrin} )
done
done < <(
# TODO: review if can drop fma= matching after QTBUG-116357
# TODO: drop ver_test and ${fma} when <6.5.3 is gone
ver_test ${PV} -ge 6.5.3 && fma= || fma=fma
$(tc-getCXX) -E -P ${CXXFLAGS} ${CPPFLAGS} - <<-EOF | tail -n 2
#if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__))
#include <x86intrin.h>
#endif
avx2=__AVX2__ =__BMI__ =__BMI2__ =__F16C__ fma=__FMA__ =__LZCNT__ =__POPCNT__
avx2=__AVX2__ =__BMI__ =__BMI2__ =__F16C__ ${fma}=__FMA__ =__LZCNT__ =__POPCNT__
avx512f=__AVX512F__ avx512bw=__AVX512BW__ avx512cd=__AVX512CD__ avx512dq=__AVX512DQ__ avx512vl=__AVX512VL__
EOF
assert