Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 933374 - dev-qt/qtmultimedia-6.7.0 fails to build qvideoframeconversionhelper_avx2.cpp (due to *FLAGS mismatch between binhost's qtbase and self-built qtmultimedia)
Summary: dev-qt/qtmultimedia-6.7.0 fails to build qvideoframeconversionhelper_avx2.cpp...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-01 17:05 UTC by Shiba
Modified: 2024-06-02 08:22 UTC (History)
2 users (show)

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


Attachments
emerge.log (emerge.log,6.91 KB, text/x-log)
2024-06-01 17:07 UTC, Shiba
Details
build.log (build.log,225.63 KB, text/x-log)
2024-06-01 17:07 UTC, Shiba
Details
build.log (march=x86-64) (build.log,327.39 KB, text/x-log)
2024-06-01 18:05 UTC, Shiba
Details
build.log (march=x86-64-v2) (build.log,225.88 KB, text/x-log)
2024-06-02 07:16 UTC, Shiba
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shiba 2024-06-01 17:05:57 UTC
I have a hunch this looks similar to https://bugs.gentoo.org/908420. Everything build fine when compiling with -march=x86-64 (but it fails with x86-64-v2 too).
Comment 1 Shiba 2024-06-01 17:07:07 UTC
Created attachment 894882 [details]
emerge.log
Comment 2 Shiba 2024-06-01 17:07:23 UTC
Created attachment 894883 [details]
build.log
Comment 3 Ionen Wolkens gentoo-dev 2024-06-01 17:19:58 UTC
Could you provide the successful build.log for qtbase? It *should* have disabled QT_FEATURE_avx2 and prevented this from being used in qtmultimedia unless I'm missing something.

On that note, did you use different *FLAGS for qtbase? Aka maybe you have some old workarounds in package.env? If want to use =native on other dev-qt/*, qtbase needs it as well. Mismatch is not something that can easily support here.
Comment 4 Ionen Wolkens gentoo-dev 2024-06-01 17:41:24 UTC
(In reply to Ionen Wolkens from comment #3)
> On that note, did you use different *FLAGS for qtbase? Aka maybe you have
> some old workarounds in package.env? If want to use =native on other
> dev-qt/*, qtbase needs it as well. Mismatch is not something that can easily
> support here.
(if you did, try to rebuild qtbase with -march=native, then qtmultimedia -- if it works then there's not really anything to do here)
Comment 5 Shiba 2024-06-01 18:05:08 UTC
Created attachment 894885 [details]
build.log (march=x86-64)
Comment 6 Shiba 2024-06-01 18:11:11 UTC
(In reply to Ionen Wolkens from comment #3)
> On that note, did you use different *FLAGS for qtbase? Aka maybe you have
> some old workarounds in package.env? If want to use =native on other
> dev-qt/*, qtbase needs it as well. Mismatch is not something that can easily
> support here.

I don't have lingering configs in package.env, but qtbase is definitely built with a different -march since it's from Gentoo's binhost (is it -march=x86-64?). However, my system doesn't support AVX2, so it shouldn't be pulled in by =native or am I missing something? x86-64-v2 too, which I also tried and failed.
Comment 7 Ionen Wolkens gentoo-dev 2024-06-01 18:15:48 UTC
(In reply to Shiba from comment #6)
> I don't have lingering configs in package.env, but qtbase is definitely
> built with a different -march since it's from Gentoo's binhost (is it
> -march=x86-64?).
Oh, binhost.. hadn't considered that. Not quite sure what to do about this at the moment.

It would work if you built qtbase yourself with -march=native anyhow.

> However, my system doesn't support AVX2, so it shouldn't be
> pulled in by =native or am I missing something? x86-64-v2 too, which I also
> tried and failed.
It's trying to build avx2 bits for runtime detection, but a workaround your cpu gets in the way because it doesn't expect a *FLAGS mismatch.
Comment 8 Ionen Wolkens gentoo-dev 2024-06-01 18:20:17 UTC
(In reply to Ionen Wolkens from comment #7)
> (In reply to Shiba from comment #6)
> > I don't have lingering configs in package.env, but qtbase is definitely
> > built with a different -march since it's from Gentoo's binhost (is it
> > -march=x86-64?).
> Oh, binhost.. hadn't considered that. Not quite sure what to do about this
> at the moment.
Maybe if could detect this situation and then would have little choice but to filter-out -march=native, but not quite sure how test for this in a simple way.

Alternatively could patch qtmultimedia not to rely on -march=haswell and actually pass -mavx2, albeit the issue may surface in other dev-qt/* package and is more of a bandaid.
Comment 9 Ionen Wolkens gentoo-dev 2024-06-01 18:32:40 UTC
(have to say it's tempting to just replace =native unconditionally then could remove all these workarounds, albeit given not an issue for most people it'd still be kind of unfortunate)
Comment 10 Ionen Wolkens gentoo-dev 2024-06-01 18:36:23 UTC
(In reply to Ionen Wolkens from comment #8)
> Maybe if could detect this situation and then would have little choice but
> to filter-out -march=native, but not quite sure how test for this in a
> simple way.
Actually, reading defines in qconfig_p.h may be enough. Not going to look at this now, but it may be manageable.
Comment 11 Ionen Wolkens gentoo-dev 2024-06-02 04:25:56 UTC
(In reply to Ionen Wolkens from comment #10)
> (In reply to Ionen Wolkens from comment #8)
> > Maybe if could detect this situation and then would have little choice but
> > to filter-out -march=native, but not quite sure how test for this in a
> > simple way.
> Actually, reading defines in qconfig_p.h may be enough. Not going to look at
> this now, but it may be manageable.
Or no, while it'd work this is all getting too hacky and hard to maintain. May use a different approach that detects unusual configurations and just force generic -march only for these.
Comment 12 Ionen Wolkens gentoo-dev 2024-06-02 05:41:00 UTC
(In reply to Shiba from comment #0)
> I have a hunch this looks similar to https://bugs.gentoo.org/908420.
> Everything build fine when compiling with -march=x86-64 (but it fails with
> x86-64-v2 too).
Did it really fail with -v2? That sounds odd, do you still have the build.log for that one?
Comment 13 Ionen Wolkens gentoo-dev 2024-06-02 05:49:01 UTC
(In reply to Ionen Wolkens from comment #12)
> (In reply to Shiba from comment #0)
> > I have a hunch this looks similar to https://bugs.gentoo.org/908420.
> > Everything build fine when compiling with -march=x86-64 (but it fails with
> > x86-64-v2 too).
> Did it really fail with -v2? That sounds odd, do you still have the
> build.log for that one?
No wait, nevermind -- I see why it would fail now.
Comment 14 Shiba 2024-06-02 07:16:11 UTC
Created attachment 894900 [details]
build.log (march=x86-64-v2)

Here's the log with x86-64-v2 anyway, just in case. I don't understand much about C/C++ and the likes so I can't directly help, but I can do all the tests you need. It might take me a while though, that PC is tackling py3.12 right now.
Comment 15 Larry the Git Cow gentoo-dev 2024-06-02 08:22:27 UTC
The bug has been closed via the following commit(s):

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

commit 3373a27c24cd4b06084f8e0ac9fb9d2a695ac214
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2024-06-02 07:08:01 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2024-06-02 08:22:07 +0000

    qt6-build.eclass: use different workaround for cpu flags issues
    
    This also replaces the nasty workaround from qtbase's ebuild
    on top of the function here.
    
    Should "hopefully" be far less error prone, while still allowing
    -march=native for people who aren't affected. Does mean slightly
    worse optimizations for those affected, but this still tries
    to use the highest x86-64-v* and should be insignificant.
    
    Tentative, can't fully test without having an affected cpu so
    may still need work.
    
    Closes: https://bugs.gentoo.org/933374
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 eclass/qt6-build.eclass | 87 ++++++++++++++++++++++++++++++++-----------------
 1 file changed, 58 insertions(+), 29 deletions(-)

Additionally, it has been referenced in the following commit(s):

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

commit 7b48b3f78072691a3e4170abfd150bdeea065f93
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2024-06-02 07:15:03 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2024-06-02 08:22:07 +0000

    dev-qt/qtbase: remove obsolete cpu feature workaround
    
    qt6-build.eclass does a different type of workaround,
    see the new _qt6-build_sanitize_cpu_flags function.
    
    Bug: https://bugs.gentoo.org/933374
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 dev-qt/qtbase/qtbase-6.7.0-r2.ebuild | 33 +--------------------------------
 dev-qt/qtbase/qtbase-6.7.1.ebuild    | 33 +--------------------------------
 dev-qt/qtbase/qtbase-6.7.9999.ebuild | 33 +--------------------------------
 dev-qt/qtbase/qtbase-6.9999.ebuild   | 33 +--------------------------------
 4 files changed, 4 insertions(+), 128 deletions(-)