diff options
Diffstat (limited to 'eclass/qt6-build.eclass')
-rw-r--r-- | eclass/qt6-build.eclass | 46 |
1 files changed, 34 insertions, 12 deletions
diff --git a/eclass/qt6-build.eclass b/eclass/qt6-build.eclass index 24b857dab53f..2dec4b7ec14e 100644 --- a/eclass/qt6-build.eclass +++ b/eclass/qt6-build.eclass @@ -59,17 +59,22 @@ if [[ ${PV} == *.9999 ]]; then else QT6_BUILD_TYPE=release _QT6_SRC=official + _QT6_SUBDIR= if [[ ${PV} == *_@(alpha|beta|rc)* ]]; then QT6_BUILD_TYPE=pre-release _QT6_SRC=development + + # TODO?: drop _QT6_SUBDIR if no longer used for 6.9, unknown + # if this was a one-time mistake or a permanent change + ver_test ${PV} -ge 6.8 && _QT6_SUBDIR=src/ fi _QT6_P=${QT6_MODULE}-everywhere-src-${PV/_/-} - SRC_URI="https://download.qt.io/${_QT6_SRC}_releases/qt/${PV%.*}/${PV/_/-}/submodules/${_QT6_P}.tar.xz" + SRC_URI="https://download.qt.io/${_QT6_SRC}_releases/qt/${PV%.*}/${PV/_/-}/${_QT6_SUBDIR}submodules/${_QT6_P}.tar.xz" S=${WORKDIR}/${_QT6_P} - unset _QT6_P _QT6_SRC + unset _QT6_P _QT6_SRC _QT6_SUBDIR fi readonly QT6_BUILD_TYPE @@ -147,6 +152,9 @@ qt6-build_src_configure() { fi local defaultcmakeargs=( + # cmake defaults to "STATUS" but Qt changes that to "NOTICE" which + # hides a lot of information that is useful for bug reports + --log-level=STATUS # see _qt6-build_create_user_facing_links -DINSTALL_PUBLICBINDIR="${QT6_PREFIX}"/bin # note that if qtbase was built with tests, this is default ON @@ -293,18 +301,31 @@ _qt6-build_sanitize_cpu_flags() { fma4 sse4a ) + # extras for which -mno-* does not matter, but can lead to enabling + # other flags when set and breaking the -march=haswell case below + # (add more as needed if users use these) + local cpuflags_filter_only=( + avx512vp2intersect + ) + # check if any known problematic -mno-* C(XX)FLAGS if ! is-flagq "@($(IFS='|'; echo "${cpuflags[*]/#/-mno-}"))"; then - # check if qsimd_p.h (search for "enable all") will accept -march - : "$($(tc-getCXX) -E -P ${CXXFLAGS} ${CPPFLAGS} - <<-EOF | tail -n 1 - #if (defined(__AVX2__) && (__BMI__ + __BMI2__ + __F16C__ + __FMA__ + __LZCNT__ + __POPCNT__) != 6) || \ - (defined(__AVX512F__) && (__AVX512BW__ + __AVX512CD__ + __AVX512DQ__ + __AVX512VL__) != 4) - bad - #endif - EOF - assert - )" - [[ ${_} == bad ]] || return 0 # *should* be fine as-is + # check if qsimd_p.h (search for "enable all") will accept -march, and + # further check when -march=haswell is appended (which Qt uses for some + # parts) given combination with other -m* could lead to partial support + local bad flags + for flags in '' '-march=haswell'; do + : "$($(tc-getCXX) -E -P ${CXXFLAGS} ${CPPFLAGS} ${flags} - <<-EOF | tail -n 1 + #if (defined(__AVX2__) && (__BMI__ + __BMI2__ + __F16C__ + __FMA__ + __LZCNT__ + __POPCNT__) != 6) || \ + (defined(__AVX512F__) && (__AVX512BW__ + __AVX512CD__ + __AVX512DQ__ + __AVX512VL__) != 4) + bad + #endif + EOF + assert + )" + [[ ${_} == bad ]] && bad=1 && break + done + [[ -v bad ]] || return 0 # *should* be fine as-is fi # determine highest(known) usable x86-64 feature level @@ -324,6 +345,7 @@ _qt6-build_sanitize_cpu_flags() { assert ) + cpuflags+=("${cpuflags_filter_only[@]}") filter-flags '-march=*' "${cpuflags[@]/#/-m}" "${cpuflags[@]/#/-mno-}" [[ ${march} == x86-64* ]] && append-flags $(test-flags-CXX -march=${march}) einfo "C(XX)FLAGS were adjusted due to Qt limitations: ${CXXFLAGS}" |