From c16daba21756c661a008d3a9199d3d80aa914bdf Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 24 Aug 2015 10:43:56 -0700 Subject: [PATCH] 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 Signed-off-by: Martin Jansa --- recipes-qt/qt5/nativesdk-qtbase_git.bb | 7 +- recipes-qt/qt5/qtbase-native_git.bb | 5 +- .../0008-Fix-build-with-clang-3.7.patch | 72 +++++++++++++++++++ ...-uic.patch => 0009-Always-build-uic.patch} | 4 +- ...-it-in-configure-but-allow-to-build.patch} | 6 +- ...al-hostbindir-option-for-native-sdk.patch} | 4 +- ...-conditional-for-defining-QT_SOCKLE.patch} | 4 +- ...e-built-qmake-and-swap-with-native-.patch} | 4 +- recipes-qt/qt5/qtbase_git.bb | 5 +- 9 files changed, 93 insertions(+), 18 deletions(-) create mode 100644 recipes-qt/qt5/qtbase/0008-Fix-build-with-clang-3.7.patch rename recipes-qt/qt5/qtbase/{0008-Always-build-uic.patch => 0009-Always-build-uic.patch} (88%) rename recipes-qt/qt5/qtbase/{0008-qmake-don-t-build-it-in-configure-but-allow-to-build.patch => 0009-qmake-don-t-build-it-in-configure-but-allow-to-build.patch} (91%) rename recipes-qt/qt5/qtbase/{0009-Add-external-hostbindir-option-for-native-sdk.patch => 0010-Add-external-hostbindir-option-for-native-sdk.patch} (97%) rename recipes-qt/qt5/qtbase/{0009-linux-oe-g-Invert-conditional-for-defining-QT_SOCKLE.patch => 0010-linux-oe-g-Invert-conditional-for-defining-QT_SOCKLE.patch} (88%) rename recipes-qt/qt5/qtbase/{0010-configure-preserve-built-qmake-and-swap-with-native-.patch => 0011-configure-preserve-built-qmake-and-swap-with-native-.patch} (85%) diff --git a/recipes-qt/qt5/nativesdk-qtbase_git.bb b/recipes-qt/qt5/nativesdk-qtbase_git.bb index 28e6d09..320cad6 100644 --- a/recipes-qt/qt5/nativesdk-qtbase_git.bb +++ b/recipes-qt/qt5/nativesdk-qtbase_git.bb @@ -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 diff --git a/recipes-qt/qt5/qtbase-native_git.bb b/recipes-qt/qt5/qtbase-native_git.bb index e449b01..ac68f2b 100644 --- a/recipes-qt/qt5/qtbase-native_git.bb +++ b/recipes-qt/qt5/qtbase-native_git.bb @@ -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" diff --git a/recipes-qt/qt5/qtbase/0008-Fix-build-with-clang-3.7.patch b/recipes-qt/qt5/qtbase/0008-Fix-build-with-clang-3.7.patch new file mode 100644 index 0000000..6583e80 --- /dev/null +++ b/recipes-qt/qt5/qtbase/0008-Fix-build-with-clang-3.7.patch @@ -0,0 +1,72 @@ +From 63111eaec5cb758d99d68a4e9ec827b79121544b Mon Sep 17 00:00:00 2001 +From: Khem Raj +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 +^ +/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 + ^ +/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 +--- + 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 ++struct Nullable: public std::unary_function + { + 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 + diff --git a/recipes-qt/qt5/qtbase/0008-Always-build-uic.patch b/recipes-qt/qt5/qtbase/0009-Always-build-uic.patch similarity index 88% rename from recipes-qt/qt5/qtbase/0008-Always-build-uic.patch rename to recipes-qt/qt5/qtbase/0009-Always-build-uic.patch index 11e1bcb..59266f4 100644 --- a/recipes-qt/qt5/qtbase/0008-Always-build-uic.patch +++ b/recipes-qt/qt5/qtbase/0009-Always-build-uic.patch @@ -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 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. diff --git a/recipes-qt/qt5/qtbase/0008-qmake-don-t-build-it-in-configure-but-allow-to-build.patch b/recipes-qt/qt5/qtbase/0009-qmake-don-t-build-it-in-configure-but-allow-to-build.patch similarity index 91% rename from recipes-qt/qt5/qtbase/0008-qmake-don-t-build-it-in-configure-but-allow-to-build.patch rename to recipes-qt/qt5/qtbase/0009-qmake-don-t-build-it-in-configure-but-allow-to-build.patch index ef8fcb2..8521327 100644 --- a/recipes-qt/qt5/qtbase/0008-qmake-don-t-build-it-in-configure-but-allow-to-build.patch +++ b/recipes-qt/qt5/qtbase/0009-qmake-don-t-build-it-in-configure-but-allow-to-build.patch @@ -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 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 diff --git a/recipes-qt/qt5/qtbase/0009-Add-external-hostbindir-option-for-native-sdk.patch b/recipes-qt/qt5/qtbase/0010-Add-external-hostbindir-option-for-native-sdk.patch similarity index 97% rename from recipes-qt/qt5/qtbase/0009-Add-external-hostbindir-option-for-native-sdk.patch rename to recipes-qt/qt5/qtbase/0010-Add-external-hostbindir-option-for-native-sdk.patch index 59b6728..4e770ee 100644 --- a/recipes-qt/qt5/qtbase/0009-Add-external-hostbindir-option-for-native-sdk.patch +++ b/recipes-qt/qt5/qtbase/0010-Add-external-hostbindir-option-for-native-sdk.patch @@ -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 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 diff --git a/recipes-qt/qt5/qtbase/0009-linux-oe-g-Invert-conditional-for-defining-QT_SOCKLE.patch b/recipes-qt/qt5/qtbase/0010-linux-oe-g-Invert-conditional-for-defining-QT_SOCKLE.patch similarity index 88% rename from recipes-qt/qt5/qtbase/0009-linux-oe-g-Invert-conditional-for-defining-QT_SOCKLE.patch rename to recipes-qt/qt5/qtbase/0010-linux-oe-g-Invert-conditional-for-defining-QT_SOCKLE.patch index 3be238b..0069a17 100644 --- a/recipes-qt/qt5/qtbase/0009-linux-oe-g-Invert-conditional-for-defining-QT_SOCKLE.patch +++ b/recipes-qt/qt5/qtbase/0010-linux-oe-g-Invert-conditional-for-defining-QT_SOCKLE.patch @@ -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 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' diff --git a/recipes-qt/qt5/qtbase/0010-configure-preserve-built-qmake-and-swap-with-native-.patch b/recipes-qt/qt5/qtbase/0011-configure-preserve-built-qmake-and-swap-with-native-.patch similarity index 85% rename from recipes-qt/qt5/qtbase/0010-configure-preserve-built-qmake-and-swap-with-native-.patch rename to recipes-qt/qt5/qtbase/0011-configure-preserve-built-qmake-and-swap-with-native-.patch index 109c7d1..1bfe825 100644 --- a/recipes-qt/qt5/qtbase/0010-configure-preserve-built-qmake-and-swap-with-native-.patch +++ b/recipes-qt/qt5/qtbase/0011-configure-preserve-built-qmake-and-swap-with-native-.patch @@ -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 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 diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb index e1d208d..0d3f685 100644 --- a/recipes-qt/qt5/qtbase_git.bb +++ b/recipes-qt/qt5/qtbase_git.bb @@ -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"