Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 649406 - dev-qt/qtcore-5.9.4-r2: fails to build on FreeBSD due to using clang implicitly
Summary: dev-qt/qtcore-5.9.4-r2: fails to build on FreeBSD due to using clang implicitly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: Normal normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-02 21:06 UTC by Michał Górny
Modified: 2018-03-12 00:50 UTC (History)
1 user (show)

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


Attachments
dev-qt:qtcore-5.9.4-r2:20180302-204458.log.xz (dev-qt:qtcore-5.9.4-r2:20180302-204458.log.xz,21.55 KB, application/x-xz)
2018-03-02 21:06 UTC, Michał Górny
Details
e-info.txt (e-info.txt,4.38 KB, text/plain)
2018-03-02 21:07 UTC, Michał Górny
Details
Potential fix (qt.patch,1.30 KB, patch)
2018-03-03 03:19 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-03-02 21:06:16 UTC
Created attachment 521974 [details]
dev-qt:qtcore-5.9.4-r2:20180302-204458.log.xz

* Running emake INSTALL_ROOT=/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/image/ sub-qmake-qmake-aux-pro-install_subtargets install_syncqt install_mkspecs
gmake -j1 INSTALL_ROOT=/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/image/ sub-qmake-qmake-aux-pro-install_subtargets install_syncqt install_mkspecs 
cd qmake/ && ( test -e Makefile.qmake-aux || /var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/bin/qmake -o Makefile.qmake-aux /var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/qmake/qmake-aux.pro ) && gmake -f Makefile.qmake-aux install
gmake[1]: Entering directory '/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/qmake'
gmake binary
gmake[2]: Entering directory '/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/qmake'
clang++ -c -o qlibraryinfo_final.o   -std=c++11 -ffunction-sections  -I/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/qmake -I/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/qmake/library -I/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/qmake/generators -I/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/qmake/generators/unix -I/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/qmake/generators/win32 -I/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/qmake/generators/mac -I/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/include -I/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/include/QtCore -I/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/include/QtCore/5.9.4 -I/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/include/QtCore/5.9.4/QtCore -I../src/corelib/global -I/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/mkspecs/freebsd-clang -DQT_VERSION_STR=\"5.9.4\" -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=9 -DQT_VERSION_PATCH=4 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_FOREACH /var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/src/corelib/global/qlibraryinfo.cpp
In file included from /var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/src/corelib/global/qlibraryinfo.cpp:41:
In file included from /var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/include/QtCore/qdir.h:1:
In file included from /var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/include/QtCore/../../src/corelib/io/qdir.h:43:
In file included from /var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/include/QtCore/qstring.h:1:
In file included from /var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/include/QtCore/../../src/corelib/tools/qstring.h:48:
In file included from /var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/include/QtCore/qchar.h:1:
In file included from /var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/include/QtCore/../../src/corelib/tools/qchar.h:43:
In file included from /var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/include/QtCore/qglobal.h:1:
/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/include/QtCore/../../src/corelib/global/qglobal.h:45:12: fatal error: 
      'type_traits' file not found
#  include <type_traits>
           ^
1 error generated.
gmake[2]: *** [Makefile:272: qlibraryinfo_final.o] Error 1
gmake[2]: Leaving directory '/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/qmake'
gmake[1]: *** [Makefile.qmake-aux:239: /var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/qmake/qmake] Error 2
gmake[1]: Leaving directory '/var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/qmake'
gmake: *** [Makefile:136: sub-qmake-qmake-aux-pro-install_subtargets] Error 2


The compiler used for the build is gcc, and so here gcc should be used as well.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-03-02 21:07:38 UTC
Created attachment 521976 [details]
e-info.txt
Comment 2 Davide Pesavento (RETIRED) gentoo-dev 2018-03-02 21:42:50 UTC
I'm actually surprised it got that far, I don't think anybody has ever tried building on freebsd in a serious way.

From the build log:

> FreeBSD 10 autotools fix applied to /var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/configure

What does this do exactly? Qt configure is not autotools-generated.

> Build type: freebsd-clang (x86_64, CPU features: mmx sse sse2)

