commit:     d863cc9d8ea3722e0ecd6c17e89d88830b45f4fb
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 13 12:58:55 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Thu Sep 14 20:39:35 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d863cc9d

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 <AT> gentoo.org>

 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 2990b41a9e95..18f317e32e16 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 <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

Reply via email to