Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 950314 - dev-qt/qtbase-6.8.2-r2 makes the toolchain execute the build target's tools for building.
Summary: dev-qt/qtbase-6.8.2-r2 makes the toolchain execute the build target's tools f...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords: PullRequest, REGRESSION
Depends on:
Blocks:
 
Reported: 2025-02-26 15:45 UTC by dE
Modified: 2025-03-03 22:39 UTC (History)
3 users (show)

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


Attachments
kuserfeedback failed build log with qtbase-6.8.2-r2 (kuserfeedback-6.10.0-build.log,26.58 KB, text/x-log)
2025-02-26 15:48 UTC, dE
Details
kquickcharts failed build log with qtbase-6.8.2-r2 (kquickcharts-6.10.0-build.log,4.15 KB, text/x-log)
2025-02-26 15:49 UTC, dE
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dE 2025-02-26 15:45:56 UTC
dev-qt/qtbase-6.8.2-r2 is such that once any package while building against it executes the target's toolchain binaries instead of the build host's toolchain's binary.

Attached is the failed build log of kquickcharts-6.10.0 while cross compiling. The toolchain requires qtpaths which is executed as follows -- 
Incompatible processor. This Qt build requires the following features:
    waitpkg gfni vaes
CMake Warning at /usr/share/ECM/modules/ECMQueryQt.cmake:95 (message):
  Failed call: /usr/x86_64-mypc-linux-gnu/usr/lib64/qt6/bin/qtpaths --query
  
The toolchain must execute /usr/lib64/qt6/bin/qtpaths instead of /usr/x86_64-mypc-linux-gnu/usr/lib64/qt6/bin/qtpaths. /usr/x86_64-mypc-linux-gnu/ is a foreign system maintained by crossdev which is incompatible with the build host.

Attached is another failed build log of kuserfeedback-6.10.0 with similar problems -- 
/usr/x86_64-mypc-linux-gnu/usr/lib64/qt6/bin/lrelease -removeidentical -nounfinished -silent /tmp/portage/kde-frameworks/kuserfeedback-6.10.0/work/kuserfeedback-6.10.0_build/ECMPoQm/bg/userfeedbackconsole6_qt.ts -qm /tmp/portage/kde-frameworks/kuserfeedback-6.10.0/work/kuserfeedback-6.10.0_build/ECMPoQm/bg/userfeedbackconsole6_qt.qm
Incompatible processor. This Qt build requires the following features:
    waitpkg gfni vaes
    
Note the /usr/x86_64-mypc-linux-gnu/ prefix of lrelease.

