qtbase: fix build for gles2 enabled by PACKAGECONFIG
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 [email protected] and/or [email protected] 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
Signature · 1 line
1.8.3.1
RFC 1/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
recipes-qt/qt5/qtbase-5.1.1/0027-reorder-includes-to-fix-build-with-eglfs.patch new file +238 -0
@@ -0,0 +1,238 @@ +From 8d810aaf46ff65452a53c3d4ab2c64a33187dba0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20M=C3=BCller?= <[email protected]> +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 <[email protected]> +--- + 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
recipes-qt/qt5/qtbase.inc +1 -0
@@ -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"
Signature · 1 line
1.8.3.1
Quoted 15 lines · Andreas Müller
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.hIn
X.hwe find definitions like#ifndef None
#define None 0L /* universal null resource or null atom */
#endifThis causes building Qt to crash when using these kind of symbols.
The patch was sent as RFC because:
Quoted 8 lines
1. I would like ro discuss this at [email protected] and/or [email protected] but it was not possible to subscribe. I sent a mail to listmaster but no response either.
2.qtbase_gitmight 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 :).
Quoted 15 lines
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.patchSignature · 6 lines
1.8.3.1 _______________________________________________ Openembedded-devel mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Quoted 25 lines · Martin Jansa
Quoted 15 lines · Andreas Müller
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.hIn
X.hwe find definitions like#ifndef None
#define None 0L /* universal null resource or null atom */
#endifThis causes building Qt to crash when using these kind of symbols.
The patch was sent as RFC because:
Quoted 8 lines
1. I would like ro discuss this at [email protected] and/or [email protected] but it was not possible to subscribe. I sent a mail to listmaster but no response either.
2.qtbase_gitmight 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.
Quoted 6 lines
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?
Quoted 4 lines
I must admit that I haven't read the patch yet and haven't finished morning coffee :).
Andreas
Quoted 30 lines · Andreas Müller
Quoted 29 lines · Martin Jansa
Quoted 15 lines · Andreas Müller
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.hIn
X.hwe find definitions like#ifndef None
#define None 0L /* universal null resource or null atom */
#endifThis causes building Qt to crash when using these kind of symbols.
The patch was sent as RFC because:
Quoted 8 lines
1. I would like ro discuss this at [email protected] and/or [email protected] but it was not possible to subscribe. I sent a mail to listmaster but no response either.
2.qtbase_gitmight 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.
Quoted 5 lines
Quoted 2 lines
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
Quoted 9 lines
Quoted 4 lines
I must admit that I haven't read the patch yet and haven't finished morning coffee :).
Andreas
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]