From d863cc9d8ea3722e0ecd6c17e89d88830b45f4fb Mon Sep 17 00:00:00 2001 From: Ionen Wolkens Date: Wed, 13 Sep 2023 08:58:55 -0400 Subject: [PATCH] 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 --- eclass/qt6-build.eclass | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eclass/qt6-build.eclass b/eclass/qt6-build.eclass index 2990b41a9e959..18f317e32e165 100644 --- a/eclass/qt6-build.eclass +++ b/eclass/qt6-build.eclass @@ -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 #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