diff options
author | Ionen Wolkens <ionen@gentoo.org> | 2024-05-09 04:19:17 -0400 |
---|---|---|
committer | Ionen Wolkens <ionen@gentoo.org> | 2024-05-09 08:12:58 -0400 |
commit | 754d6f5226a532ed086afa276b48e89ffafe0484 (patch) | |
tree | f400c7bf02ef5653ec6ba787b1f1dfa4b14149ec /dev-qt | |
parent | sys-process/systemd-cron: Stabilize 2.4.0 ppc, #931626 (diff) | |
download | gentoo-754d6f5226a532ed086afa276b48e89ffafe0484.tar.gz gentoo-754d6f5226a532ed086afa276b48e89ffafe0484.tar.bz2 gentoo-754d6f5226a532ed086afa276b48e89ffafe0484.zip |
dev-qt/qtwebengine: improve clang-18 workaround w/ -mevex512 (qt6)
Hoping it will be a short-lived and that this will be improved/fixed
in clang itself.
(have not tried nor looked at qtwebengine:5)
For some rough explanation from the little I get from this:
clang-18 added -mevex512 (missing from 17), and then -march=native
is a bit quirky in that unlike -march=exact it goes out of its way
to disable it resulting in e.g.
-march=skylake -mavx512f = -mevex512 is auto-enabled
-march=skylake -mevex512 = not "enabled" but can be used
-march=native(skylake) -mavx512f = forced off(!)
And then units that use avx512 / pass -mavx512f (for use with runtime
cpu detection) end in build failure without evex512.
Always passing -mevex512 on a machine without avx512 "seems" safe,
it does not even set __EVEX512__ and believe won't use any avx512
instructions on a whim (__EVEX512__ does get set if add -mavx512f).
Or at least my skylake (not skylake-x) passes test + can use the
qtwebengine built that way.
Considered passing only for files that need it at first with a patch
(sounded safer), but chromium's Gn files don't have a variable to test
clang version that I could see (or at least not in old qtwebengine) and
didn't want this to become more involved nor use conditional patching.
The !avx512 check may not be super necessary, but have not dug into
the implications of forcing it when avx512 is actually enabled (sounds
there are cases where it needs to be off, leaving it to compiler).
Bug: https://bugs.gentoo.org/931623
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'dev-qt')
-rw-r--r-- | dev-qt/qtwebengine/qtwebengine-6.7.0.ebuild | 18 | ||||
-rw-r--r-- | dev-qt/qtwebengine/qtwebengine-6.7.9999.ebuild | 18 | ||||
-rw-r--r-- | dev-qt/qtwebengine/qtwebengine-6.9999.ebuild | 18 |
3 files changed, 21 insertions, 33 deletions
diff --git a/dev-qt/qtwebengine/qtwebengine-6.7.0.ebuild b/dev-qt/qtwebengine/qtwebengine-6.7.0.ebuild index 0829dcfa3b22..cccffedf5380 100644 --- a/dev-qt/qtwebengine/qtwebengine-6.7.0.ebuild +++ b/dev-qt/qtwebengine/qtwebengine-6.7.0.ebuild @@ -239,19 +239,15 @@ src_configure() { # for simplicity. Override with USE=custom-cflags if wanted, please # report if above -march works again so can cleanup. use arm64 && tc-is-gcc && filter-flags '-march=*' '-mcpu=*' - - # skia and xnnpack fail with clang-18 + some(?) -march=native while - # can't reproduce with seemingly equivalent =skylake), needs more - # looking into as there may be something odd going on (clang bug?). - # Note that upstream Qt disallows custom *FLAGS on qtwebengine meaning - # we are not supposed to pass -march=native in the first place. - # TODO: try dropping this on major Qt and clang bumps - # See also: https://groups.google.com/g/skia-discuss/c/DNW4oq3W2fI - # (Transform_inl.h:769:21: error: AVX vector <snip> without 'evex512') - use amd64 && tc-is-clang && [[ $(clang-major-version) -ge 18 ]] && - filter-flags -march=native fi + # Workaround for build failure with clang-18 and -march=native without + # avx512. Does not affect e.g. -march=skylake, only native (bug #931623). + use amd64 && tc-is-clang && is-flagq -march=native && + [[ $(clang-major-version) -ge 18 ]] && + tc-cpp-is-true "!defined(__AVX512F__)" ${CXXFLAGS} && + append-flags -mevex512 + export NINJA NINJAFLAGS=$(get_NINJAOPTS) [[ ${NINJA_VERBOSE^^} == OFF ]] || NINJAFLAGS+=" -v" diff --git a/dev-qt/qtwebengine/qtwebengine-6.7.9999.ebuild b/dev-qt/qtwebengine/qtwebengine-6.7.9999.ebuild index 750f700160b2..bba17446d874 100644 --- a/dev-qt/qtwebengine/qtwebengine-6.7.9999.ebuild +++ b/dev-qt/qtwebengine/qtwebengine-6.7.9999.ebuild @@ -236,19 +236,15 @@ src_configure() { # for simplicity. Override with USE=custom-cflags if wanted, please # report if above -march works again so can cleanup. use arm64 && tc-is-gcc && filter-flags '-march=*' '-mcpu=*' - - # skia and xnnpack fail with clang-18 + some(?) -march=native while - # can't reproduce with seemingly equivalent =skylake), needs more - # looking into as there may be something odd going on (clang bug?). - # Note that upstream Qt disallows custom *FLAGS on qtwebengine meaning - # we are not supposed to pass -march=native in the first place. - # TODO: try dropping this on major Qt and clang bumps - # See also: https://groups.google.com/g/skia-discuss/c/DNW4oq3W2fI - # (Transform_inl.h:769:21: error: AVX vector <snip> without 'evex512') - use amd64 && tc-is-clang && [[ $(clang-major-version) -ge 18 ]] && - filter-flags -march=native fi + # Workaround for build failure with clang-18 and -march=native without + # avx512. Does not affect e.g. -march=skylake, only native (bug #931623). + use amd64 && tc-is-clang && is-flagq -march=native && + [[ $(clang-major-version) -ge 18 ]] && + tc-cpp-is-true "!defined(__AVX512F__)" ${CXXFLAGS} && + append-flags -mevex512 + export NINJA NINJAFLAGS=$(get_NINJAOPTS) [[ ${NINJA_VERBOSE^^} == OFF ]] || NINJAFLAGS+=" -v" diff --git a/dev-qt/qtwebengine/qtwebengine-6.9999.ebuild b/dev-qt/qtwebengine/qtwebengine-6.9999.ebuild index 750f700160b2..bba17446d874 100644 --- a/dev-qt/qtwebengine/qtwebengine-6.9999.ebuild +++ b/dev-qt/qtwebengine/qtwebengine-6.9999.ebuild @@ -236,19 +236,15 @@ src_configure() { # for simplicity. Override with USE=custom-cflags if wanted, please # report if above -march works again so can cleanup. use arm64 && tc-is-gcc && filter-flags '-march=*' '-mcpu=*' - - # skia and xnnpack fail with clang-18 + some(?) -march=native while - # can't reproduce with seemingly equivalent =skylake), needs more - # looking into as there may be something odd going on (clang bug?). - # Note that upstream Qt disallows custom *FLAGS on qtwebengine meaning - # we are not supposed to pass -march=native in the first place. - # TODO: try dropping this on major Qt and clang bumps - # See also: https://groups.google.com/g/skia-discuss/c/DNW4oq3W2fI - # (Transform_inl.h:769:21: error: AVX vector <snip> without 'evex512') - use amd64 && tc-is-clang && [[ $(clang-major-version) -ge 18 ]] && - filter-flags -march=native fi + # Workaround for build failure with clang-18 and -march=native without + # avx512. Does not affect e.g. -march=skylake, only native (bug #931623). + use amd64 && tc-is-clang && is-flagq -march=native && + [[ $(clang-major-version) -ge 18 ]] && + tc-cpp-is-true "!defined(__AVX512F__)" ${CXXFLAGS} && + append-flags -mevex512 + export NINJA NINJAFLAGS=$(get_NINJAOPTS) [[ ${NINJA_VERBOSE^^} == OFF ]] || NINJAFLAGS+=" -v" |