diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2022-05-16 23:09:36 +0200 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2022-05-20 13:04:10 +0200 |
commit | 283dd73e3cda0161970d5fb5f0b757f7b32bcf63 (patch) | |
tree | 0107da00dd8388e44c86fae7850018ccb8c1f233 /recipes-qt/qt5/qtwebengine/chromium/0023-chromium-musl-initialize-msghdr-in-a-compatible-mann.patch | |
parent | 6b29b21775558eea1a3ef3007133f08849b61b00 (diff) |
qtwebengine: Fix build with gcc-12
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'recipes-qt/qt5/qtwebengine/chromium/0023-chromium-musl-initialize-msghdr-in-a-compatible-mann.patch')
-rw-r--r-- | recipes-qt/qt5/qtwebengine/chromium/0023-chromium-musl-initialize-msghdr-in-a-compatible-mann.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0023-chromium-musl-initialize-msghdr-in-a-compatible-mann.patch b/recipes-qt/qt5/qtwebengine/chromium/0023-chromium-musl-initialize-msghdr-in-a-compatible-mann.patch new file mode 100644 index 00000000..e3bb75eb --- /dev/null +++ b/recipes-qt/qt5/qtwebengine/chromium/0023-chromium-musl-initialize-msghdr-in-a-compatible-mann.patch @@ -0,0 +1,45 @@ +From 93cb0ed94241d3d51dc845d958b2e3a0f7e977fa Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 10 May 2020 08:16:01 -0700 +Subject: [PATCH] chromium: musl: initialize msghdr in a compatible manner + +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> +--- + chromium/net/socket/udp_socket_posix.cc | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/chromium/net/socket/udp_socket_posix.cc b/chromium/net/socket/udp_socket_posix.cc +index 71265568be5..42e0d298045 100644 +--- a/chromium/net/socket/udp_socket_posix.cc ++++ b/chromium/net/socket/udp_socket_posix.cc +@@ -1151,8 +1151,12 @@ SendResult UDPSocketPosixSender::InternalSendmmsgBuffers( + 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) { |