mirror of
https://github.com/thead-yocto-mirror/meta-qt5
synced 2026-09-10 16:15:42 +02:00
qtbase: Fix build with clang
This patch is a backport from upstream qt5 fixes building with clang from meta-clang Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
@@ -28,17 +28,18 @@ SRC_URI += "\
|
||||
file://0005-qeglplatformintegration-Undefine-CursorShape-from-X..patch \
|
||||
file://0006-configure-bump-path-length-from-256-to-512-character.patch \
|
||||
file://0007-QOpenGLPaintDevice-sub-area-support.patch \
|
||||
file://0008-Fix-build-with-clang-3.7.patch \
|
||||
"
|
||||
|
||||
# common for qtbase-native and nativesdk-qtbase
|
||||
SRC_URI += " \
|
||||
file://0008-Always-build-uic.patch \
|
||||
file://0009-Add-external-hostbindir-option-for-native-sdk.patch \
|
||||
file://0009-Always-build-uic.patch \
|
||||
file://0010-Add-external-hostbindir-option-for-native-sdk.patch \
|
||||
"
|
||||
|
||||
# specific for nativesdk-qtbase
|
||||
SRC_URI += " \
|
||||
file://0010-configure-preserve-built-qmake-and-swap-with-native-.patch \
|
||||
file://0011-configure-preserve-built-qmake-and-swap-with-native-.patch \
|
||||
"
|
||||
|
||||
# CMake's toolchain configuration of nativesdk-qtbase
|
||||
|
||||
@@ -24,12 +24,13 @@ SRC_URI += "\
|
||||
file://0005-qeglplatformintegration-Undefine-CursorShape-from-X..patch \
|
||||
file://0006-configure-bump-path-length-from-256-to-512-character.patch \
|
||||
file://0007-QOpenGLPaintDevice-sub-area-support.patch \
|
||||
file://0008-Fix-build-with-clang-3.7.patch \
|
||||
"
|
||||
|
||||
# common for qtbase-native and nativesdk-qtbase
|
||||
SRC_URI += " \
|
||||
file://0008-Always-build-uic.patch \
|
||||
file://0009-Add-external-hostbindir-option-for-native-sdk.patch \
|
||||
file://0009-Always-build-uic.patch \
|
||||
file://0010-Add-external-hostbindir-option-for-native-sdk.patch \
|
||||
"
|
||||
|
||||
CLEANBROKEN = "1"
|
||||
|
||||
72
recipes-qt/qt5/qtbase/0008-Fix-build-with-clang-3.7.patch
Normal file
72
recipes-qt/qt5/qtbase/0008-Fix-build-with-clang-3.7.patch
Normal file
@@ -0,0 +1,72 @@
|
||||
From 63111eaec5cb758d99d68a4e9ec827b79121544b Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sun, 23 Aug 2015 15:19:41 -0700
|
||||
Subject: [PATCH 08/10] Fix build with clang 3.7
|
||||
|
||||
Nullable is a language extension in clang 3.7 (indicating whether or
|
||||
not a pointer can be null).
|
||||
http://clang.llvm.org/docs/AttributeReference.html#nullable
|
||||
Using it as a class name breaks building with this compiler
|
||||
|
||||
Upstream-Status: Backport
|
||||
This is backport of https://codereview.qt-project.org/#/c/121545/
|
||||
|
||||
/mnt/home/kraj/work/angstrom/build/tmp-angstrom-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/qtbase/5.4.2+gitAUTOINC+2cb17c1fb9-r0/git/src/tools/qlalr/lalr.cpp:241:1: error: declaration of anonymous
|
||||
struct must be a definition
|
||||
struct _Nullable: public std::unary_function<Name, bool>
|
||||
^
|
||||
/mnt/home/kraj/work/angstrom/build/tmp-angstrom-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/qtbase/5.4.2+gitAUTOINC+2cb17c1fb9-r0/git/src/tools/qlalr/lalr.cpp:241:56: error: expected unqualified-id
|
||||
struct _Nullable: public std::unary_function<Name, bool>
|
||||
^
|
||||
/mnt/home/kraj/work/angstrom/build/tmp-angstrom-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/qtbase/5.4.2+gitAUTOINC+2cb17c1fb9-r0/git/src/tools/qlalr/lalr.cpp:303:98: error: expected expression
|
||||
NameList::iterator nn = std::find_if (rule->rhs.begin (), rule->rhs.end (), std::not1 (_Nullable (this)));
|
||||
^
|
||||
/mnt/home/kraj/work/angstrom/build/tmp-angstrom-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/qtbase/5.4.2+gitAUTOINC+2cb17c1fb9-r0/git/src/tools/qlalr/lalr.cpp:638:107: error: expected expression
|
||||
NameList::iterator first_not_nullable = std::find_if (dot, rule->rhs.end (), std::not1 (_Nullable (this)));
|
||||
^
|
||||
4 errors generated.
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/tools/qlalr/lalr.cpp | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/tools/qlalr/lalr.cpp b/src/tools/qlalr/lalr.cpp
|
||||
index 3d0d5de..3d780cd 100644
|
||||
--- a/src/tools/qlalr/lalr.cpp
|
||||
+++ b/src/tools/qlalr/lalr.cpp
|
||||
@@ -238,11 +238,11 @@ void Grammar::buildExtendedGrammar ()
|
||||
non_terminals.insert (accept_symbol);
|
||||
}
|
||||
|
||||
-struct _Nullable: public std::unary_function<Name, bool>
|
||||
+struct Nullable: public std::unary_function<Name, bool>
|
||||
{
|
||||
Automaton *_M_automaton;
|
||||
|
||||
- _Nullable (Automaton *aut):
|
||||
+ Nullable (Automaton *aut):
|
||||
_M_automaton (aut) {}
|
||||
|
||||
bool operator () (Name name) const
|
||||
@@ -300,7 +300,7 @@ void Automaton::buildNullables ()
|
||||
|
||||
for (RulePointer rule = _M_grammar->rules.begin (); rule != _M_grammar->rules.end (); ++rule)
|
||||
{
|
||||
- NameList::iterator nn = std::find_if (rule->rhs.begin (), rule->rhs.end (), std::not1 (_Nullable (this)));
|
||||
+ NameList::iterator nn = std::find_if (rule->rhs.begin (), rule->rhs.end (), std::not1 (Nullable (this)));
|
||||
|
||||
if (nn == rule->rhs.end ())
|
||||
changed |= nullables.insert (rule->lhs).second;
|
||||
@@ -635,7 +635,7 @@ void Automaton::buildIncludesDigraph ()
|
||||
if (! _M_grammar->isNonTerminal (*A))
|
||||
continue;
|
||||
|
||||
- NameList::iterator first_not_nullable = std::find_if (dot, rule->rhs.end (), std::not1 (_Nullable (this)));
|
||||
+ NameList::iterator first_not_nullable = std::find_if (dot, rule->rhs.end (), std::not1 (Nullable (this)));
|
||||
if (first_not_nullable != rule->rhs.end ())
|
||||
continue;
|
||||
|
||||
--
|
||||
2.5.0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 7159760b75cc338faee3e95d26d3aea377473681 Mon Sep 17 00:00:00 2001
|
||||
From c6a58549ef110a31960fca80f6d3dcdcf4d9176a Mon Sep 17 00:00:00 2001
|
||||
From: Martin Jansa <Martin.Jansa@gmail.com>
|
||||
Date: Sat, 16 Nov 2013 00:32:30 +0100
|
||||
Subject: [PATCH 08/10] Always build uic
|
||||
Subject: [PATCH 09/11] Always build uic
|
||||
|
||||
Even if we are not building gui or widgets. This tool is needed later
|
||||
as a native tool when compiling the target.
|
||||
@@ -1,8 +1,8 @@
|
||||
From 890df28110c254022682b38f78bbbea1d62b8081 Mon Sep 17 00:00:00 2001
|
||||
From 744fc89cd56387cac613534adc538900ed133b25 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Krelin <hacker@klever.net>
|
||||
Date: Mon, 29 Oct 2012 20:07:49 -0700
|
||||
Subject: [PATCH 8/9] qmake: don't build it in configure, but allow to build it
|
||||
separately
|
||||
Subject: [PATCH 09/10] qmake: don't build it in configure, but allow to build
|
||||
it separately
|
||||
|
||||
* it is already built in qtbase-native, so we don't need it in configure
|
||||
* allow building a separate qmake for the target
|
||||
@@ -1,7 +1,7 @@
|
||||
From a48e2ad5bef673e9d345d5d6de94e5bbda53fa2b Mon Sep 17 00:00:00 2001
|
||||
From b0ab57e1f0781b73830514ddc498f38da0886d15 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Jansa <Martin.Jansa@gmail.com>
|
||||
Date: Sat, 6 Apr 2013 13:15:07 +0200
|
||||
Subject: [PATCH 09/10] Add -external-hostbindir option for native(sdk)
|
||||
Subject: [PATCH 10/11] Add -external-hostbindir option for native(sdk)
|
||||
|
||||
* when cross-compiling it's sometimes useful to use existing tools from machine
|
||||
(or in OpenEmbedded built with separate native recipe) when building for target
|
||||
@@ -1,7 +1,7 @@
|
||||
From 168bf7753c648e7599ab9967501e74373037f5e9 Mon Sep 17 00:00:00 2001
|
||||
From bae2c6afb951d1352845ca257fdc2389f3fe851e Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Mon, 8 Jun 2015 13:59:25 -0700
|
||||
Subject: [PATCH 9/9] linux-oe-g++: Invert conditional for defining
|
||||
Subject: [PATCH 10/10] linux-oe-g++: Invert conditional for defining
|
||||
QT_SOCKLEN_T
|
||||
|
||||
This helps to make sure that QT_SOCKLEN_T is defined to be 'int'
|
||||
@@ -1,7 +1,7 @@
|
||||
From ee09941be5f00409029497b65358f8b8d3db91de Mon Sep 17 00:00:00 2001
|
||||
From cef1ac9fa399ad5c57480de26a1ef441414f125c Mon Sep 17 00:00:00 2001
|
||||
From: Denys Dmytriyenko <denys@ti.com>
|
||||
Date: Mon, 11 Nov 2013 20:22:34 -0500
|
||||
Subject: [PATCH 10/10] configure: preserve built qmake and swap with native
|
||||
Subject: [PATCH 11/11] configure: preserve built qmake and swap with native
|
||||
one
|
||||
|
||||
Let configure script build the real qmake, but right after it's built, swap
|
||||
@@ -18,12 +18,13 @@ SRC_URI += "\
|
||||
file://0005-qeglplatformintegration-Undefine-CursorShape-from-X..patch \
|
||||
file://0006-configure-bump-path-length-from-256-to-512-character.patch \
|
||||
file://0007-QOpenGLPaintDevice-sub-area-support.patch \
|
||||
file://0008-Fix-build-with-clang-3.7.patch \
|
||||
"
|
||||
|
||||
# specific for target qtbase
|
||||
SRC_URI += "\
|
||||
file://0008-qmake-don-t-build-it-in-configure-but-allow-to-build.patch \
|
||||
file://0009-linux-oe-g-Invert-conditional-for-defining-QT_SOCKLE.patch \
|
||||
file://0009-qmake-don-t-build-it-in-configure-but-allow-to-build.patch \
|
||||
file://0010-linux-oe-g-Invert-conditional-for-defining-QT_SOCKLE.patch \
|
||||
"
|
||||
|
||||
DEPENDS += "qtbase-native"
|
||||
|
||||
Reference in New Issue
Block a user