The eclass needs to force 'freebsd-g++' if the compiler is gcc. I suspected this was going to be an issue since there's no explicit mkspec handling in the eclass.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-03-02 21:46:10 UTC
(In reply to Davide Pesavento from comment #2)
> I'm actually surprised it got that far, I don't think anybody has ever tried
> building on freebsd in a serious way.
> 
> From the build log:
> 
> > FreeBSD 10 autotools fix applied to /var/tmp/portage/dev-qt/qtcore-5.9.4-r2/work/qtbase-opensource-src-5.9.4/configure
> 
> What does this do exactly? Qt configure is not autotools-generated.

Nothing in this case, I suppose. It calls some eltpatch magic that does nothing if no patch applies.


Curious enough, if I uninstall clang altogether I get:

Project ERROR: Cannot run compiler 'clang++'. Output:
===================
sh: clang++: not found
===================
Maybe you forgot to setup the environment?
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-03-02 22:12:03 UTC
(In reply to Davide Pesavento from comment #2)
> The eclass needs to force 'freebsd-g++' if the compiler is gcc. I suspected
> this was going to be an issue since there's no explicit mkspec handling in
> the eclass.

Could you estimate how hard it would be to fix and what would be the ETA for some fix? I'm trying to fix depgraph breakage on amd64-fbsd and to do that, I either need to keyword qt5 or dekeyword kdelibs & revdeps, so I'd like to know which way to go.
Comment 5 Arfrever Frehtes Taifersar Arahesis 2018-03-03 03:19:44 UTC
Created attachment 521982 [details, diff]
Potential fix

This patch (for qt.git repository) might help.
(Only tested with dev-qt/qtcore-5.11.9999 on Linux.)
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-03-03 08:09:49 UTC
I suppose that could work. I guess it will still use random 'g++' instead of my CXX, correct?
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-03-03 09:19:59 UTC
I can confirm that the attached patch make Qt5 build on FreeBSD.
Comment 8 Arfrever Frehtes Taifersar Arahesis 2018-03-04 03:24:49 UTC
(In reply to Michał Górny from comment #6)
> I guess it will still use random 'g++' instead of my CXX, correct?

In minimal number of places (as described in bug #649420).

It is still a good idea to pass -platform option since qmake configuration files set slightly differing flags for GCC and Clang:
https://code.qt.io/cgit/qt/qtbase.git/tree/mkspecs/common/g++-base.conf
https://code.qt.io/cgit/qt/qtbase.git/tree/mkspecs/common/clang.conf
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-03-04 08:18:57 UTC
It would be even better to come up with our own platform that overrides upstream customizations and fully respects all system variables.
Comment 10 Davide Pesavento (RETIRED) gentoo-dev 2018-03-06 05:29:32 UTC
(In reply to Michał Górny from comment #9)
> It would be even better to come up with our own platform that overrides
> upstream customizations and fully respects all system variables.

We cannot do that. Many qmake project files match against the mkspec name to do conditional things, so a custom mkspec name would break pretty much everything.

Nevertheless, qt5-build.eclass tries to respect all build flags. Needless to say, that's always the ultimate goal. But the build system is complex and changes in incompatible ways almost at each release, for instance there was a major overhaul in 5.8 and I don't think we're 100% done adapting our eclass/ebuilds yet. And then there's the chronic lack of manpower...
Comment 11 Larry the Git Cow gentoo-dev 2018-03-07 12:47:23 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/qt.git/commit/?id=c0679fd90abb0e90205754a2e41bcb3dc97e31e5

commit c0679fd90abb0e90205754a2e41bcb3dc97e31e5
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
AuthorDate: 2018-03-03 03:15:19 +0000
Commit:     Michael Palimaka <kensington@gentoo.org>
CommitDate: 2018-03-07 12:47:13 +0000

    qt5-build.eclass: Pass -platform option to configure on FreeBSD and Linux.
    
    Bug: https://bugs.gentoo.org/649406

 eclass/qt5-build.eclass | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)}
Comment 12 Michael Palimaka (kensington) gentoo-dev 2018-03-07 12:49:01 UTC
I modified the patch to apply to 5.10 and later and pushed to the overlay for testing.
Comment 13 Davide Pesavento (RETIRED) gentoo-dev 2018-03-08 06:24:47 UTC
We could unconditionally apply *only the freebsd portion* to gentoo.git, so that mgorny can continue his testing/keywording on amd64-fbsd. The rest can wait, to avoid disrupting 5.9.4 stabilization.
Comment 14 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-03-08 18:02:26 UTC
(In reply to Davide Pesavento from comment #13)
> We could unconditionally apply *only the freebsd portion* to gentoo.git, so
> that mgorny can continue his testing/keywording on amd64-fbsd. The rest can
> wait, to avoid disrupting 5.9.4 stabilization.

That would work for me, thanks.
Comment 15 Larry the Git Cow gentoo-dev 2018-03-10 01:55:53 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/qt.git/commit/?id=2387fb8372d617c08ad5a63404c1699cd0a0d3b5

commit 2387fb8372d617c08ad5a63404c1699cd0a0d3b5
Author:     Michael Palimaka <kensington@gentoo.org>
AuthorDate: 2018-03-10 01:54:38 +0000
Commit:     Michael Palimaka <kensington@gentoo.org>
CommitDate: 2018-03-10 01:55:44 +0000

    qt5-build.eclass: remove version conditional for passing -platform on freebsd
    
    Bug: https://bugs.gentoo.org/649406

 eclass/qt5-build.eclass | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)}
Comment 16 Larry the Git Cow gentoo-dev 2018-03-12 00:50:08 UTC
The bug has been closed via the following commit(s):

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

commit dc29c68cf0dc302a94d1e1f11c95a6e17511381b
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
AuthorDate: 2018-03-03 03:15:19 +0000
Commit:     Michael Palimaka <kensington@gentoo.org>
CommitDate: 2018-03-12 00:49:53 +0000

    qt5-build.eclass: Pass -platform option to configure on FreeBSD and Linux.
    
    Closes: https://bugs.gentoo.org/649406

 eclass/qt5-build.eclass | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)