Bug 169871

Summary: [patch] devel/qt4-corelib, devel/dbus-qt4, x11/qt4-opengl: unbreak with libc++
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: freebsd-kde (group) <kde>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
libcplusplus.diff none

Description Jan Beich freebsd_committer freebsd_triage 2012-07-15 04:50:10 UTC
No clue why some ports don't use qiterator.h from LOCALBASE.

In file included from concurrent/qtconcurrentiteratekernel.cpp:42:
concurrent/qtconcurrentiteratekernel.h:154:60: error: variable has incomplete type 'std::bidirectional_iterator_tag'
inline bool selectIteration(std::bidirectional_iterator_tag)
                                                           ^
../../include/QtCore/../../src/corelib/tools/qiterator.h:50:12: note: forward declaration of 'std::bidirectional_iterator_tag'
    struct bidirectional_iterator_tag;
           ^
In file included from concurrent/qtconcurrentiteratekernel.cpp:42:
concurrent/qtconcurrentiteratekernel.h:164:60: error: variable has incomplete type 'std::random_access_iterator_tag'
inline bool selectIteration(std::random_access_iterator_tag)
                                                           ^
../../include/QtCore/../../src/corelib/tools/qiterator.h:51:12: note: forward declaration of 'std::random_access_iterator_tag'
    struct random_access_iterator_tag;
           ^
2 errors generated.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-07-15 04:50:33 UTC
Responsible Changed
From-To: freebsd-ports-bugs->kde

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Raphael Kubo da Costa 2012-07-17 02:22:07 UTC
Interesting. It looks like this was fixed in Qt 5 in [1].

I will try to get this patch backported into Qt 4 before committing this to 
our ports tree. Thanks for looking into this!

[1] https://codereview.qt-project.org/#change,27312
Comment 3 Raphael Kubo da Costa freebsd_committer freebsd_triage 2012-07-17 05:16:27 UTC
On Tuesday 17 July 2012 01:30:10 Raphael Kubo da Costa wrote:
>  I will try to get this patch backported into Qt 4 before committing this to
> our ports tree. Thanks for looking into this!

It turns out I cannot simply cherry-pick that change into Qt 4 without 
breaking the build.

I'm having trouble building libc++ on my 9-STABLE system, but I will look at 
this PR once I manage to build libc++ here.
Comment 4 Raphael Kubo da Costa freebsd_committer freebsd_triage 2012-07-17 16:42:47 UTC
After some struggling to get libc++ built here and then to build Qt with
libc++ and C++11 support, I finally got what was going on :-)

I've now sent <https://codereview.qt-project.org/#change,30940>, which
I'd like to get merged into Qt before fixing it here downstream.
Comment 5 dfilter service freebsd_committer freebsd_triage 2012-07-18 21:23:25 UTC
Author: rakuco
Date: Wed Jul 18 20:23:09 2012
New Revision: 301122
URL: http://svn.freebsd.org/changeset/ports/301122

Log:
  Add my upstream patch to make these Qt ports build with libc++.
  
  The original patch was written by Jan Beich in the PR mentioned
  below. I haven't been able to fully build x11/qt4-opengl yet due to
  other errors which show up later, but at least this one problem is
  solved, and the fix will be included in the next Qt 4.8 release.
  
  No PORTREVISION bump, as users of other standard C++ libraries are not
  affected, and no dependencies have been changed.
  
  PR:		ports/169871
  Submitted by:	Jan Beich <jbeich@tormail.org>

Added:
  head/devel/dbus-qt4/files/
  head/devel/dbus-qt4/files/patch-src__corelib__tools__qiterator.h   (contents, props changed)
  head/devel/qt4-corelib/files/patch-src__corelib__tools__qiterator.h   (contents, props changed)
  head/x11/qt4-opengl/files/
  head/x11/qt4-opengl/files/patch-src__corelib__tools__qiterator.h   (contents, props changed)

Added: head/devel/dbus-qt4/files/patch-src__corelib__tools__qiterator.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/dbus-qt4/files/patch-src__corelib__tools__qiterator.h	Wed Jul 18 20:23:09 2012	(r301122)
@@ -0,0 +1,38 @@
+commit 5210d47aa66214e3cb16f394d0510a91f770c1b1
+Author: Raphael Kubo da Costa <rakuco@FreeBSD.org>
+Date:   Mon Jul 16 23:39:07 2012 -0300
+
+    Only forward-declare some std classes if QT_NO_STL is defined.
+    
+    If that is not done, building with clang, libc++ and C++11 support
+    does not work: libc++ defines the iterator tag classes in an inline
+    namespace inside the std namespace, and forward-declaring those
+    classes inside the std namespace itself in qiterator.h causes an
+    ambiguity that clang solves by choosing the incomplete-declared class
+    declared in the enclosing std namespace.
+    
+    This is probably the "clang build problem" reported in commit
+    19e2b4d6eb733d9fd4eb69c0622b699fd08a3203 to qtbase, which cannot be
+    directly cherry-picked without breaking other classes due to QT_NO_STL
+    still being present in Qt 4.
+    
+    Change-Id: I26e33915347d3f94ef2e10b68fca6b2099ec9491
+    Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
+
+diff --git a/src/corelib/tools/qiterator.h b/src/corelib/tools/qiterator.h
+index 0747940..b9d8da6 100644
+--- ./src/corelib/tools/qiterator.h
++++ ./src/corelib/tools/qiterator.h
+@@ -46,10 +46,12 @@
+ 
+ QT_BEGIN_HEADER
+ 
++#ifdef QT_NO_STL
+ namespace std {
+     struct bidirectional_iterator_tag;
+     struct random_access_iterator_tag;
+ }
++#endif
+ 
+ QT_BEGIN_NAMESPACE
+ 

