aboutsummaryrefslogtreecommitdiffstats
path: root/0001-qtbase-Add-OE-clang-specific-mkspecs.patch
blob: 99c53317ad29ca64bff93cb171c987cc3f0b5454 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
From 75aeb71530c456b9800bcc83c104e3906e47e9e4 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 3 Sep 2017 09:29:02 -0700
Subject: [PATCH] qtbase: Add OE clang specific mkspecs

We can not piggy back clang anymore on existing
OE mkspecs since starting 5.9 the configure is
asking compiler for include paths and it needs to
know if platform is clang-linux or g++-linux

Fixes:
ERROR: failed to parse default search paths from compiler output

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 classes/qmake5_base.bbclass                        |  7 ++-
 recipes-qt/qt5/qtbase-native_git.bb                |  6 +-
 ...-Add-OE-specific-specs-for-clang-compiler.patch | 72 ++++++++++++++++++++++
 recipes-qt/qt5/qtbase_git.bb                       |  6 +-
 4 files changed, 87 insertions(+), 4 deletions(-)
 create mode 100644 recipes-qt/qt5/qtbase/0010-Add-OE-specific-specs-for-clang-compiler.patch

diff --git a/classes/qmake5_base.bbclass b/classes/qmake5_base.bbclass
index a556f4f..8e1fe20 100644
--- a/classes/qmake5_base.bbclass
+++ b/classes/qmake5_base.bbclass
@@ -1,6 +1,9 @@
 # hardcode linux, because that's what 0001-Add-linux-oe-g-platform.patch adds
-OE_QMAKE_PLATFORM_NATIVE = "linux-oe-g++"
-OE_QMAKE_PLATFORM = "linux-oe-g++"
+XPLATFORM_toolchain-clang = "linux-oe-clang"
+XPLATFORM ?= "linux-oe-g++"
+
+OE_QMAKE_PLATFORM_NATIVE = "${XPLATFORM}"
+OE_QMAKE_PLATFORM = "${XPLATFORM}"
 
 # Add -d to show debug output from every qmake call, but it prints *a lot*, better to add it only to debugged recipe
 OE_QMAKE_DEBUG_OUTPUT ?= ""
diff --git a/recipes-qt/qt5/qtbase-native_git.bb b/recipes-qt/qt5/qtbase-native_git.bb
index 54a0b78..72b977d 100644
--- a/recipes-qt/qt5/qtbase-native_git.bb
+++ b/recipes-qt/qt5/qtbase-native_git.bb
@@ -38,10 +38,14 @@ SRC_URI += "\
 # 5.9.meta-qt5-native.2
 SRC_URI += " \
     file://0009-Always-build-uic.patch \
+    file://0010-Add-OE-specific-specs-for-clang-compiler.patch \
 "
 
 CLEANBROKEN = "1"
 
+XPLATFORM_toolchain-clang = "linux-oe-clang"
+XPLATFORM ?= "linux-oe-g++"
+
 PACKAGECONFIG_CONFARGS = " \
     -sysroot ${STAGING_DIR_NATIVE} \
     -no-gcc-sysroot \
@@ -79,7 +83,7 @@ PACKAGECONFIG_CONFARGS = " \
     -nomake examples \
     -nomake tests \
     -no-rpath \
-    -platform linux-oe-g++ \
+    -platform ${XPLATFORM} \
 "
 
 # for qtbase configuration we need default settings
diff --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
new file mode 100644
index 0000000..b019f67
--- /dev/null
+++ b/recipes-qt/qt5/qtbase/0010-Add-OE-specific-specs-for-clang-compiler.patch
@@ -0,0 +1,72 @@
+From 3a46fb7b47d19c5261e1590f8d70fe41443def64 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 3 Sep 2017 09:11:44 -0700
+Subject: [PATCH] Add OE specific specs for clang compiler
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ mkspecs/linux-oe-clang/qmake.conf      | 43 ++++++++++++++++++++++++++++++++++
+ mkspecs/linux-oe-clang/qplatformdefs.h |  1 +
+ 2 files changed, 44 insertions(+)
+ create mode 100644 mkspecs/linux-oe-clang/qmake.conf
+ create mode 100644 mkspecs/linux-oe-clang/qplatformdefs.h
+
+diff --git a/mkspecs/linux-oe-clang/qmake.conf b/mkspecs/linux-oe-clang/qmake.conf
+new file mode 100644
+index 0000000000..ffc9f051db
+--- /dev/null
++++ b/mkspecs/linux-oe-clang/qmake.conf
+@@ -0,0 +1,43 @@
++#
++# qmake configuration for linux-g++ with modifications for building with OpenEmbedded
++#
++
++MAKEFILE_GENERATOR = UNIX
++CONFIG += incremental
++QMAKE_INCREMENTAL_STYLE = sublib
++
++include(../common/linux.conf)
++
++# QMAKE_<TOOL> (moc, uic, rcc) are gone, overwrite only ar and strip
++QMAKE_AR              = $$(OE_QMAKE_AR) cqs
++QMAKE_STRIP           = $$(OE_QMAKE_STRIP)
++QMAKE_WAYLAND_SCANNER = $$(OE_QMAKE_WAYLAND_SCANNER)
++
++include(../common/gcc-base-unix.conf)
++
++# *FLAGS from gcc-base.conf
++QMAKE_CFLAGS                += $$(OE_QMAKE_CFLAGS)
++QMAKE_CXXFLAGS              += $$(OE_QMAKE_CXXFLAGS)
++QMAKE_LFLAGS                += $$(OE_QMAKE_LDFLAGS)
++
++include(../common/clang.conf)
++
++# tc settings from g++-base.conf
++QMAKE_COMPILER = $$(OE_QMAKE_COMPILER) clang
++QMAKE_CC       = $$(OE_QMAKE_CC)
++QMAKE_CXX      = $$(OE_QMAKE_CXX)
++
++QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$(OE_QMAKE_CFLAGS)
++
++QMAKE_LINK         = $$(OE_QMAKE_LINK)
++QMAKE_LINK_SHLIB   = $$(OE_QMAKE_LINK)
++QMAKE_LINK_C       = $$(OE_QMAKE_LINK)
++QMAKE_LINK_C_SHLIB = $$(OE_QMAKE_LINK)
++
++# for the SDK
++isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $$(OE_QMAKE_QT_CONFIG)
++
++include(../oe-device-extra.pri)
++
++load(device_config)
++load(qt_config)
+diff --git a/mkspecs/linux-oe-clang/qplatformdefs.h b/mkspecs/linux-oe-clang/qplatformdefs.h
+new file mode 100644
+index 0000000000..880c927b21
+--- /dev/null
++++ b/mkspecs/linux-oe-clang/qplatformdefs.h
+@@ -0,0 +1 @@
++#include "../linux-clang/qplatformdefs.h"
+-- 
+2.14.1
+
diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb
index aaa59f3..25d99e8 100644
--- a/recipes-qt/qt5/qtbase_git.bb
+++ b/recipes-qt/qt5/qtbase_git.bb
@@ -26,6 +26,7 @@ SRC_URI += "\
     file://0006-Pretend-Qt5-wasn-t-found-if-OE_QMAKE_PATH_EXTERNAL_H.patch \
     file://0007-Delete-qlonglong-and-qulonglong.patch \
     file://0008-Replace-pthread_yield-with-sched_yield.patch \
+    file://0010-Add-OE-specific-specs-for-clang-compiler.patch \
     file://run-ptest \
 "
 
@@ -160,6 +161,9 @@ QT_CONFIG_FLAGS += " \
 # since we cannot set empty set filename to a not existent file
 deltask generate_qt_config_file
 
+XPLATFORM_toolchain-clang = "linux-oe-clang"
+XPLATFORM ?= "linux-oe-g++"
+
 do_configure() {
     # Avoid qmake error "Cannot read [...]/usr/lib/qt5/mkspecs/oe-device-extra.pri: No such file or directory" during configuration
     touch ${S}/mkspecs/oe-device-extra.pri
@@ -188,7 +192,7 @@ do_configure() {
         -external-hostbindir ${OE_QMAKE_PATH_EXTERNAL_HOST_BINS} \
         -hostdatadir ${OE_QMAKE_PATH_HOST_DATA} \
         -platform ${OE_QMAKE_PLATFORM_NATIVE} \
-        -xplatform linux-oe-g++ \
+        -xplatform ${XPLATFORM} \
         ${QT_CONFIG_FLAGS}
 }
 
-- 
2.14.1