From 39c32f4d5dca9f6293fccb69e9d50baf494c8de4 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 12 Dec 2024 02:01:24 +0000 Subject: gentoo auto-resync : 12:12:2024 - 02:01:23 --- eclass/qt6-build.eclass | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'eclass/qt6-build.eclass') diff --git a/eclass/qt6-build.eclass b/eclass/qt6-build.eclass index 3d3531dd96d5..f8161447074a 100644 --- a/eclass/qt6-build.eclass +++ b/eclass/qt6-build.eclass @@ -156,6 +156,8 @@ qt6-build_src_configure() { # 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 + # ...but dev messages are noisy and not really useful downstream + -Wno-dev # see _qt6-build_create_user_facing_links -DINSTALL_PUBLICBINDIR="${QT6_PREFIX}"/bin # note that if qtbase was built with tests, this is default ON @@ -309,12 +311,16 @@ _qt6-build_sanitize_cpu_flags() { avx512vp2intersect ) + local sanitize + # 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, 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 + is-flagq "@($(IFS='|'; echo "${cpuflags[*]/#/-mno-}"))" && sanitize=1 + + # 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 + if [[ ! -v sanitize ]]; then + local 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) || \ @@ -324,11 +330,27 @@ _qt6-build_sanitize_cpu_flags() { EOF pipestatus || die )" - [[ ${_} == bad ]] && bad=1 && break + if [[ ${_} == bad ]]; then + sanitize=1 + break + fi done - [[ -v bad ]] || return 0 # *should* be fine as-is fi + # some cpus have broken rdrand/rdseed and it's enabled regardless + # with -march=native, Qt detects this and fails (bug #922498) + if [[ ! -v sanitize ]] && + ! tc-is-cross-compiler && + # the kernel also detects this and removes it from cpuinfo + [[ -r /proc/cpuinfo && $(