Bug 210327 - devel/qmake5: USES=compiler:c++14-lang adds -std=c++11, not -std=c++14 to CXXFLAGS in qmake build
Summary: devel/qmake5: USES=compiler:c++14-lang adds -std=c++11, not -std=c++14 to CXX...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-kde (group)
URL:
Keywords: easy, needs-qa, patch
Depends on:
Blocks:
 
Reported: 2016-06-16 17:19 UTC by Yuri Victorovich
Modified: 2016-08-25 07:42 UTC (History)
4 users (show)

See Also:
rakuco: merge-quarterly+


Attachments
example port reproducing issue (2.42 KB, text/plain)
2016-06-17 21:39 UTC, Yuri Victorovich
no flags Details
experimental patch to devel/qmake5 (845 bytes, patch)
2016-06-18 06:59 UTC, Tobias Berner
rakuco: maintainer-approval-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2016-06-16 17:19:39 UTC
Port requiring c++14 features fails to build because these USES statements:

> USES=        compiler:c++14-lang gmake qmake
> USE_QT5= core gui network

add -std=c++11, not -std=c++14 to the command lines, as is expected. Compiler is clang36.

Not sure if Qt has to do with this. This is a pretty bad problem because c++14 is a major feature that is supposed to be supported.
Comment 1 Antoine Brodin freebsd_committer freebsd_triage 2016-06-16 18:50:16 UTC
This works fine here with USE_CXXSTD=c++14 ,  do you have local patches?

USES=        compiler:c++14-lang gmake qmake
USE_QT5= core gui network
USE_CXXSTD= c++14

% make -VCXXFLAGS
-O2 -pipe  -fstack-protector -fno-strict-aliasing  -std=c++14
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2016-06-16 19:16:37 UTC
No local patches, and the output of 'make -VCXXFLAGS' is the same. No mention of c++11 after 'make extract patch', but the actual command lines have -std=c++11:

> /usr/local/bin/clang++36 -c -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer -std=c++14 -DDILAY_VERSION=\"1.5.0\" -DGLM_FORCE_RADIANS -DNDEBUG -Wno-unused-parameter -Wno-unused-variable -Wno-maybe-uninitialized -fPIC -std=c++11 -Wall -W -pthread -D_THREAD_SAFE -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_OPENGLEXTENSIONS_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_CORE_LIB -I. -Isrc -I/usr/local/include/qt5 -I/usr/local/include/qt5/QtOpenGL -I/usr/local/include/qt5/QtWidgets -I/usr/local/include/qt5/QtOpenGLExtensions -I/usr/local/include/qt5/QtGui -I/usr/local/include/qt5/QtXml -I/usr/local/include/qt5/QtCore -Imoc -I/usr/local/include -I/usr/local/include -I/usr/local/lib/qt5/mkspecs/freebsd-clang -o obj/src/affected-faces.o src/affected-faces.cpp
Comment 3 Thierry Thomas freebsd_committer freebsd_triage 2016-06-16 19:41:56 UTC
(In reply to yuri from comment #2)
That could be caused by /usr/local/lib/qt5/mkspecs/common/clang.conf (included from /usr/local/lib/qt5/mkspecs/freebsd-clang/qmake.conf ), because it contains:

QMAKE_CXXFLAGS_CXX11             = -std=c++11
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 2016-06-16 21:44:22 UTC
Thanks Thierry,

Removing this line helps. So this is really a bug in qt5-qmake-5.5.1
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2016-06-16 22:57:24 UTC
The workaround for this is:
> QMAKE_ARGS+=    QMAKE_CXXFLAGS_CXX11=

But the problem needs to be fixed.
Comment 6 Thierry Thomas freebsd_committer freebsd_triage 2016-06-17 20:14:09 UTC
Assign to the maintainer of devel/qmake5.
Comment 7 Tobias Berner 2016-06-17 21:13:08 UTC
Just to make it easier investigate this issue.
Which port are you talking about?
Comment 8 Yuri Victorovich freebsd_committer freebsd_triage 2016-06-17 21:39:42 UTC
Created attachment 171524 [details]
example port reproducing issue

It isn't yet released, attaching the shar.
Please remove QMAKE_ARGS+= workaround line to observe the problem.
Comment 9 Tobias Berner 2016-06-18 06:59:05 UTC
Created attachment 171535 [details]
experimental patch to devel/qmake5

Could you add the attached [experimental] patch to your devel/qmake5 and try again with a rebuilt qmake5?
Comment 10 Yuri Victorovich freebsd_committer freebsd_triage 2016-06-18 07:22:37 UTC
Yes, this patch fixes the problem.
Comment 11 Raphael Kubo da Costa freebsd_committer freebsd_triage 2016-08-23 18:33:01 UTC
Comment on attachment 171535 [details]
experimental patch to devel/qmake5

I've just spoken to tcberner on IRC about this. Since our clang is recent enough, it should pass the original version check there, so the problem is elsewhere: Qt's configure script was using something like "clang -v 2>&1 | sed -E '/^clang version .../....'" to obtain clang's version number and, since our clang reports itself as "FreeBSD clang" instead of "clang" QT_CLANG_{MAJOR,MINOR}_VERSION" were never defined.

I've just submitted https://codereview.qt-project.org/#/c/168916/ upstream to fix the issue and will backport it once it gets reviewed.
Comment 12 commit-hook freebsd_committer freebsd_triage 2016-08-24 08:13:06 UTC
A commit references this bug:

Author: rakuco
Date: Wed Aug 24 08:12:35 UTC 2016
New revision: 420773
URL: https://svnweb.freebsd.org/changeset/ports/420773

Log:
  Import upstream patch to fix the detection of clang's version number.

  Our clang reports itself as "FreeBSD clang version x.y.z" instead of just
  "clang version x.y.z", which was preventing the sed pattern used in the
  configure script from matching and thus QT_CLANG_MAJOR_VERSION and
  QT_CLANG_MINOR_VERSION were never defined. One of the consequences is that
  tests for those values in mkspecs later always failed, which led to some
  features such as C++14 support being disabled.

  PR:		210327
  MFH:		2016Q3

Changes:
  head/devel/qmake5/Makefile
  head/devel/qmake5/files/patch-configure
Comment 13 commit-hook freebsd_committer freebsd_triage 2016-08-25 07:41:58 UTC
A commit references this bug:

Author: rakuco
Date: Thu Aug 25 07:41:00 UTC 2016
New revision: 420837
URL: https://svnweb.freebsd.org/changeset/ports/420837

Log:
  MFH: r420773

  Import upstream patch to fix the detection of clang's version number.

  Our clang reports itself as "FreeBSD clang version x.y.z" instead of just
  "clang version x.y.z", which was preventing the sed pattern used in the
  configure script from matching and thus QT_CLANG_MAJOR_VERSION and
  QT_CLANG_MINOR_VERSION were never defined. One of the consequences is that
  tests for those values in mkspecs later always failed, which led to some
  features such as C++14 support being disabled.

  PR:		210327

  Approved by:	ports-secteam (junovitch)

Changes:
_U  branches/2016Q3/
  branches/2016Q3/devel/qmake5/Makefile
  branches/2016Q3/devel/qmake5/files/patch-configure