Created attachment 197800 [details] patch compiler:c++17-lang, usual treatment. Tested on powerpc64 and amd64. Hardware sponsored by IntegriCloud.
Have you ever checked why these need c++17 and not 11? Mfg Tobias
(In reply to Tobias C. Berner from comment #1) They require it, because Qt's build system adds -std=c++1z to compilation flags. I didn't push it further, if it says it needs c++1z (which is C++17), then so be it.
Hm, interesting, I was under the impression that it only requires c++11. I'll do some investigating, and then commit the bunch... Mfg Tobias
I think this does not address the right issue -- it should not require anything higher than c++11 to build Qt5. So something probably goes wrong in the configure script, which is what we need to fix. mfg Tobias
Created attachment 197852 [details] build log from powerpc64 For reference, I'm attaching a build log which clearly shows added -std=c++1z.
I'm not doubting it adds it. The problem is it adds it, because you build it with a compiler that supports it (I think [tm]). But that should not "force" c++17 on the rest of the builders. We need to see how to tell qmake to ignore the spec, and only use c++11, when building the qt5-* ports. mfg Tobias
As the build already pulls in the right gcc, I think it should be save to just set USES=c++11-lang. Could you test?
(In reply to Tobias C. Berner from comment #7) Yes, it works. You can just as well put c++11-lang. It works the same in that it forces GCC 7, but in the present state, it's a lie (the port uses C++17).
(In reply to Piotr Kubaj from comment #8) I would prefer if the "forcing" is done explicitely in the change to qt-dist.mk/qt5-qmake by depending on a specific [possibly configurable] version of gcc -- not via USES=compiler.
(In reply to Tobias C. Berner from comment #9) Using USES has the advantage that we get newer GCC when the default version in ports is changed. Anyway, do you suggest we add our own BUILD_DEPENDS and LIB_DEPENDS entries for newer GCC?
The thing is, Qt does not care about the compiler you give it, but will use the compiler from the mkspec generally. So we need to make sure that we depend on that one, when USES=qmake is present. This is what I was suggesting in the qt5-qmake PR 231542.
(In reply to Tobias C. Berner from comment #6) wr/t forcing c++17 onto kde5 on the rest of the builders: - kde5 does not build on mips64 due to wayland - kde5 does not build on armv6 due to plasma5-kinfocenter - kde5 does not build on aarch64 due to grantlee5 some IMHO we're optimizing for what are already nonworking cases. I haven't done the research to figure out if the dependencies already depend on gcc7 on mips64, but I am going to assume so. I'm back working on FreeBSD after a few days away. I'll try to come up with a gerernal patch, but I think we're making extra work for ourselves.
(In reply to Mark Linimon from comment #12) I do _not_ want c++17 added (as that might imply additional dependencies on older clang systems). I would prefer just to add USES=c++11-lang/lib to all the qt5 ports if that is enough.
(In reply to Mark Linimon from comment #12) The general patch would be to add USES to qt-dist.mk. I didn't want to do it, since I thought there may be some Qt5 ports that would compile with base GCC. I can see it was rather futile now. We could add USES=c++11-lang to qt-dist.mk along with EXTRA_PATCHES (or USE_GCC, like you said in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231542 ). (In reply to Tobias C. Berner from comment #13) Just want to note that the only "older clang system" right now is 10.4-RELEASE which will go EOL in 24 days. Still, I don't mind it myself if you just put compiler:c++11-lang. Regarding Qt not caring about CC and CXX - my patch at https://bz-attachments.freebsd.org/attachment.cgi?id=197515 already takes care of that (seding QMAKE_* values)
(In reply to Piotr Kubaj from comment #14) With that sed you just set what it cares about. But if you decide that you now want GCC_DEFAULT=9 aftwards, you'll still be building qt with the gcc7 you had previously when building qmake. But the minimal approach with these patches, using c++11-lib and adding USE_GCC seems like the most appropriate fix at the moment -- if it works, that is :)
(In reply to Tobias C. Berner from comment #15) https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231542#c11 You can change GCC version via make.conf. This approach works, yes. Could you commit it?
Piotr, could you send me a single diff, of the changes in the qt5-* ports and qt*mk files? mfg Tobias
Created attachment 197906 [details] big patch Here's a complete (as of now) patch. Note that as I fix ports, another ports dependant on the fixed ones try to build, so there will be more fixes. This patch also contains fixes for some other ports maintained by @kde. The full list of patched ports: accessibility/qt5-speech archivers/quazip comms/qt5-sensors comms/qt5-serialport databases/qt5-sql devel/qscintilla2-qt5 devel/qt5 devel/qt5-assistant devel/qt5-buildtools devel/qt5-concurrent devel/qt5-core devel/qt5-dbus devel/qt5-designer devel/qt5-help devel/qt5-linguisttools devel/qt5-location devel/qt5-qdbus devel/qt5-qmake devel/qt5-script devel/qt5-scripttools devel/qt5-testlib devel/qt5-uitools graphics/qt5-imageformats graphics/qt5-opengl graphics/qt5-svg lang/qt5-qml multimedia/phonon multimedia/qt5-multimedia net-im/telepathy-qt4 net/qoauth-qt5 net/qt5-network print/qt5-printsupport sysutils/qt5-qtpaths sysutils/signon-plugin-oauth2 sysutils/signon-qt5 textproc/qt5-xml textproc/qt5-xmlpatterns www/qt5-webchannel x11-themes/kf5-breeze-icons x11-toolkits/qt5-gui x11-toolkits/qt5-quick x11-toolkits/qt5-quickcontrols x11-toolkits/qt5-quickcontrols2 x11-toolkits/qt5-virtualkeyboard x11-toolkits/qt5-widgets x11/qt5-x11extras
(In reply to Tobias C. Berner from comment #17) Any info about committing this patch? I already have other ports to fix, but I'd like to get this committed first.
A commit references this bug: Author: tcberner Date: Sun Oct 14 08:01:25 UTC 2018 New revision: 482034 URL: https://svnweb.freebsd.org/changeset/ports/482034 Log: qt5: Fix build on GCC based architectures. PR: 231584 PR: 231677 PR: 231685 PR: 231830 PR: 231955 PR: 231905 PR: 231892 PR: 231684 PR: 231958 PR: 231960 PR: 231818 PR: 231542 PR: 231860 PR: 231681 PR: 231963 PR: 231891 PR: 231966 PR: 231904 PR: 231676 PR: 231819 PR: 231956 PR: 231680 PR: 231957 PR: 231903 PR: 231901 PR: 231667 PR: 231861 Submitted by: Piotr Kubaj <pkubaj@anongoth.pl> Changes: head/Mk/Uses/qt-dist.mk head/accessibility/qt5-speech/Makefile head/comms/qt5-sensors/Makefile head/comms/qt5-serialport/Makefile head/databases/qt5-sql/Makefile head/devel/qt5/Makefile.sqldrivers head/devel/qt5/files/extra-patch-mkspecs_common_g++-base.conf head/devel/qt5/files/extra-patch-mkspecs_common_gcc-base.conf head/devel/qt5-assistant/Makefile head/devel/qt5-buildtools/Makefile head/devel/qt5-concurrent/Makefile head/devel/qt5-core/Makefile head/devel/qt5-dbus/Makefile head/devel/qt5-designer/Makefile head/devel/qt5-help/Makefile head/devel/qt5-linguisttools/Makefile head/devel/qt5-location/Makefile head/devel/qt5-qdbus/Makefile head/devel/qt5-qmake/Makefile head/devel/qt5-script/Makefile head/devel/qt5-scripttools/Makefile head/devel/qt5-testlib/Makefile head/devel/qt5-uitools/Makefile head/graphics/qt5-imageformats/Makefile head/graphics/qt5-opengl/Makefile head/graphics/qt5-svg/Makefile head/lang/qt5-qml/Makefile head/multimedia/qt5-multimedia/Makefile head/net/qt5-network/Makefile head/print/qt5-printsupport/Makefile head/sysutils/qt5-qtpaths/Makefile head/textproc/qt5-xml/Makefile head/textproc/qt5-xmlpatterns/Makefile head/www/qt5-webchannel/Makefile head/x11/qt5-x11extras/Makefile head/x11-toolkits/qt5-gui/Makefile head/x11-toolkits/qt5-quick/Makefile head/x11-toolkits/qt5-quickcontrols/Makefile head/x11-toolkits/qt5-quickcontrols2/Makefile head/x11-toolkits/qt5-virtualkeyboard/Makefile head/x11-toolkits/qt5-widgets/Makefile
Committed. Thanks