aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-05-10 08:16:01 -0700
committerMartin Jansa <Martin.Jansa@gmail.com>2020-05-11 16:00:21 +0200
commit288cdf605351fbfc90d70c616f50a57d4b6d3bc6 (patch)
treef459499164d18bd3a438617d442f2ee646892bec
parentac9951b21856d111a8c62e65fbfc42386d2aea87 (diff)
qtwebengine: Fix build with musl
msghdr is not same between musl and glibc so do not assume that Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0026-chromium-musl-portable-msghdr.patch35
-rw-r--r--recipes-qt/qt5/qtwebengine_git.bb1
2 files changed, 36 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0026-chromium-musl-portable-msghdr.patch b/recipes-qt/qt5/qtwebengine/chromium/0026-chromium-musl-portable-msghdr.patch
new file mode 100644
index 00000000..3d6f5134
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0026-chromium-musl-portable-msghdr.patch
@@ -0,0 +1,35 @@
+initialize msghdr in a compatible manner
+
+msghdr stuct from socket.h is not same between musl and glibc
+where musl claims to be more posix compliant where as glibc seems
+to fill whats needed for linux sizewise and chooses long enough types
+which maybe questionable, therefore constructing a structure with explicit
+constructor is not going to work correctly for musl and glibc at same time
+
+see
+https://git.musl-libc.org/cgit/musl/commit/arch/x86_64/bits/socket.h?id=7168790763cdeb794df52be6e3b39fbb021c5a64
+
+This fix initialized the struct to 0 first and then sets the struct elements
+by name, so we dont have to hard code the positions of elements when initializing
+structure
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- a/chromium/net/socket/udp_socket_posix.cc
++++ b/chromium/net/socket/udp_socket_posix.cc
+@@ -1190,8 +1190,12 @@ SendResult UDPSocketPosixSender::Interna
+ for (auto& buffer : buffers)
+ msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+ msgvec->reserve(buffers.size());
+- for (size_t j = 0; j < buffers.size(); j++)
+- msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++ for (size_t j = 0; j < buffers.size(); j++) {
++ struct msghdr m = {0};
++ m.msg_iov = &msg_iov[j];
++ m.msg_iovlen = 1;
++ msgvec->push_back({m, 0});
++ }
+ int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+ SendResult send_result(0, 0, std::move(buffers));
+ if (result < 0) {
diff --git a/recipes-qt/qt5/qtwebengine_git.bb b/recipes-qt/qt5/qtwebengine_git.bb
index cc56f5d1..d7dd4d1f 100644
--- a/recipes-qt/qt5/qtwebengine_git.bb
+++ b/recipes-qt/qt5/qtwebengine_git.bb
@@ -187,6 +187,7 @@ SRC_URI_append_libc-musl = "\
file://chromium/0023-chromium-musl-Use-_fpstate-instead-of-_libc_fpstate-.patch;patchdir=src/3rdparty \
file://chromium/0024-chromium-musl-elf_reader.cc-include-sys-reg.h-to-get.patch;patchdir=src/3rdparty \
file://chromium/0025-chromium-musl-pread-pwrite.patch;patchdir=src/3rdparty \
+ file://chromium/0026-chromium-musl-portable-msghdr.patch;patchdir=src/3rdparty \
"
SRCREV_qtwebengine = "9e56f570e31a0ef18e544bb21dfddebfe43ec2d0"