aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2019-02-02 23:25:58 -0800
committerMartin Jansa <Martin.Jansa@gmail.com>2019-02-14 17:40:27 +0000
commit5be2654885b3699520c4370579c929e2ce352e80 (patch)
tree3ae5a3bdf308a61dab72c2525a47a948f843d886
parentcb1b47212659a21514553cb0a0102861a6e2299b (diff)
qtwebengine: Fix build with clang/libc++ on aarch64/arm
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--recipes-qt/qt5/qtwebengine/0001-Force-host-toolchain-configuration.patch16
-rw-r--r--recipes-qt/qt5/qtwebengine/0003-Revert-use-new-feature-name-xkbcommon_evdev-xkbcommo.patch31
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0019-chromium-fix-build-with-clang.patch94
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0020-chromium-Check-for-__ARM_FP-2-before-using-__fp16.patch33
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0021-chromium-Exclude-CRC32-for-32bit-arm.patch31
-rw-r--r--recipes-qt/qt5/qtwebengine_git.bb4
6 files changed, 199 insertions, 10 deletions
diff --git a/recipes-qt/qt5/qtwebengine/0001-Force-host-toolchain-configuration.patch b/recipes-qt/qt5/qtwebengine/0001-Force-host-toolchain-configuration.patch
index b51c4c72..c9266582 100644
--- a/recipes-qt/qt5/qtwebengine/0001-Force-host-toolchain-configuration.patch
+++ b/recipes-qt/qt5/qtwebengine/0001-Force-host-toolchain-configuration.patch
@@ -17,8 +17,6 @@ Signed-off-by: Samuli Piippo <samuli.piippo@qt.io>
src/core/config/linux.pri | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
-diff --git a/src/buildtools/configure_host.pro b/src/buildtools/configure_host.pro
-index dd0d3e32..70161c82 100644
--- a/src/buildtools/configure_host.pro
+++ b/src/buildtools/configure_host.pro
@@ -4,7 +4,7 @@ TEMPLATE = aux
@@ -37,9 +35,9 @@ index dd0d3e32..70161c82 100644
-" cc = \"$$which($$QMAKE_CC)\" " \
-" cxx = \"$$which($$QMAKE_CXX)\" " \
-" ld = \"$$which($$QMAKE_LINK)\" " \
-+" cc = \"$$which(gcc)\" " \
-+" cxx = \"$$which(g++)\" " \
-+" ld = \"$$which(g++)\" " \
++" cc = \"$$which($$CC_host)\" " \
++" cxx = \"$$which($$CXX_host)\" " \
++" ld = \"$$which($$CXX_host)\" " \
" ar = \"$$which(ar)\" " \
" nm = \"$$which(nm)\" " \
" extra_cppflags = \"$$GN_HOST_EXTRA_CPPFLAGS\" " \
@@ -50,14 +48,12 @@ index dd0d3e32..70161c82 100644
-" cc = \"$$which($$QMAKE_CC)\" " \
-" cxx = \"$$which($$QMAKE_CXX)\" " \
-" ld = \"$$which($$QMAKE_LINK)\" " \
-+" cc = \"$$which(gcc)\" " \
-+" cxx = \"$$which(g++)\" " \
-+" ld = \"$$which(g++)\" " \
++" cc = \"$$which($$CC_host)\" " \
++" cxx = \"$$which($$CXX_host)\" " \
++" ld = \"$$which($$CXX_host)\" " \
" ar = \"$$which(ar)\" " \
" nm = \"$$which(nm)\" " \
" toolchain_args = { " \
-diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri
-index 85b948db..c529c641 100644
--- a/src/core/config/linux.pri
+++ b/src/core/config/linux.pri
@@ -112,7 +112,7 @@ contains(QT_ARCH, "mips") {
diff --git a/recipes-qt/qt5/qtwebengine/0003-Revert-use-new-feature-name-xkbcommon_evdev-xkbcommo.patch b/recipes-qt/qt5/qtwebengine/0003-Revert-use-new-feature-name-xkbcommon_evdev-xkbcommo.patch
new file mode 100644
index 00000000..97f82847
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/0003-Revert-use-new-feature-name-xkbcommon_evdev-xkbcommo.patch
@@ -0,0 +1,31 @@
+From 7d8231d53a5e79eaea9fe2566f407faf41b233b4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 2 Feb 2019 23:23:14 -0800
+Subject: [PATCH] Revert "use new feature name xkbcommon_evdev -> xkbcommon"
+
+This reverts commit 21112a89e3d742451d6b449fc7075d51266fe709.
+
+To be compatible with qtbase 5.12.0, remove this patch when upgrading
+qtbase to 5.12.1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/core/web_event_factory.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp
+index 06dbd7ff..a45f7048 100644
+--- a/src/core/web_event_factory.cpp
++++ b/src/core/web_event_factory.cpp
+@@ -101,7 +101,7 @@ static KeyboardDriver keyboardDriverImpl()
+ if (platformName == QLatin1Literal("xcb") || platformName == QLatin1Literal("wayland"))
+ return KeyboardDriver::Xkb;
+
+-#if QT_CONFIG(libinput) && QT_CONFIG(xkbcommon)
++#if QT_CONFIG(libinput) && QT_CONFIG(xkbcommon_evdev)
+ // Based on QEglFSIntegration::createInputHandlers and QLibInputKeyboard::processKey.
+ if (platformName == QLatin1Literal("eglfs") && !qEnvironmentVariableIntValue("QT_QPA_EGLFS_NO_LIBINPUT"))
+ return KeyboardDriver::Xkb;
+--
+2.20.1
+
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0019-chromium-fix-build-with-clang.patch b/recipes-qt/qt5/qtwebengine/chromium/0019-chromium-fix-build-with-clang.patch
new file mode 100644
index 00000000..050fb064
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0019-chromium-fix-build-with-clang.patch
@@ -0,0 +1,94 @@
+From 4ed2bab8183cf8252b52a493665ddf84188f12f6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 2 Feb 2019 19:28:59 -0800
+Subject: [PATCH] chromium: fix build with clang
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ chromium/build/config/compiler/BUILD.gn | 27 ++-----------------------
+ 1 file changed, 2 insertions(+), 25 deletions(-)
+
+diff --git a/chromium/build/config/compiler/BUILD.gn b/chromium/build/config/compiler/BUILD.gn
+index d223a4f6fd..1c42c49ea4 100644
+--- a/chromium/build/config/compiler/BUILD.gn
++++ b/chromium/build/config/compiler/BUILD.gn
+@@ -544,13 +544,6 @@ config("compiler") {
+ ]
+ }
+
+- # Tells the compiler not to use absolute paths when passing the default
+- # paths to the tools it invokes. We don't want this because we don't
+- # really need it and it can mess up the goma cache entries.
+- if (is_clang && !is_nacl) {
+- cflags += [ "-no-canonical-prefixes" ]
+- }
+-
+ # C11/C++11 compiler flags setup.
+ # ---------------------------
+ if (is_linux || is_android || (is_nacl && is_clang) || current_os == "aix") {
+@@ -748,8 +741,6 @@ config("compiler_cpu_abi") {
+ }
+ } else if (current_cpu == "arm") {
+ if (is_clang && !is_android && !is_nacl) {
+- cflags += [ "--target=arm-linux-gnueabihf" ]
+- ldflags += [ "--target=arm-linux-gnueabihf" ]
+ }
+ if (!is_nacl) {
+ cflags += [
+@@ -762,8 +753,6 @@ config("compiler_cpu_abi") {
+ }
+ } else if (current_cpu == "arm64") {
+ if (is_clang && !is_android && !is_nacl && !is_fuchsia) {
+- cflags += [ "--target=aarch64-linux-gnu" ]
+- ldflags += [ "--target=aarch64-linux-gnu" ]
+ }
+ } else if (current_cpu == "mipsel" && !is_nacl) {
+ ldflags += [ "-Wl,--hash-style=sysv" ]
+@@ -772,9 +761,6 @@ config("compiler_cpu_abi") {
+ if (is_android) {
+ cflags += [ "--target=mipsel-linux-android" ]
+ ldflags += [ "--target=mipsel-linux-android" ]
+- } else {
+- cflags += [ "--target=mipsel-linux-gnu" ]
+- ldflags += [ "--target=mipsel-linux-gnu" ]
+ }
+ } else {
+ cflags += [ "-EL" ]
+@@ -853,10 +839,7 @@ config("compiler_cpu_abi") {
+ } else if (current_cpu == "mips" && !is_nacl) {
+ ldflags += [ "-Wl,--hash-style=sysv" ]
+ if (custom_toolchain == "") {
+- if (is_clang) {
+- cflags += [ "--target=mips-linux-gnu" ]
+- ldflags += [ "--target=mips-linux-gnu" ]
+- } else {
++ if (!is_clang) {
+ cflags += [ "-EB" ]
+ ldflags += [ "-EB" ]
+ }
+@@ -902,9 +885,6 @@ config("compiler_cpu_abi") {
+ if (is_android) {
+ cflags += [ "--target=mips64el-linux-android" ]
+ ldflags += [ "--target=mips64el-linux-android" ]
+- } else {
+- cflags += [ "--target=mips64el-linux-gnuabi64" ]
+- ldflags += [ "--target=mips64el-linux-gnuabi64" ]
+ }
+ } else {
+ cflags += [
+@@ -961,10 +941,7 @@ config("compiler_cpu_abi") {
+ } else if (current_cpu == "mips64") {
+ ldflags += [ "-Wl,--hash-style=sysv" ]
+ if (custom_toolchain == "") {
+- if (is_clang) {
+- cflags += [ "--target=mips64-linux-gnuabi64" ]
+- ldflags += [ "--target=mips64-linux-gnuabi64" ]
+- } else {
++ if (!is_clang) {
+ cflags += [
+ "-EB",
+ "-mabi=64",
+--
+2.20.1
+
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0020-chromium-Check-for-__ARM_FP-2-before-using-__fp16.patch b/recipes-qt/qt5/qtwebengine/chromium/0020-chromium-Check-for-__ARM_FP-2-before-using-__fp16.patch
new file mode 100644
index 00000000..ef00025c
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0020-chromium-Check-for-__ARM_FP-2-before-using-__fp16.patch
@@ -0,0 +1,33 @@
+From f304341d4e0a24469575129e2f2a79a969d8ecaf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 2 Feb 2019 22:09:20 -0800
+Subject: [PATCH 1/2] chromium: Check for __ARM_FP & 2 before using __fp16
+
+The __fp16 type denotes half-precision (16-bit) floating-point.
+The recommended way to test for this hardware support is to test bit 1 in __ARM_FP
+and
+If 16-bit floating-point is available, one of __ARM_FP16_FORMAT_IEEE and
+__ARM_FP16_FORMAT_ALTERNATIVE will be defined to indicate the format in use
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h b/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
+index 33d9e7aa39..aaefa5371a 100644
+--- a/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
++++ b/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
+@@ -679,7 +679,7 @@ SI F from_half(U16 h) {
+ }
+
+ SI U16 to_half(F f) {
+-#if defined(__ARM_FP16_FORMAT_IEEE)
++#if defined(__ARM_FP16_FORMAT_IEEE) && defined(__ARM_NEON__) && (__ARM_FP & 2)
+ __fp16 fp16 = __fp16(f);
+ U16 u16;
+ memcpy(&u16, &fp16, sizeof(U16));
+--
+2.20.1
+
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0021-chromium-Exclude-CRC32-for-32bit-arm.patch b/recipes-qt/qt5/qtwebengine/chromium/0021-chromium-Exclude-CRC32-for-32bit-arm.patch
new file mode 100644
index 00000000..e0c0dbb6
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0021-chromium-Exclude-CRC32-for-32bit-arm.patch
@@ -0,0 +1,31 @@
+From 432514e835f5bfefc2bb88adbb2ba468e9c07beb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 5 Feb 2019 14:32:20 -0800
+Subject: [PATCH] chromium: Exclude CRC32 for 32bit arm
+
+This fixes build issues during cross compiling for linux using clang
+
+Fixes
+src/3rdparty/chromium/third_party/zlib/crc32_simd.c:184: undefined reference to `__crc32d'
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ chromium/third_party/zlib/BUILD.gn | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/chromium/third_party/zlib/BUILD.gn
++++ b/chromium/third_party/zlib/BUILD.gn
+@@ -70,8 +70,11 @@ config("zlib_arm_crc32_config") {
+ # - ChromeOS has wrapper scripts that are borking the compiler flags.
+ # - Fuchsia just added a syscall for feature detection.
+ # TODO(cavalcantii): crbug.com/810125.
++ defines = []
+ if (!is_ios && !is_chromeos && !is_fuchsia) {
+- defines = [ "CRC32_ARMV8_CRC32" ]
++ if (current_cpu == "arm64") {
++ defines += [ "CRC32_ARMV8_CRC32" ]
++ }
+ if (is_android) {
+ defines += [ "ARMV8_OS_ANDROID" ]
+ } else if (is_linux || is_chromeos) {
diff --git a/recipes-qt/qt5/qtwebengine_git.bb b/recipes-qt/qt5/qtwebengine_git.bb
index b64965de..bcddf889 100644
--- a/recipes-qt/qt5/qtwebengine_git.bb
+++ b/recipes-qt/qt5/qtwebengine_git.bb
@@ -140,6 +140,7 @@ SRC_URI += " \
${QT_GIT}/qtwebengine-chromium.git;name=chromium;branch=${QT_MODULE_BRANCH_CHROMIUM};protocol=${QT_GIT_PROTOCOL};destsuffix=git/src/3rdparty \
file://0001-Force-host-toolchain-configuration.patch \
file://0002-chromium_overrides.cpp-Fix-build-with-plugins-and-oz.patch \
+ file://0003-Revert-use-new-feature-name-xkbcommon_evdev-xkbcommo.patch \
"
SRC_URI_append_libc-musl = "\
file://0003-musl-don-t-use-pvalloc-as-it-s-not-available-on-musl.patch \
@@ -153,6 +154,9 @@ SRC_URI += " \
file://chromium/0002-chromium-workaround-for-too-long-.rps-file-name.patch;patchdir=src/3rdparty \
file://chromium/0003-chromium-Fix-build-with-gcc8.patch;patchdir=src/3rdparty \
file://chromium/0004-chromium-stack-pointer-clobber.patch;patchdir=src/3rdparty \
+ file://chromium/0019-chromium-fix-build-with-clang.patch;patchdir=src/3rdparty \
+ file://chromium/0020-chromium-Check-for-__ARM_FP-2-before-using-__fp16.patch;patchdir=src/3rdparty \
+ file://chromium/0021-chromium-Exclude-CRC32-for-32bit-arm.patch;patchdir=src/3rdparty \
"
SRC_URI_append_libc-musl = "\