* [meta-qt5][RFC] qtbase: fix build for gles2 enabled by PACKAGECONFIG
@ 2013-10-28 23:06 Andreas Müller
2013-10-28 23:06 ` Andreas Müller
2013-10-29 7:07 ` Martin Jansa
0 siblings, 2 replies; 5+ messages in thread
From: Andreas Müller @ 2013-10-28 23:06 UTC (permalink / raw)
To: openembedded-devel
While playing around with QtQuick I needed gles2 support. Doing so I faced tons
of error messages as mentionet in patch. It is caused by include chain:
EGL/egl.h -> EGL/eglplatform.h -> X11/Xlib.h -> X.h
In X.h we find definitions like
#ifndef None
#define None 0L /* universal null resource or null atom */
#endif
This causes building Qt to crash when using these kind of symbols.
The patch was sent as RFC because:
1. I would like ro discuss this at interest@qt-project.org and/or
development@qt-project.org but it was not possible to subscribe. I sent
a mail to listmaster but no response either.
2. qtbase_git might need same (and fails with the patch)
3. This is not a proper solution: It is fragile and will return for future
changes. Proper soultion would be renaming the symbols Qt but I cannot
discuss due to 1.
4. Nobody reported a build error for meta-qt5 so far.
Andreas Müller (1):
qtbase: fix build for gles2 enabled by PACKAGECONFIG
...-reorder-includes-to-fix-build-with-eglfs.patch | 238 +++++++++++++++++++++
recipes-qt/qt5/qtbase.inc | 1 +
2 files changed, 239 insertions(+)
create mode 100644 recipes-qt/qt5/qtbase-5.1.1/0027-reorder-includes-to-fix-build-with-eglfs.patch
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [meta-qt5][RFC] qtbase: fix build for gles2 enabled by PACKAGECONFIG
2013-10-28 23:06 [meta-qt5][RFC] qtbase: fix build for gles2 enabled by PACKAGECONFIG Andreas Müller
@ 2013-10-28 23:06 ` Andreas Müller
2013-10-29 7:07 ` Martin Jansa
1 sibling, 0 replies; 5+ messages in thread
From: Andreas Müller @ 2013-10-28 23:06 UTC (permalink / raw)
To: openembedded-devel
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
...-reorder-includes-to-fix-build-with-eglfs.patch | 238 +++++++++++++++++++++
recipes-qt/qt5/qtbase.inc | 1 +
2 files changed, 239 insertions(+)
create mode 100644 recipes-qt/qt5/qtbase-5.1.1/0027-reorder-includes-to-fix-build-with-eglfs.patch
diff --git a/recipes-qt/qt5/qtbase-5.1.1/0027-reorder-includes-to-fix-build-with-eglfs.patch b/recipes-qt/qt5/qtbase-5.1.1/0027-reorder-includes-to-fix-build-with-eglfs.patch
new file mode 100644
index 0000000..2c47bd2
--- /dev/null
+++ b/recipes-qt/qt5/qtbase-5.1.1/0027-reorder-includes-to-fix-build-with-eglfs.patch
@@ -0,0 +1,238 @@
+From 8d810aaf46ff65452a53c3d4ab2c64a33187dba0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Wed, 23 Oct 2013 19:27:15 +0200
+Subject: [PATCH] reorder includes to fix build with eglfs
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+fixes several errors as
+
+| In file included from /home/a.mueller/tmp/oe-core-eglibc/sysroots/colibri-t30/usr/include/X11/Xlib.h:44:0,
+| from /home/a.mueller/tmp/oe-core-eglibc/sysroots/colibri-t30/usr/include/EGL/eglplatform.h:118,
+| from /home/a.mueller/tmp/oe-core-eglibc/sysroots/colibri-t30/usr/include/EGL/egl.h:36,
+| from /home/a.mueller/tmp/oe-core-eglibc/work/cortexa9hf-vfp-neon-angstrom-linux-gnueabi/qtbase/5.1.1-r0/qtbase-opensource-src-5.1.1/src/plugins/platforms/eglfs/qeglfsscreen.h:49,
+| from /home/a.mueller/tmp/oe-core-eglibc/work/cortexa9hf-vfp-neon-angstrom-linux-gnueabi/qtbase/5.1.1-r0/qtbase-opensource-src-5.1.1/src/plugins/platforms/eglfs/qeglfsintegration.h:45,
+| from /home/a.mueller/tmp/oe-core-eglibc/work/cortexa9hf-vfp-neon-angstrom-linux-gnueabi/qtbase/5.1.1-r0/qtbase-opensource-src-5.1.1/src/plugins/platforms/eglfs/qeglfsintegration.cpp:42:
+| /home/a.mueller/tmp/oe-core-eglibc/work/cortexa9hf-vfp-neon-angstrom-linux-gnueabi/qtbase/5.1.1-r0/qtbase-opensource-src-5.1.1/include/QtCore/../../src/corelib/io/qurl.h:132:9: error: expected identifier before numeric constant
+| None = 0x0,
+| ^
+... and follow up error messages
+
+The error is caused by X.h (inluded by Xlib.h)
+
+| #ifndef None
+| #define None 0L /* universal null resource or null atom */
+| #endif
+
+and other defines causing symbols used by Qt being replaced.
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ src/platformsupport/eglconvenience/qeglpbuffer_p.h | 2 +-
+ src/plugins/platforms/eglfs/qeglfscontext.cpp | 16 +++++++++++-----
+ src/plugins/platforms/eglfs/qeglfscursor.cpp | 9 ++++++++-
+ src/plugins/platforms/eglfs/qeglfscursor.h | 1 -
+ src/plugins/platforms/eglfs/qeglfshooks_stub.cpp | 8 +++++---
+ src/plugins/platforms/eglfs/qeglfsintegration.cpp | 20 +++++++++++---------
+ src/plugins/platforms/eglfs/qeglfswindow.cpp | 7 +++++--
+ .../platforms/minimalegl/qminimaleglwindow.cpp | 6 ++++--
+ 8 files changed, 45 insertions(+), 24 deletions(-)
+
+diff --git a/src/platformsupport/eglconvenience/qeglpbuffer_p.h b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
+index 1b4ac6f..1237950 100644
+--- a/src/platformsupport/eglconvenience/qeglpbuffer_p.h
++++ b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
+@@ -42,8 +42,8 @@
+ #ifndef QEGLPBUFFER_H
+ #define QEGLPBUFFER_H
+
+-#include <EGL/egl.h>
+ #include <qpa/qplatformoffscreensurface.h>
++#include <EGL/egl.h>
+
+ QT_BEGIN_NAMESPACE
+
+diff --git a/src/plugins/platforms/eglfs/qeglfscontext.cpp b/src/plugins/platforms/eglfs/qeglfscontext.cpp
+index 5143964..c776371 100644
+--- a/src/plugins/platforms/eglfs/qeglfscontext.cpp
++++ b/src/plugins/platforms/eglfs/qeglfscontext.cpp
+@@ -39,15 +39,21 @@
+ **
+ ****************************************************************************/
+
+-#include "qeglfscontext.h"
+-#include "qeglfswindow.h"
++#include <QMetaType>
++#include <QTextStream>
++#include <QDataStream>
++
++#include <QtGui/QSurface>
++#include <QtDebug>
++
+ #include "qeglfscursor.h"
+-#include "qeglfshooks.h"
+ #include "qeglfsintegration.h"
++#include "qeglfswindow.h"
++#include "qeglfshooks.h"
++#include "qeglfscontext.h"
++
+
+ #include <QtPlatformSupport/private/qeglpbuffer_p.h>
+-#include <QtGui/QSurface>
+-#include <QtDebug>
+
+ QT_BEGIN_NAMESPACE
+
+diff --git a/src/plugins/platforms/eglfs/qeglfscursor.cpp b/src/plugins/platforms/eglfs/qeglfscursor.cpp
+index 9dc836b..cfffe00 100644
+--- a/src/plugins/platforms/eglfs/qeglfscursor.cpp
++++ b/src/plugins/platforms/eglfs/qeglfscursor.cpp
+@@ -39,7 +39,6 @@
+ **
+ ****************************************************************************/
+
+-#include "qeglfscursor.h"
+ #include <qpa/qwindowsysteminterface.h>
+ #include <QtGui/QOpenGLContext>
+ #include <QtCore/QJsonDocument>
+@@ -47,6 +46,14 @@
+ #include <QtCore/QJsonObject>
+ #include <QtDebug>
+
++#include "qeglfscursor.h"
++#include "qeglfsscreen.h"
++
++// workaround for CursorShape defined in X.h
++#ifdef CursorShape
++#undef CursorShape
++#endif
++
+ QT_BEGIN_NAMESPACE
+
+ QEglFSCursor::QEglFSCursor(QEglFSScreen *screen)
+diff --git a/src/plugins/platforms/eglfs/qeglfscursor.h b/src/plugins/platforms/eglfs/qeglfscursor.h
+index fdbffde..081658d 100644
+--- a/src/plugins/platforms/eglfs/qeglfscursor.h
++++ b/src/plugins/platforms/eglfs/qeglfscursor.h
+@@ -43,7 +43,6 @@
+ #define QEGLFSCURSOR_H
+
+ #include <qpa/qplatformcursor.h>
+-#include "qeglfsscreen.h"
+ #include <GLES2/gl2.h>
+
+ QT_BEGIN_NAMESPACE
+diff --git a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
+index c334f46..bc37ef9 100644
+--- a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
++++ b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
+@@ -39,9 +39,6 @@
+ **
+ ****************************************************************************/
+
+-#include "qeglfshooks.h"
+-#include "qeglfscursor.h"
+-
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <linux/fb.h>
+@@ -50,6 +47,11 @@
+ #include <private/qmath_p.h>
+ #include <private/qcore_unix_p.h>
+
++#include <QTextStream>
++
++#include "qeglfscursor.h"
++#include "qeglfshooks.h"
++
+ QT_BEGIN_NAMESPACE
+
+ // file descriptor for the frame buffer
+diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
+index cf1503b..61382e2 100644
+--- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp
++++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
+@@ -39,19 +39,10 @@
+ **
+ ****************************************************************************/
+
+-#include "qeglfsintegration.h"
+-
+-#include "qeglfswindow.h"
+-#include "qeglfsbackingstore.h"
+-#include "qeglfshooks.h"
+-
+ #include <QtGui/private/qguiapplication_p.h>
+
+ #include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
+ #include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
+-#include <QtPlatformSupport/private/qeglconvenience_p.h>
+-#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
+-#include <QtPlatformSupport/private/qeglpbuffer_p.h>
+
+ #if !defined(QT_NO_EVDEV) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
+ #include <QtPlatformSupport/private/qevdevmousemanager_p.h>
+@@ -68,8 +59,19 @@
+
+ #include <qpa/qplatforminputcontextfactory_p.h>
+
++#include <QTextStream>
++
++#include "qeglfsintegration.h"
++
++#include "qeglfswindow.h"
++#include "qeglfsbackingstore.h"
++#include "qeglfshooks.h"
+ #include "qeglfscontext.h"
+
++#include <QtPlatformSupport/private/qeglconvenience_p.h>
++#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
++#include <QtPlatformSupport/private/qeglpbuffer_p.h>
++
+ #include <EGL/egl.h>
+
+ QT_BEGIN_NAMESPACE
+diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
+index 98c54e0..b0b7481 100644
+--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
++++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
+@@ -39,12 +39,15 @@
+ **
+ ****************************************************************************/
+
+-#include "qeglfswindow.h"
+-#include "qeglfshooks.h"
++#include <QTextStream>
++
+ #include <qpa/qwindowsysteminterface.h>
+
+ #include <QtPlatformSupport/private/qeglconvenience_p.h>
+
++#include "qeglfswindow.h"
++#include "qeglfshooks.h"
++
+ #include <QtDebug>
+
+ QT_BEGIN_NAMESPACE
+diff --git a/src/plugins/platforms/minimalegl/qminimaleglwindow.cpp b/src/plugins/platforms/minimalegl/qminimaleglwindow.cpp
+index 13640b7..26ce1d9 100644
+--- a/src/plugins/platforms/minimalegl/qminimaleglwindow.cpp
++++ b/src/plugins/platforms/minimalegl/qminimaleglwindow.cpp
+@@ -39,10 +39,12 @@
+ **
+ ****************************************************************************/
+
+-#include "qminimaleglwindow.h"
+-
+ #include <qpa/qwindowsysteminterface.h>
+
++#include <QTextStream>
++
++#include "qminimaleglwindow.h"
++
+ QT_BEGIN_NAMESPACE
+
+ QMinimalEglWindow::QMinimalEglWindow(QWindow *w)
+--
+1.8.3.1
diff --git a/recipes-qt/qt5/qtbase.inc b/recipes-qt/qt5/qtbase.inc
index 889ab99..4490a72 100644
--- a/recipes-qt/qt5/qtbase.inc
+++ b/recipes-qt/qt5/qtbase.inc
@@ -23,6 +23,7 @@ SRC_URI += " \
file://0023-configure-make-freetype-a-configurable-option.patch \
file://0024-Use-OE_QMAKE_PATH_EXTERNAL_HOST_BINS-to-determine-pa.patch \
file://0026-Ensure-lastPixel.y-is-also-initalized-to-1-when-nece.patch \
+ file://0027-reorder-includes-to-fix-build-with-eglfs.patch \
"
DEPENDS += "qtbase-native"
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [meta-qt5][RFC] qtbase: fix build for gles2 enabled by PACKAGECONFIG
2013-10-28 23:06 [meta-qt5][RFC] qtbase: fix build for gles2 enabled by PACKAGECONFIG Andreas Müller
2013-10-28 23:06 ` Andreas Müller
@ 2013-10-29 7:07 ` Martin Jansa
2013-10-29 8:14 ` Andreas Müller
1 sibling, 1 reply; 5+ messages in thread
From: Martin Jansa @ 2013-10-29 7:07 UTC (permalink / raw)
To: openembedded-devel
[-- Attachment #1: Type: text/plain, Size: 2098 bytes --]
On Tue, Oct 29, 2013 at 12:06:15AM +0100, Andreas Müller wrote:
> While playing around with QtQuick I needed gles2 support. Doing so I faced tons
> of error messages as mentionet in patch. It is caused by include chain:
>
> EGL/egl.h -> EGL/eglplatform.h -> X11/Xlib.h -> X.h
>
> In X.h we find definitions like
>
> #ifndef None
> #define None 0L /* universal null resource or null atom */
> #endif
>
> This causes building Qt to crash when using these kind of symbols.
>
> The patch was sent as RFC because:
>
> 1. I would like ro discuss this at interest@qt-project.org and/or
> development@qt-project.org but it was not possible to subscribe. I sent
> a mail to listmaster but no response either.
> 2. qtbase_git might need same (and fails with the patch)
> 3. This is not a proper solution: It is fragile and will return for future
> changes. Proper soultion would be renaming the symbols Qt but I cannot
> discuss due to 1.
> 4. Nobody reported a build error for meta-qt5 so far.
We had similar problem, but fixed gles2 provider instead, in our case we
were using libhybris and the fix was to prevent loading X11 headers when
we want to use just gles2 from it.
Similar changes were added to mesa lately, can you do the same with
gles2 provider on your platform?
I must admit that I haven't read the patch yet and haven't finished
morning coffee :).
> Andreas Müller (1):
> qtbase: fix build for gles2 enabled by PACKAGECONFIG
>
> ...-reorder-includes-to-fix-build-with-eglfs.patch | 238 +++++++++++++++++++++
> recipes-qt/qt5/qtbase.inc | 1 +
> 2 files changed, 239 insertions(+)
> create mode 100644 recipes-qt/qt5/qtbase-5.1.1/0027-reorder-includes-to-fix-build-with-eglfs.patch
>
> --
> 1.8.3.1
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [meta-qt5][RFC] qtbase: fix build for gles2 enabled by PACKAGECONFIG
2013-10-29 8:14 ` Andreas Müller
@ 2013-10-29 7:26 ` Martin Jansa
0 siblings, 0 replies; 5+ messages in thread
From: Martin Jansa @ 2013-10-29 7:26 UTC (permalink / raw)
To: openembedded-devel
[-- Attachment #1: Type: text/plain, Size: 2543 bytes --]
On Tue, Oct 29, 2013 at 09:14:09AM +0100, Andreas Müller wrote:
> On Tue, Oct 29, 2013 at 8:07 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> > On Tue, Oct 29, 2013 at 12:06:15AM +0100, Andreas Müller wrote:
> >> While playing around with QtQuick I needed gles2 support. Doing so I faced tons
> >> of error messages as mentionet in patch. It is caused by include chain:
> >>
> >> EGL/egl.h -> EGL/eglplatform.h -> X11/Xlib.h -> X.h
> >>
> >> In X.h we find definitions like
> >>
> >> #ifndef None
> >> #define None 0L /* universal null resource or null atom */
> >> #endif
> >>
> >> This causes building Qt to crash when using these kind of symbols.
> >>
> >> The patch was sent as RFC because:
> >>
> >> 1. I would like ro discuss this at interest@qt-project.org and/or
> >> development@qt-project.org but it was not possible to subscribe. I sent
> >> a mail to listmaster but no response either.
> >> 2. qtbase_git might need same (and fails with the patch)
> >> 3. This is not a proper solution: It is fragile and will return for future
> >> changes. Proper soultion would be renaming the symbols Qt but I cannot
> >> discuss due to 1.
> >> 4. Nobody reported a build error for meta-qt5 so far.
> >
> > We had similar problem, but fixed gles2 provider instead, in our case we
> > were using libhybris and the fix was to prevent loading X11 headers when
> > we want to use just gles2 from it.
> >
> > Similar changes were added to mesa lately, can you do the same with
> > gles2 provider on your platform?
> It is the egl part causing trouble and the headers we use are the
> latest from khronos. I don't understand what the workaround exactly
> looks like - could you provide further hints?
Something like this:
https://github.com/stskeeps/libhybris/commit/6b2815973f98601e39d916a8f53a4f6acb76b22b
or directly in mesa:
http://git.openembedded.org/openembedded-core/commit/meta/recipes-graphics/mesa/mesa?h=dylan&id=e4f5a568ec8df772f2b8c07f2ac946b2e9247ccd
or newer versions:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1a7275de9a0088cedab17131eec82bd2cada26c3
> >
> > I must admit that I haven't read the patch yet and haven't finished
> > morning coffee :).
> >
> Andreas
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [meta-qt5][RFC] qtbase: fix build for gles2 enabled by PACKAGECONFIG
2013-10-29 7:07 ` Martin Jansa
@ 2013-10-29 8:14 ` Andreas Müller
2013-10-29 7:26 ` Martin Jansa
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Müller @ 2013-10-29 8:14 UTC (permalink / raw)
To: openembedded-devel@lists.openembedded.org
On Tue, Oct 29, 2013 at 8:07 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> On Tue, Oct 29, 2013 at 12:06:15AM +0100, Andreas Müller wrote:
>> While playing around with QtQuick I needed gles2 support. Doing so I faced tons
>> of error messages as mentionet in patch. It is caused by include chain:
>>
>> EGL/egl.h -> EGL/eglplatform.h -> X11/Xlib.h -> X.h
>>
>> In X.h we find definitions like
>>
>> #ifndef None
>> #define None 0L /* universal null resource or null atom */
>> #endif
>>
>> This causes building Qt to crash when using these kind of symbols.
>>
>> The patch was sent as RFC because:
>>
>> 1. I would like ro discuss this at interest@qt-project.org and/or
>> development@qt-project.org but it was not possible to subscribe. I sent
>> a mail to listmaster but no response either.
>> 2. qtbase_git might need same (and fails with the patch)
>> 3. This is not a proper solution: It is fragile and will return for future
>> changes. Proper soultion would be renaming the symbols Qt but I cannot
>> discuss due to 1.
>> 4. Nobody reported a build error for meta-qt5 so far.
>
> We had similar problem, but fixed gles2 provider instead, in our case we
> were using libhybris and the fix was to prevent loading X11 headers when
> we want to use just gles2 from it.
>
> Similar changes were added to mesa lately, can you do the same with
> gles2 provider on your platform?
It is the egl part causing trouble and the headers we use are the
latest from khronos. I don't understand what the workaround exactly
looks like - could you provide further hints?
>
> I must admit that I haven't read the patch yet and haven't finished
> morning coffee :).
>
Andreas
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-10-29 8:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-28 23:06 [meta-qt5][RFC] qtbase: fix build for gles2 enabled by PACKAGECONFIG Andreas Müller
2013-10-28 23:06 ` Andreas Müller
2013-10-29 7:07 ` Martin Jansa
2013-10-29 8:14 ` Andreas Müller
2013-10-29 7:26 ` Martin Jansa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox