summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-09-03 11:10:35 -0700
committerMartin Jansa <Martin.Jansa@gmail.com>2017-09-05 14:56:05 +0200
commitec80b092470a8bc775c2d9dd6fa19827019190c1 (patch)
tree80a044007a6d5e25b6110601f41ef7444f486c2e
parent90d4a41621886ae5e738ec8a0b693e88b25d8267 (diff)
downloadmeta-qt5-ec80b092470a8bc775c2d9dd6fa19827019190c1.tar.gz
qtbase: Fix build with musl/clang
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--0001-qtbase-Add-OE-clang-specific-mkspecs.patch178
-rw-r--r--recipes-qt/qt5/qtbase-native_git.bb2
-rw-r--r--recipes-qt/qt5/qtbase/0011-linux-clang-Invert-conditional-for-defining-QT_SOCKL.patch35
-rw-r--r--recipes-qt/qt5/qtbase/0012-tst_qlocale-Enable-QT_USE_FENV-only-on-glibc.patch28
-rw-r--r--recipes-qt/qt5/qtbase_git.bb2
5 files changed, 245 insertions, 0 deletions
diff --git a/0001-qtbase-Add-OE-clang-specific-mkspecs.patch b/0001-qtbase-Add-OE-clang-specific-mkspecs.patch
new file mode 100644
index 00000000..99c53317
--- /dev/null
+++ b/0001-qtbase-Add-OE-clang-specific-mkspecs.patch
@@ -0,0 +1,178 @@
1From 75aeb71530c456b9800bcc83c104e3906e47e9e4 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 3 Sep 2017 09:29:02 -0700
4Subject: [PATCH] qtbase: Add OE clang specific mkspecs
5
6We can not piggy back clang anymore on existing
7OE mkspecs since starting 5.9 the configure is
8asking compiler for include paths and it needs to
9know if platform is clang-linux or g++-linux
10
11Fixes:
12ERROR: failed to parse default search paths from compiler output
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 classes/qmake5_base.bbclass | 7 ++-
17 recipes-qt/qt5/qtbase-native_git.bb | 6 +-
18 ...-Add-OE-specific-specs-for-clang-compiler.patch | 72 ++++++++++++++++++++++
19 recipes-qt/qt5/qtbase_git.bb | 6 +-
20 4 files changed, 87 insertions(+), 4 deletions(-)
21 create mode 100644 recipes-qt/qt5/qtbase/0010-Add-OE-specific-specs-for-clang-compiler.patch
22
23diff --git a/classes/qmake5_base.bbclass b/classes/qmake5_base.bbclass
24index a556f4f..8e1fe20 100644
25--- a/classes/qmake5_base.bbclass
26+++ b/classes/qmake5_base.bbclass
27@@ -1,6 +1,9 @@
28 # hardcode linux, because that's what 0001-Add-linux-oe-g-platform.patch adds
29-OE_QMAKE_PLATFORM_NATIVE = "linux-oe-g++"
30-OE_QMAKE_PLATFORM = "linux-oe-g++"
31+XPLATFORM_toolchain-clang = "linux-oe-clang"
32+XPLATFORM ?= "linux-oe-g++"
33+
34+OE_QMAKE_PLATFORM_NATIVE = "${XPLATFORM}"
35+OE_QMAKE_PLATFORM = "${XPLATFORM}"
36
37 # Add -d to show debug output from every qmake call, but it prints *a lot*, better to add it only to debugged recipe
38 OE_QMAKE_DEBUG_OUTPUT ?= ""
39diff --git a/recipes-qt/qt5/qtbase-native_git.bb b/recipes-qt/qt5/qtbase-native_git.bb
40index 54a0b78..72b977d 100644
41--- a/recipes-qt/qt5/qtbase-native_git.bb
42+++ b/recipes-qt/qt5/qtbase-native_git.bb
43@@ -38,10 +38,14 @@ SRC_URI += "\
44 # 5.9.meta-qt5-native.2
45 SRC_URI += " \
46 file://0009-Always-build-uic.patch \
47+ file://0010-Add-OE-specific-specs-for-clang-compiler.patch \
48 "
49
50 CLEANBROKEN = "1"
51
52+XPLATFORM_toolchain-clang = "linux-oe-clang"
53+XPLATFORM ?= "linux-oe-g++"
54+
55 PACKAGECONFIG_CONFARGS = " \
56 -sysroot ${STAGING_DIR_NATIVE} \
57 -no-gcc-sysroot \
58@@ -79,7 +83,7 @@ PACKAGECONFIG_CONFARGS = " \
59 -nomake examples \
60 -nomake tests \
61 -no-rpath \
62- -platform linux-oe-g++ \
63+ -platform ${XPLATFORM} \
64 "
65
66 # for qtbase configuration we need default settings
67diff --git a/recipes-qt/qt5/qtbase/0010-Add-OE-specific-specs-for-clang-compiler.patch b/recipes-qt/qt5/qtbase/0010-Add-OE-specific-specs-for-clang-compiler.patch
68new file mode 100644
69index 0000000..b019f67
70--- /dev/null
71+++ b/recipes-qt/qt5/qtbase/0010-Add-OE-specific-specs-for-clang-compiler.patch
72@@ -0,0 +1,72 @@
73+From 3a46fb7b47d19c5261e1590f8d70fe41443def64 Mon Sep 17 00:00:00 2001
74+From: Khem Raj <raj.khem@gmail.com>
75+Date: Sun, 3 Sep 2017 09:11:44 -0700
76+Subject: [PATCH] Add OE specific specs for clang compiler
77+
78+Signed-off-by: Khem Raj <raj.khem@gmail.com>
79+---
80+ mkspecs/linux-oe-clang/qmake.conf | 43 ++++++++++++++++++++++++++++++++++
81+ mkspecs/linux-oe-clang/qplatformdefs.h | 1 +
82+ 2 files changed, 44 insertions(+)
83+ create mode 100644 mkspecs/linux-oe-clang/qmake.conf
84+ create mode 100644 mkspecs/linux-oe-clang/qplatformdefs.h
85+
86+diff --git a/mkspecs/linux-oe-clang/qmake.conf b/mkspecs/linux-oe-clang/qmake.conf
87+new file mode 100644
88+index 0000000000..ffc9f051db
89+--- /dev/null
90++++ b/mkspecs/linux-oe-clang/qmake.conf
91+@@ -0,0 +1,43 @@
92++#
93++# qmake configuration for linux-g++ with modifications for building with OpenEmbedded
94++#
95++
96++MAKEFILE_GENERATOR = UNIX
97++CONFIG += incremental
98++QMAKE_INCREMENTAL_STYLE = sublib
99++
100++include(../common/linux.conf)
101++
102++# QMAKE_<TOOL> (moc, uic, rcc) are gone, overwrite only ar and strip
103++QMAKE_AR = $$(OE_QMAKE_AR) cqs
104++QMAKE_STRIP = $$(OE_QMAKE_STRIP)
105++QMAKE_WAYLAND_SCANNER = $$(OE_QMAKE_WAYLAND_SCANNER)
106++
107++include(../common/gcc-base-unix.conf)
108++
109++# *FLAGS from gcc-base.conf
110++QMAKE_CFLAGS += $$(OE_QMAKE_CFLAGS)
111++QMAKE_CXXFLAGS += $$(OE_QMAKE_CXXFLAGS)
112++QMAKE_LFLAGS += $$(OE_QMAKE_LDFLAGS)
113++
114++include(../common/clang.conf)
115++
116++# tc settings from g++-base.conf
117++QMAKE_COMPILER = $$(OE_QMAKE_COMPILER) clang
118++QMAKE_CC = $$(OE_QMAKE_CC)
119++QMAKE_CXX = $$(OE_QMAKE_CXX)
120++
121++QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$(OE_QMAKE_CFLAGS)
122++
123++QMAKE_LINK = $$(OE_QMAKE_LINK)
124++QMAKE_LINK_SHLIB = $$(OE_QMAKE_LINK)
125++QMAKE_LINK_C = $$(OE_QMAKE_LINK)
126++QMAKE_LINK_C_SHLIB = $$(OE_QMAKE_LINK)
127++
128++# for the SDK
129++isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $$(OE_QMAKE_QT_CONFIG)
130++
131++include(../oe-device-extra.pri)
132++
133++load(device_config)
134++load(qt_config)
135+diff --git a/mkspecs/linux-oe-clang/qplatformdefs.h b/mkspecs/linux-oe-clang/qplatformdefs.h
136+new file mode 100644
137+index 0000000000..880c927b21
138+--- /dev/null
139++++ b/mkspecs/linux-oe-clang/qplatformdefs.h
140+@@ -0,0 +1 @@
141++#include "../linux-clang/qplatformdefs.h"
142+--
143+2.14.1
144+
145diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb
146index aaa59f3..25d99e8 100644
147--- a/recipes-qt/qt5/qtbase_git.bb
148+++ b/recipes-qt/qt5/qtbase_git.bb
149@@ -26,6 +26,7 @@ SRC_URI += "\
150 file://0006-Pretend-Qt5-wasn-t-found-if-OE_QMAKE_PATH_EXTERNAL_H.patch \
151 file://0007-Delete-qlonglong-and-qulonglong.patch \
152 file://0008-Replace-pthread_yield-with-sched_yield.patch \
153+ file://0010-Add-OE-specific-specs-for-clang-compiler.patch \
154 file://run-ptest \
155 "
156
157@@ -160,6 +161,9 @@ QT_CONFIG_FLAGS += " \
158 # since we cannot set empty set filename to a not existent file
159 deltask generate_qt_config_file
160
161+XPLATFORM_toolchain-clang = "linux-oe-clang"
162+XPLATFORM ?= "linux-oe-g++"
163+
164 do_configure() {
165 # Avoid qmake error "Cannot read [...]/usr/lib/qt5/mkspecs/oe-device-extra.pri: No such file or directory" during configuration
166 touch ${S}/mkspecs/oe-device-extra.pri
167@@ -188,7 +192,7 @@ do_configure() {
168 -external-hostbindir ${OE_QMAKE_PATH_EXTERNAL_HOST_BINS} \
169 -hostdatadir ${OE_QMAKE_PATH_HOST_DATA} \
170 -platform ${OE_QMAKE_PLATFORM_NATIVE} \
171- -xplatform linux-oe-g++ \
172+ -xplatform ${XPLATFORM} \
173 ${QT_CONFIG_FLAGS}
174 }
175
176--
1772.14.1
178
diff --git a/recipes-qt/qt5/qtbase-native_git.bb b/recipes-qt/qt5/qtbase-native_git.bb
index 72b977d3..5137deef 100644
--- a/recipes-qt/qt5/qtbase-native_git.bb
+++ b/recipes-qt/qt5/qtbase-native_git.bb
@@ -39,6 +39,8 @@ SRC_URI += "\
39SRC_URI += " \ 39SRC_URI += " \
40 file://0009-Always-build-uic.patch \ 40 file://0009-Always-build-uic.patch \
41 file://0010-Add-OE-specific-specs-for-clang-compiler.patch \ 41 file://0010-Add-OE-specific-specs-for-clang-compiler.patch \
42 file://0011-linux-clang-Invert-conditional-for-defining-QT_SOCKL.patch \
43 file://0012-tst_qlocale-Enable-QT_USE_FENV-only-on-glibc.patch \
42" 44"
43 45
44CLEANBROKEN = "1" 46CLEANBROKEN = "1"
diff --git a/recipes-qt/qt5/qtbase/0011-linux-clang-Invert-conditional-for-defining-QT_SOCKL.patch b/recipes-qt/qt5/qtbase/0011-linux-clang-Invert-conditional-for-defining-QT_SOCKL.patch
new file mode 100644
index 00000000..0c7fb874
--- /dev/null
+++ b/recipes-qt/qt5/qtbase/0011-linux-clang-Invert-conditional-for-defining-QT_SOCKL.patch
@@ -0,0 +1,35 @@
1From 8394ad48f454aa292e4da57b3b75a3701dadcf96 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 3 Sep 2017 09:44:48 -0700
4Subject: [PATCH] linux-clang: Invert conditional for defining QT_SOCKLEN_T
5
6This helps to make sure that QT_SOCKLEN_T is defined to be 'int'
7only when its glibc < 2 and not for other libcswhich may define
8it as per standards but are not glibc, e.g. musl
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 mkspecs/linux-clang/qplatformdefs.h | 6 +++---
13 1 file changed, 3 insertions(+), 3 deletions(-)
14
15diff --git a/mkspecs/linux-clang/qplatformdefs.h b/mkspecs/linux-clang/qplatformdefs.h
16index d29225f12f..a0cdb57343 100644
17--- a/mkspecs/linux-clang/qplatformdefs.h
18+++ b/mkspecs/linux-clang/qplatformdefs.h
19@@ -84,10 +84,10 @@
20
21 #undef QT_SOCKLEN_T
22
23-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
24-#define QT_SOCKLEN_T socklen_t
25-#else
26+#if defined(__GLIBC__) && (__GLIBC__ < 2)
27 #define QT_SOCKLEN_T int
28+#else
29+#define QT_SOCKLEN_T socklen_t
30 #endif
31
32 #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
33--
342.14.1
35
diff --git a/recipes-qt/qt5/qtbase/0012-tst_qlocale-Enable-QT_USE_FENV-only-on-glibc.patch b/recipes-qt/qt5/qtbase/0012-tst_qlocale-Enable-QT_USE_FENV-only-on-glibc.patch
new file mode 100644
index 00000000..a1776258
--- /dev/null
+++ b/recipes-qt/qt5/qtbase/0012-tst_qlocale-Enable-QT_USE_FENV-only-on-glibc.patch
@@ -0,0 +1,28 @@
1From 30076434a9f651614db8c3e5db32d4acae54c600 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 3 Sep 2017 10:11:50 -0700
4Subject: [PATCH] tst_qlocale: Enable QT_USE_FENV only on glibc
5
6musl does not have feenableexcept function
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
14index 10d78b1f2f..a59f358f80 100644
15--- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
16+++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
17@@ -46,7 +46,7 @@
18 #include <private/qlocale_tools_p.h>
19 #include <qnumeric.h>
20
21-#if defined(Q_OS_LINUX) && !defined(__UCLIBC__)
22+#if defined(Q_OS_LINUX) && defined(__GLIBC__)
23 # define QT_USE_FENV
24 #endif
25
26--
272.14.1
28
diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb
index 25d99e83..dce2d778 100644
--- a/recipes-qt/qt5/qtbase_git.bb
+++ b/recipes-qt/qt5/qtbase_git.bb
@@ -27,6 +27,8 @@ SRC_URI += "\
27 file://0007-Delete-qlonglong-and-qulonglong.patch \ 27 file://0007-Delete-qlonglong-and-qulonglong.patch \
28 file://0008-Replace-pthread_yield-with-sched_yield.patch \ 28 file://0008-Replace-pthread_yield-with-sched_yield.patch \
29 file://0010-Add-OE-specific-specs-for-clang-compiler.patch \ 29 file://0010-Add-OE-specific-specs-for-clang-compiler.patch \
30 file://0011-linux-clang-Invert-conditional-for-defining-QT_SOCKL.patch \
31 file://0012-tst_qlocale-Enable-QT_USE_FENV-only-on-glibc.patch \
30 file://run-ptest \ 32 file://run-ptest \
31" 33"
32 34