diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-12-12 02:01:24 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-12-12 02:01:24 +0000 |
commit | 39c32f4d5dca9f6293fccb69e9d50baf494c8de4 (patch) | |
tree | ec772fdf23a7279a60e9063b01c2dc909741a197 /eclass/qt6-build.eclass | |
parent | 494ca58c9f5243dd4b56557aa8c41bce76e95ec3 (diff) |
gentoo auto-resync : 12:12:2024 - 02:01:23
Diffstat (limited to 'eclass/qt6-build.eclass')
-rw-r--r-- | eclass/qt6-build.eclass | 36 |
1 files changed, 29 insertions, 7 deletions
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 && $(</proc/cpuinfo) != *rdrand* ]] && + tc-cpp-is-true __RDRND__ ${CXXFLAGS} ${CPPFLAGS} + then + einfo "Detected CPU with (likely) broken rdrand/rdseed (bug #922498)" + sanitize=1 + fi + + [[ -v sanitize ]] || return 0 # *should* be fine as-is + # determine highest(known) usable x86-64 feature level local march=$( $(tc-getCXX) -E -P ${CXXFLAGS} ${CPPFLAGS} - <<-EOF | tail -n 1 |