Created attachment 183678 [details] Use -std=c++14 for devel/qt5-script to avoid errors in JavaScriptCore During an exp-run for the projects/clang500-import branch (bug 219139), it turned out that devel/qt5-script does not build against libc++ 5.0.0 [1]: In file included from ../3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_exec.cpp:50: In file included from ../3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h:27: In file included from ../3rdparty/javascriptcore/JavaScriptCore/wtf/VectorTraits.h:24: ../3rdparty/javascriptcore/JavaScriptCore/wtf/OwnPtr.h:43:21: error: no template named 'auto_ptr' in namespace 'std' OwnPtr(std::auto_ptr<ValueType> autoPtr) : m_ptr(autoPtr.release()) { } ~~~~~^ ../3rdparty/javascriptcore/JavaScriptCore/wtf/OwnPtr.h:61:25: error: no template named 'auto_ptr' in namespace 'std' void adopt(std::auto_ptr<ValueType> autoPtr) { ASSERT(!autoPtr.get() || m_ptr != autoPtr.get()); deleteOwnedPtr(m_ptr); m_ptr = autoPtr.release(); } ~~~~~^ In file included from ../3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_exec.cpp:50: In file included from ../3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h:27: ../3rdparty/javascriptcore/JavaScriptCore/wtf/VectorTraits.h:84:30: error: no member named 'auto_ptr' in namespace 'std' struct VectorTraits<std::auto_ptr<P> > : SimpleClassVectorTraits { }; ~~~~~^ ../3rdparty/javascriptcore/JavaScriptCore/wtf/VectorTraits.h:84:39: error: 'P' does not refer to a value struct VectorTraits<std::auto_ptr<P> > : SimpleClassVectorTraits { }; ^ ../3rdparty/javascriptcore/JavaScriptCore/wtf/VectorTraits.h:83:23: note: declared here template<typename P> ^ 4 errors generated. This is because devel/qmake and/or devel/qt5-buildtools have detected -std=c++1z support, and are using it by default. However, the JavaScriptCore parts of qt5-script are from a third party, and this source is *not* C++1z compatible. For example, std::auto_ptr has long been deprecated, but is actually removed from C++1z now. I tried various methods of convincing qmake to use a lower C++ standard, and the best I could come up with was adding a line: QT_CONFIG -= c++1z to src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri, as in the attached patch. If there is a better way, I would be glad to hear it. :) [1] http://package18.nyi.freebsd.org/data/headamd64PR219139-default/2017-05-22_13h01m42s/logs/errors/qt5-script-5.7.1.log
Created attachment 183686 [details] Use unique_ptr instead of auto_ptr annulen suggested in #qt to try to use unique_ptr -- could you give the attached patch a go? mfg Tobias
Created attachment 183690 [details] Fall back to not using c++1z As JSC has no active upstream, the unique_ptr patch did not make any sense, unfortunately. So instead set CONFIG-=c++1z as you originally suggested.
A commit references this bug: Author: dim Date: Wed Jun 21 21:25:25 UTC 2017 New revision: 444079 URL: https://svnweb.freebsd.org/changeset/ports/444079 Log: Disable usage of c++1z (c++17) for qt5-script, as the third-party JavaScriptCore code is not fully compatible with it. This is a requirement for using libc++ 5.0.0, which is more strict. Approved by: tcberner (maintainer) PR: 220188 MFH: 2017Q2 Changes: head/devel/qt5-script/files/patch-cr198221
The alternative patch works fine too, thanks.
A commit references this bug: Author: dim Date: Thu Jun 22 17:19:08 UTC 2017 New revision: 444122 URL: https://svnweb.freebsd.org/changeset/ports/444122 Log: MFH: r444079 Disable usage of c++1z (c++17) for qt5-script, as the third-party JavaScriptCore code is not fully compatible with it. This is a requirement for using libc++ 5.0.0, which is more strict. Approved by: portmgr (feld) PR: 220188 Changes: _U branches/2017Q2/ branches/2017Q2/devel/qt5-script/files/patch-cr198221