Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 956750 - qt6-build.eclass: broken -march=x86-64-v4 detection with gcc 16
Summary: qt6-build.eclass: broken -march=x86-64-v4 detection with gcc 16
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Qt Bug Alias
URL: https://gcc.gnu.org/pipermail/gcc-cvs...
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-16
  Show dependency tree
 
Reported: 2025-05-28 16:23 UTC by Kostadin Shishmanov
Modified: 2025-05-29 02:47 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kostadin Shishmanov 2025-05-28 16:23:32 UTC
-march=native gets reduced down to -march=x86-64-v3 instead of -march=x86-64-v4 when using GCC 16 on my Ryzen 7 7800X3D, it's probably because the eclass checks for evex512 which got removed: https://gcc.gnu.org/pipermail/gcc-cvs/2025-May/423589.html
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-28 16:26:51 UTC
Didn't realise the eclass bit included that.
Comment 2 Ionen Wolkens gentoo-dev 2025-05-28 17:36:48 UTC
That was done by diffing x86-64-v3 with v4 and checking the differences to ensure passing -v4 does not enable anything that was disabled by *FLAGS.

That means may(?) need to check __EVEX512__ for old gcc still, passing x86-64-v4 would enable it when it's possibly not usable -- or is it safe to ignore it? Can't say I've read about evex512 much. Could just extend the test to check gcc version anyway.

Probably need to recheck what clang does too (it does have -mevex512).

I'll look at this a bit later though, on the bright side falling back to v3 is safe unlike wrongly detecting v4.
Comment 3 Ionen Wolkens gentoo-dev 2025-05-28 17:50:47 UTC
(In reply to Ionen Wolkens from comment #2)
> Probably need to recheck what clang does too (it does have -mevex512).
Well, did a quick look, and clang does set __EVEX512__ with -march=x86-64-v4 still, so only >=gcc-16 may need a special rule if want to stay safe and not do -v4 if it's missing.

Haven't checked gcc-16 itself though, will compile it later.
Comment 4 Ionen Wolkens gentoo-dev 2025-05-28 18:02:12 UTC
(In reply to Ionen Wolkens from comment #2)
> Could just extend the test to check gcc version anyway.
...an alternate option could be to live test the compiler to generate what to check, would future-proof (if e.g. clang drops it too) but may end up just being mostly unneeded complexity over little.
Comment 5 Larry the Git Cow gentoo-dev 2025-05-29 02:47:43 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f31b583e6e20a29b47b0cfb3a28b3dc2b2f215f6

commit f31b583e6e20a29b47b0cfb3a28b3dc2b2f215f6
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2025-05-29 02:31:30 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2025-05-29 02:45:22 +0000

    qt6-build.eclass: fix x86-64-v4 detection with gcc-16
    
    Could probably improve the detection method if needed, but going
    with the simplest solution unless there's more problems.
    
    May need to revisiting if clang follows suit to match gcc (or if
    gcc-16 changes something before release) given x86-64-v4 now means
    something different.
    
    Closes: https://bugs.gentoo.org/956750
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 eclass/qt6-build.eclass | 3 +++
 1 file changed, 3 insertions(+)