Removing the following block from dev-qt/qtbase-6.8.2-r2's ebuild (introduced with qtbase-6.8.2-r2) -- 
tc-is-cross-compiler && mycmakeargs+=(

and rebuilding qtbase along with all dev-qt/* packages resolve the issue.
Comment 1 dE 2025-02-26 15:48:24 UTC
Created attachment 919936 [details]
kuserfeedback failed build log with qtbase-6.8.2-r2
Comment 2 dE 2025-02-26 15:49:15 UTC
Created attachment 919937 [details]
kquickcharts failed build log with qtbase-6.8.2-r2
Comment 3 James Le Cuirot gentoo-dev 2025-02-26 19:03:34 UTC
I'm a bit surprised by that. We have seen some leakage of the SYSROOT, but this is in qmake-specific files, nothing that CMake would touch. I'll look into it though.
Comment 4 James Le Cuirot gentoo-dev 2025-02-26 23:43:35 UTC
I haven't been able to reproduce this with either package, at least when using cross-boss. I'll take another look soon.
Comment 5 dE 2025-02-27 06:52:39 UTC
In CMakeCache.txt there is -- 
Qt6CoreTools_DIR:PATH=/usr/x86_64-mypc-linux-gnu/usr/lib64/cmake/Qt6CoreTools
Qt6_DIR:PATH=/usr/x86_64-mypc-linux-gnu/usr/lib64/cmake/Qt6

cb-emerge results in the same error.
Comment 6 Ionen Wolkens gentoo-dev 2025-02-27 09:21:36 UTC
Note that dE been known to set some *ROOT variable (I forgot what exactly) themselves and it may not be a normal cross setup if can't reproduce.
Comment 7 dE 2025-02-27 11:19:32 UTC
(In reply to Ionen Wolkens from comment #6)
> Note that dE been known to set some *ROOT variable (I forgot what exactly)
> themselves and it may not be a normal cross setup if can't reproduce.

This is plane crossdev. It automatically uses those variables.

earlier I was using emerge with those variables set manually.
Comment 8 dE 2025-02-27 11:27:52 UTC
The difference is that this installation was migrated from a 'real' gentoo install. But this was done a long time back. Multiple upgrades have been commenced since then.
Comment 9 James Le Cuirot gentoo-dev 2025-03-01 14:17:45 UTC
I didn't expect it, but I've managed to reproduce this with plain crossdev.
Comment 10 James Le Cuirot gentoo-dev 2025-03-01 18:16:58 UTC
It's something to do with these differences:
> -CMake Debug Log at /usr/aarch64-unknown-linux-gnu/usr/lib64/cmake/Qt6/Qt6Config.cmake:200 (find_package):
> +CMake Debug Log at /mnt/quartz/usr/lib64/cmake/Qt6/Qt6Config.cmake:200 (find_package):
>    The internally managed CMAKE_FIND_PACKAGE_REDIRECTS_DIR.
>  
>      /var/tmp/portage/kde-frameworks/kuserfeedback-6.11.0/work/kuserfeedback-6.11.0_build/CMakeFiles/pkgRedirects
> @@ -1094,7 +1094,7 @@
>  
>    Paths specified by the find_package PATHS option.
>  
> -    /usr/aarch64-unknown-linux-gnu/usr/lib64/cmake
> +    /mnt/quartz/usr/lib64/cmake
>      /usr/lib64/cmake
>  
>    Prepending the following roots to each prefix:
> @@ -1113,18 +1113,18 @@
>  
>    CMAKE_SYSROOT
>  
> -    /usr/aarch64-unknown-linux-gnu
> +    /mnt/quartz
>  
>    find_package considered the following locations for Qt6CoreTools's Config
>    module:
>  
> -    /usr/aarch64-unknown-linux-gnu/usr/lib64/cmake/Qt6CoreToolsConfig.cmake
> -    /usr/aarch64-unknown-linux-gnu/usr/lib64/cmake/qt6coretools-config.cmake
> -    /usr/aarch64-unknown-linux-gnu/usr/lib64/cmake/Qt6CoreTools/Qt6CoreToolsConfig.cmake
> +    /usr/lib64/cmake/Qt6CoreToolsConfig.cmake
> +    /usr/lib64/cmake/qt6coretools-config.cmake
> +    /usr/lib64/cmake/Qt6CoreTools/Qt6CoreToolsConfig.cmake
>  
>    The file was found at
>  
> -    /usr/aarch64-unknown-linux-gnu/usr/lib64/cmake/Qt6CoreTools/Qt6CoreToolsConfig.cmake
> +    /usr/lib64/cmake/Qt6CoreTools/Qt6CoreToolsConfig.cmake

Notice how find_package "considers" /usr/aarch64-unknown-linux-gnu in the broken case but / in the working case. I just don't know why! Everything else I can see is the same.
Comment 11 James Le Cuirot gentoo-dev 2025-03-01 22:31:54 UTC
Hah! It's because /usr/aarch64-unknown-linux-gnu is under /usr. If I bind mount /mnt/quartz to /usr/quartz and build against that, it fails in the same way! Now what to do about that...
Comment 12 James Le Cuirot gentoo-dev 2025-03-01 22:43:25 UTC
Adding "set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)" to the toolchain file gets it past that point, but then it fails later. Even if it worked, I don't think we want to do that.
Comment 13 James Le Cuirot gentoo-dev 2025-03-01 23:06:47 UTC
Appending /lib64 to this path in /usr/aarch64-unknown-linux-gnu/usr/lib64/cmake/Qt6/Qt6Config.cmake "fixes" it. Perhaps there's a better way.

>         list(PREPEND CMAKE_FIND_ROOT_PATH "${QT_HOST_PATH}/lib64"
>             ${_qt_additional_host_packages_root_paths})
Comment 14 James Le Cuirot gentoo-dev 2025-03-02 15:16:01 UTC
Proposed fix on the way, just testing it out.
Comment 15 Larry the Git Cow gentoo-dev 2025-03-03 22:39:09 UTC
The bug has been closed via the following commit(s):

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

commit 34215c570dac0cf122f3d0e54209f061c5d6264f
Author:     James Le Cuirot <chewi@gentoo.org>
AuthorDate: 2025-03-02 22:42:38 +0000
Commit:     James Le Cuirot <chewi@gentoo.org>
CommitDate: 2025-03-03 22:38:19 +0000

    dev-qt/qtbase: Patch Qt6Config.cmake to fix cross-compiling other packages
    
    It's a long story involving CMAKE_FIND_ROOT_PATH. See the patch for details.
    
    Closes: https://bugs.gentoo.org/950314
    Closes: https://github.com/gentoo/gentoo/pull/40856
    Signed-off-by: James Le Cuirot <chewi@gentoo.org>

 dev-qt/qtbase/files/qtbase-6.8.2-cross.patch | 36 ++++++++++++++++++++++++++++
 dev-qt/qtbase/qtbase-6.8.2-r2.ebuild         |  1 +
 dev-qt/qtbase/qtbase-6.8.9999.ebuild         |  1 +
 dev-qt/qtbase/qtbase-6.9.9999.ebuild         |  1 +
 dev-qt/qtbase/qtbase-6.9999.ebuild           |  1 +
 5 files changed, 40 insertions(+)