On a system with sys-devel/gcc-config[-native-symlinks] I see qmake-based packages fail to configure. Small example is dev-util/xxdif: """ >>> Preparing source in /tmp/portage/dev-util/xxdiff-4.0.1_p20170622-r2/work/xxdiff-4.0.1_p20170622 ... * Applying xxdiff-4.0.1-no-throw-in-dtor.patch ... [ ok ] * Applying xxdiff-4.0.1_p20170622-cxx11.patch ... [ ok ] >>> Source prepared. /tmp/portage/dev-util/xxdiff-4.0.1_p20170622-r2/work/xxdiff-4.0.1_p20170622 /tmp/portage/dev-util/xxdiff-4.0.1_p20170622-r2/work/xxdiff-4.0.1_p20170622 [master baaf6d4] state after src_prepare() 2 files changed, 1 insertion(+), 2 deletions(-) /tmp/portage/dev-util/xxdiff-4.0.1_p20170622-r2/work/xxdiff-4.0.1_p20170622 >>> Configuring source in /tmp/portage/dev-util/xxdiff-4.0.1_p20170622-r2/work/xxdiff-4.0.1_p20170622 ... * Running qmake ... Project ERROR: Cannot run compiler 'g++'. Output: =================== =================== Maybe you forgot to setup the environment? """ I don't have g++ and it should not matter. Eclass tries to override it with QMAKE_CXX="$(tc-getCXX)", but qmake somehow ignores it. AFAIU the error comes from qtcore's mkspecs/features/toolchain.pri. It tries to use $QMAKE_CXX consistently but something goes wrong there. Could be eclass problem?
If I understand qmake correctly minimal reproducer is: """ $ touch a.pro $ qmake -makefile QMAKE_CXX=x86_64-pc-linux-gnu-g++ QMAKE_HOST_CXX=x86_64-pc-linux-gnu-g++ Project ERROR: Cannot run compiler 'g++'. Output: =================== =================== Maybe you forgot to setup the environment? """
(In reply to Sergei Trofimovich from comment #0) > I don't have g++ and it should not matter. Eclass tries to override it with > QMAKE_CXX="$(tc-getCXX)", but qmake somehow ignores it. The override used to work a few Qt versions ago but upstream may have changed something that broke it without us noticing.
(In reply to Sergei Trofimovich from comment #1) > If I understand qmake correctly minimal reproducer is: > > """ > $ touch a.pro > $ qmake -makefile QMAKE_CXX=x86_64-pc-linux-gnu-g++ Just to be clear, we will not change qmake's default behavior outside of portage. It will still invoke g++ by default. Ebuilds that use eqmake5 should respect CXX however (and that's what this bug is about).
(In reply to Davide Pesavento from comment #3) > (In reply to Sergei Trofimovich from comment #1) > > If I understand qmake correctly minimal reproducer is: > > > > """ > > $ touch a.pro > > $ qmake -makefile QMAKE_CXX=x86_64-pc-linux-gnu-g++ > Just to be clear, we will not change qmake's default behavior outside of > portage. It will still invoke g++ by default. Ebuilds that use eqmake5 > should respect CXX however (and that's what this bug is about). Sounds perfect.
Maybe backport this?: https://codereview.qt-project.org/c/qt/qtbase/+/255135/2/configure
I think the default comes from /usr/lib64/qt5/mkspecs/common/g++-base.conf: QMAKE_CXX = $${CROSS_COMPILE}g++ If I change it manually qmak seems to accept new compiler. But I don't know how to pass CROSS_COMPILE directly. Environment variable or an argument to -makefile does not seem to work.
*** Bug 731762 has been marked as a duplicate of this bug. ***
*** Bug 809116 has been marked as a duplicate of this bug. ***