1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-13 19:29:53 +03:00
aports/testing/qt6-qtwebengine/0002-musl-fixes.patch
2022-01-12 15:38:50 +00:00

185 lines
7.5 KiB
Diff

--- ./src/3rdparty/chromium/third_party/lss/linux_syscall_support.h.orig
+++ ./src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
@@ -139,12 +139,14 @@
*/
#pragma push_macro("stat64")
#pragma push_macro("fstat64")
+#pragma push_macro("fstatat64")
#pragma push_macro("lstat64")
#pragma push_macro("pread64")
#pragma push_macro("pwrite64")
#pragma push_macro("getdents64")
#undef stat64
#undef fstat64
+#undef fstatat64
#undef lstat64
#undef pread64
#undef pwrite64
@@ -1258,6 +1260,12 @@
#ifndef __NR_getrandom
#define __NR_getrandom 318
#endif
+
+#undef __NR_pread
+#define __NR_pread __NR_pread64
+#undef __NR_pwrite
+#define __NR_pwrite __NR_pwrite64
+
/* End of x86-64 definitions */
#elif defined(__mips__)
#if _MIPS_SIM == _MIPS_SIM_ABI32
@@ -4545,6 +4553,7 @@
* corresponding #pragma push_macro near the top of this file. */
#pragma pop_macro("stat64")
#pragma pop_macro("fstat64")
+#pragma pop_macro("fstatat64")
#pragma pop_macro("lstat64")
#pragma pop_macro("pread64")
#pragma pop_macro("pwrite64")
--- ./src/3rdparty/chromium/sandbox/linux/suid/process_util.h.orig
+++ ./src/3rdparty/chromium/sandbox/linux/suid/process_util.h
@@ -11,6 +11,14 @@
#include <stdbool.h>
#include <sys/types.h>
+// Some additional functions
+# define TEMP_FAILURE_RETRY(expression) \
+ (__extension__ \
+ ({ long int __result; \
+ do __result = (long int) (expression); \
+ while (__result == -1L && errno == EINTR); \
+ __result; }))
+
// This adjusts /proc/process/oom_score_adj so the Linux OOM killer
// will prefer certain process types over others. The range for the
// adjustment is [-1000, 1000], with [0, 1000] being user accessible.
--- ./src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc.orig 2020-04-12 08:26:40.184159217 -0400
+++ ./src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc 2020-04-12 08:46:16.737191222 -0400
@@ -174,7 +174,7 @@
// If the version of glibc doesn't include this information in
// siginfo_t (older than 2.17), we need to explicitly copy it
// into an arch_sigsys structure.
- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
+ memcpy(&sigsys, &info->__sifields, sizeof(sigsys));
#endif
#if defined(__mips__)
--- ./src/3rdparty/chromium/third_party/ffmpeg/libavutil/cpu.c.orig
+++ ./src/3rdparty/chromium/third_party/ffmpeg/libavutil/cpu.c
@@ -38,7 +38,6 @@
#include <sys/param.h>
#endif
#include <sys/types.h>
-#include <sys/sysctl.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
diff --git a/src/3rdparty/chromium/third_party/ots/src/include/opentype-sanitiser.h b/src/3rdparty/chromium/third_party/ots/src/include/opentype-sanitiser.h
--- a/src/3rdparty/chromium/third_party/ots/src/include/opentype-sanitiser.h
+++ b/src/3rdparty/chromium/third_party/ots/src/include/opentype-sanitiser.h
@@ -20,6 +20,7 @@ typedef unsigned __int64 uint64_t;
#define ots_htonl(x) _byteswap_ulong (x)
#define ots_htons(x) _byteswap_ushort (x)
#else
+#include <sys/types.h>
#include <arpa/inet.h>
#include <stdint.h>
#define ots_ntohl(x) ntohl (x)
diff --git a/src/3rdparty/chromium/base/logging.cc b/src/3rdparty/chromium/base/logging.cc
--- a/src/3rdparty/chromium/base/logging.cc
+++ b/src/3rdparty/chromium/base/logging.cc
@@ -558,7 +558,7 @@ LogMessage::LogMessage(const char* file, int line, const char* condition)
LogMessage::~LogMessage() {
size_t stack_start = stream_.tellp();
-#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && (defined(OS_LINUX) && defined(__GLIBC__)) && \
!defined(OS_AIX)
if (severity_ == LOGGING_FATAL && !base::debug::BeingDebugged()) {
// Include a stack trace on a fatal, unless a debugger is attached.
diff --git a/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc b/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc
--- a/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc
+++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc
@@ -29,7 +29,7 @@ size_t GetUnderestimatedStackSize() {
// FIXME: On Mac OSX and Linux, this method cannot estimate stack size
// correctly for the main thread.
-#elif defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
defined(OS_FUCHSIA)
// pthread_getattr_np() can fail if the thread is not invoked by
// pthread_create() (e.g., the main thread of blink_unittests).
@@ -97,7 +97,7 @@ return Threading::ThreadStackSize();
}
void* GetStackStart() {
-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
defined(OS_FUCHSIA)
pthread_attr_t attr;
int error;
--- ./src/3rdparty/chromium/net/dns/dns_config_service_posix.cc.orig
+++ ./src/3rdparty/chromium/net/dns/dns_config_service_posix.cc
@@ -122,7 +122,7 @@
ConfigParsePosixResult result;
config->unhandled_options = false;
// TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
-#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
+#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || defined(_GNU_SOURCE)
// Note: res_ninit in glibc always returns 0 and sets RES_INIT.
// res_init behaves the same way.
memset(&_res, 0, sizeof(_res));
diff --git a/src/3rdparty/chromium/third_party/nasm/nasmlib/realpath.c b/src/3rdparty/chromium/third_party/nasm/nasmlib/realpath.c
--- a/src/3rdparty/chromium/third_party/nasm/nasmlib/realpath.c
+++ b/src/3rdparty/chromium/third_party/nasm/nasmlib/realpath.c
@@ -47,7 +47,7 @@
#include "nasmlib.h"
-#ifdef HAVE_CANONICALIZE_FILE_NAME
+#if defined(__GLIBC__)
/*
* GNU-specific, but avoids the realpath(..., NULL)
--- ./src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/thread_utils.h.orig
+++ ./src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/thread_utils.h
@@ -61,9 +61,11 @@
#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
if (prctl(PR_GET_NAME, buf) != 0)
return false;
-#else
+#elif defined(__GLIBC__)
if (pthread_getname_np(pthread_self(), buf, sizeof(buf)) != 0)
return false;
+#else
+ return false;
#endif
out_result = std::string(buf);
return true;
--- ./src/3rdparty/chromium/base/files/file_util_posix.cc.orig
+++ ./src/3rdparty/chromium/base/files/file_util_posix.cc
@@ -845,6 +845,9 @@
// NaCl doesn't implement system calls to open files directly.
#if !defined(OS_NACL)
FILE* FileToFILE(File file, const char* mode) {
+ if (!file.IsValid() || !(fcntl(file.GetPlatformFile(), F_GETFD) != -1 || errno != EBADF))
+ return nullptr;
+
FILE* stream = fdopen(file.GetPlatformFile(), mode);
if (stream)
file.TakePlatformFile();
diff --git a/src/3rdparty/chromium/net/socket/udp_socket_posix.cc b/src/3rdparty/chromium/net/socket/udp_socket_posix.cc
index dbc8c5aaf..077bbde33 100644
--- a/src/3rdparty/chromium/net/socket/udp_socket_posix.cc
+++ b/src/3rdparty/chromium/net/socket/udp_socket_posix.cc
@@ -1152,7 +1152,7 @@ SendResult UDPSocketPosixSender::InternalSendmmsgBuffers(
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});
+ msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, 0, 0}, 0});
int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
SendResult send_result(0, 0, std::move(buffers));
if (result < 0) {