Added: head/devel/qt4-corelib/files/patch-src__corelib__tools__qiterator.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/qt4-corelib/files/patch-src__corelib__tools__qiterator.h	Wed Jul 18 20:23:09 2012	(r301122)
@@ -0,0 +1,38 @@
+commit 5210d47aa66214e3cb16f394d0510a91f770c1b1
+Author: Raphael Kubo da Costa <rakuco@FreeBSD.org>
+Date:   Mon Jul 16 23:39:07 2012 -0300
+
+    Only forward-declare some std classes if QT_NO_STL is defined.
+    
+    If that is not done, building with clang, libc++ and C++11 support
+    does not work: libc++ defines the iterator tag classes in an inline
+    namespace inside the std namespace, and forward-declaring those
+    classes inside the std namespace itself in qiterator.h causes an
+    ambiguity that clang solves by choosing the incomplete-declared class
+    declared in the enclosing std namespace.
+    
+    This is probably the "clang build problem" reported in commit
+    19e2b4d6eb733d9fd4eb69c0622b699fd08a3203 to qtbase, which cannot be
+    directly cherry-picked without breaking other classes due to QT_NO_STL
+    still being present in Qt 4.
+    
+    Change-Id: I26e33915347d3f94ef2e10b68fca6b2099ec9491
+    Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
+
+diff --git a/src/corelib/tools/qiterator.h b/src/corelib/tools/qiterator.h
+index 0747940..b9d8da6 100644
+--- ./src/corelib/tools/qiterator.h
++++ ./src/corelib/tools/qiterator.h
+@@ -46,10 +46,12 @@
+ 
+ QT_BEGIN_HEADER
+ 
++#ifdef QT_NO_STL
+ namespace std {
+     struct bidirectional_iterator_tag;
+     struct random_access_iterator_tag;
+ }
++#endif
+ 
+ QT_BEGIN_NAMESPACE
+ 

Added: head/x11/qt4-opengl/files/patch-src__corelib__tools__qiterator.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11/qt4-opengl/files/patch-src__corelib__tools__qiterator.h	Wed Jul 18 20:23:09 2012	(r301122)
@@ -0,0 +1,38 @@
+commit 5210d47aa66214e3cb16f394d0510a91f770c1b1
+Author: Raphael Kubo da Costa <rakuco@FreeBSD.org>
+Date:   Mon Jul 16 23:39:07 2012 -0300
+
+    Only forward-declare some std classes if QT_NO_STL is defined.
+    
+    If that is not done, building with clang, libc++ and C++11 support
+    does not work: libc++ defines the iterator tag classes in an inline
+    namespace inside the std namespace, and forward-declaring those
+    classes inside the std namespace itself in qiterator.h causes an
+    ambiguity that clang solves by choosing the incomplete-declared class
+    declared in the enclosing std namespace.
+    
+    This is probably the "clang build problem" reported in commit
+    19e2b4d6eb733d9fd4eb69c0622b699fd08a3203 to qtbase, which cannot be
+    directly cherry-picked without breaking other classes due to QT_NO_STL
+    still being present in Qt 4.
+    
+    Change-Id: I26e33915347d3f94ef2e10b68fca6b2099ec9491
+    Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
+
+diff --git a/src/corelib/tools/qiterator.h b/src/corelib/tools/qiterator.h
+index 0747940..b9d8da6 100644
+--- ./src/corelib/tools/qiterator.h
++++ ./src/corelib/tools/qiterator.h
+@@ -46,10 +46,12 @@
+ 
+ QT_BEGIN_HEADER
+ 
++#ifdef QT_NO_STL
+ namespace std {
+     struct bidirectional_iterator_tag;
+     struct random_access_iterator_tag;
+ }
++#endif
+ 
+ QT_BEGIN_NAMESPACE
+ 
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 Raphael Kubo da Costa freebsd_committer freebsd_triage 2012-07-18 21:24:24 UTC
State Changed
From-To: open->closed

Committed. Thanks!