aboutsummaryrefslogtreecommitdiffstats
path: root/community/chromium/musl-fixes.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/chromium/musl-fixes.patch')
-rw-r--r--community/chromium/musl-fixes.patch255
1 files changed, 150 insertions, 105 deletions
diff --git a/community/chromium/musl-fixes.patch b/community/chromium/musl-fixes.patch
index be2dcb4e60..2e4fdb1c1b 100644
--- a/community/chromium/musl-fixes.patch
+++ b/community/chromium/musl-fixes.patch
@@ -1,6 +1,20 @@
---- ./third_party/lss/linux_syscall_support.h
+--- ./third_party/lss/linux_syscall_support.h.orig
+++ ./third_party/lss/linux_syscall_support.h
-@@ -1239,6 +1239,12 @@
+@@ -139,11 +139,13 @@
+ */
+ #pragma push_macro("stat64")
+ #pragma push_macro("fstat64")
++#pragma push_macro("fstatat64")
+ #pragma push_macro("lstat64")
+ #pragma push_macro("pread64")
+ #pragma push_macro("pwrite64")
+ #undef stat64
+ #undef fstat64
++#undef fstatat64
+ #undef lstat64
+ #undef pread64
+ #undef pwrite64
+@@ -1244,6 +1246,12 @@
#ifndef __NR_fallocate
#define __NR_fallocate 285
#endif
@@ -13,10 +27,64 @@
/* End of x86-64 definitions */
#elif defined(__mips__)
#if _MIPS_SIM == _MIPS_SIM_ABI32
---- ./sandbox/linux/suid/process_util.h
+@@ -4520,6 +4528,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")
+--- ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h.orig
++++ ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+@@ -37,6 +37,10 @@
+ #include "common/memory.h"
+ #include "google_breakpad/common/minidump_format.h"
+
++#if !defined(__GLIBC__)
++ #define _libc_fpstate _fpstate
++#endif
++
+ namespace google_breakpad {
+
+ // Wraps platform-dependent implementations of accessors to ucontext_t structs.
+--- ./third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h.orig
++++ ./third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+@@ -48,7 +48,7 @@
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+
+ // These entries store a list of memory regions that the client wants included
+--- ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h.orig
++++ ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,7 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#include <limits.h>
+
+ #include "common/memory_range.h"
+
+@@ -51,9 +52,9 @@
+ typedef ElfW(Phdr) Phdr;
+ typedef ElfW(Word) Word;
+ typedef ElfW(Addr) Addr;
+-#if __WORDSIZE == 32
++#if ULONG_MAX == 0xffffffff
+ static const int kClass = ELFCLASS32;
+-#elif __WORDSIZE == 64
++#elif ULONG_MAX == 0xffffffffffffffff
+ static const int kClass = ELFCLASS64;
+ #else
+ #error "Unsupported __WORDSIZE for ElfCoreDump."
+--- ./sandbox/linux/suid/process_util.h.orig
+++ ./sandbox/linux/suid/process_util.h
-@@ -12,6 +12,14 @@
- #include <stdint.h>
+@@ -11,6 +11,14 @@
+ #include <stdbool.h>
#include <sys/types.h>
+// Some additional functions
@@ -30,20 +98,20 @@
// 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.
---- ./sandbox/linux/seccomp-bpf/trap.cc
-+++ ./sandbox/linux/seccomp-bpf/trap.cc
-@@ -168,7 +168,7 @@
- // most versions of glibc don't include this information in siginfo_t. So,
- // we need to explicitly copy it into a arch_sigsys structure.
- struct arch_sigsys sigsys;
+--- ./sandbox/linux/seccomp-bpf/trap.cc.orig 2020-04-12 08:26:40.184159217 -0400
++++ ./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->__si_fields, sizeof(sigsys));
++ memcpy(&sigsys, &info->__sifields, sizeof(sigsys));
+ #endif
#if defined(__mips__)
- // When indirect syscall (syscall(__NR_foo, ...)) is made on Mips, the
---- ./third_party/ffmpeg/libavutil/cpu.c
+--- ./third_party/ffmpeg/libavutil/cpu.c.orig
+++ ./third_party/ffmpeg/libavutil/cpu.c
-@@ -41,7 +41,6 @@
+@@ -38,7 +38,6 @@
#include <sys/param.h>
#endif
#include <sys/types.h>
@@ -51,9 +119,10 @@
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
+diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
--- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
+++ chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
-@@ -46,7 +46,9 @@
+@@ -39,7 +39,9 @@
#endif // defined(OS_ANDROID) && defined(__arm__)
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
@@ -63,7 +132,7 @@
#include "base/linux_util.h"
#include "base/strings/string_split.h"
-@@ -365,7 +367,7 @@ void RecordLinuxDistro() {
+@@ -295,7 +297,7 @@ void RecordLinuxDistro() {
#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS)
void RecordLinuxGlibcVersion() {
@@ -72,9 +141,30 @@
base::Version version(gnu_get_libc_version());
UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
---- ./base/logging.cc
+--- services/device/serial/serial_io_handler_posix.cc.orig 2019-07-03 10:57:32.568171835 -0400
++++ services/device/serial/serial_io_handler_posix.cc 2019-07-03 10:57:16.867983031 -0400
+@@ -6,6 +6,7 @@
+
+ #include <sys/ioctl.h>
+ #include <termios.h>
++#include <asm-generic/ioctls.h>
+
+ #include <algorithm>
+ #include <utility>
+diff --git a/third_party/ots/include/opentype-sanitiser.h b/third_party/ots/include/opentype-sanitiser.h
+--- third_party/ots/include/opentype-sanitiser.h
++++ third_party/ots/include/opentype-sanitiser.h
+@@ -20,6 +20,7 @@ typedef unsigned __int64 uint64_t;
+ #define htonl(x) _byteswap_ulong (x)
+ #define htons(x) _byteswap_ushort (x)
+ #else
++#include <sys/types.h>
+ #include <arpa/inet.h>
+ #include <stdint.h>
+ #endif
+--- ./base/logging.cc.orig
+++ ./base/logging.cc
-@@ -621,8 +621,7 @@
+@@ -545,8 +545,7 @@
LogMessage::~LogMessage() {
size_t stack_start = stream_.tellp();
@@ -83,34 +173,10 @@
+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__)
if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
// Include a stack trace on a fatal, unless a debugger is attached.
- base::debug::StackTrace stack_trace;
---- ./net/dns/dns_config_service_posix.cc
-+++ ./net/dns/dns_config_service_posix.cc
-@@ -150,7 +150,7 @@
- #if !defined(OS_ANDROID)
- ConfigParsePosixResult result;
- // 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));
---- base/native_library_posix.cc
-+++ base/native_library_posix.cc
-@@ -12,6 +12,10 @@
- #include "base/strings/utf_string_conversions.h"
- #include "base/threading/scoped_blocking_call.h"
-
-+#ifndef RTLD_DEEPBIND
-+#define RTLD_DEEPBIND 0
-+#endif
-+
- namespace base {
-
- std::string NativeLibraryLoadError::ToString() const {
---- ./third_party/blink/renderer/platform/wtf/stack_util.cc
+ base::debug::StackTrace trace;
+--- ./third_party/blink/renderer/platform/wtf/stack_util.cc.orig
+++ ./third_party/blink/renderer/platform/wtf/stack_util.cc
-@@ -29,7 +29,7 @@
+@@ -28,7 +28,7 @@
// FIXME: On Mac OSX and Linux, this method cannot estimate stack size
// correctly for the main thread.
@@ -118,8 +184,8 @@
+#if 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 @@
+ // pthread_create() (e.g., the main thread of webkit_unit_tests).
+@@ -96,7 +96,7 @@
}
void* GetStackStart() {
@@ -128,65 +194,44 @@
defined(OS_FUCHSIA)
pthread_attr_t attr;
int error;
---- third_party/lss/linux_syscall_support.h
-+++ third_party/lss/linux_syscall_support.h
-@@ -132,15 +132,18 @@
-
- /* The Android NDK's <sys/stat.h> #defines these macros as aliases
- * to their non-64 counterparts. To avoid naming conflict, remove them. */
--#ifdef __ANDROID__
-+#if defined(fstat64)
- /* These are restored by the corresponding #pragma pop_macro near
- * the end of this file. */
- # pragma push_macro("stat64")
- # pragma push_macro("fstat64")
-+# pragma push_macro("fstatat64")
- # pragma push_macro("lstat64")
- # undef stat64
- # undef fstat64
-+# undef fstatat64
- # undef lstat64
-+# define __RESTORE_MACRO 1
+--- ./net/dns/dns_config_service_posix.cc.orig
++++ ./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));
+--- third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc.orig 2019-06-18 11:51:17.000000000 -0400
++++ third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc 2019-07-03 12:32:50.938758186 -0400
+@@ -25,7 +25,7 @@
+ #include "llvm/Support/raw_ostream.h"
+ #include <algorithm>
+ #include <string>
+-#if HAVE_EXECINFO_H
++#if HAVE_EXECINFO_H && defined(__GLIBC__)
+ # include <execinfo.h> // For backtrace().
#endif
-
- #if defined(__ANDROID__) && defined(__x86_64__)
-@@ -4517,12 +4518,14 @@
- # endif
+ #if HAVE_SIGNAL_H
+@@ -52,6 +52,7 @@
+ #include <unwind.h>
+ #else
+ #undef HAVE__UNWIND_BACKTRACE
++#undef HAVE_BACKTRACE
#endif
-
--#ifdef __ANDROID__
-+#ifdef __RESTORE_MACRO
- /* These restore the original values of these macros saved by the
- * 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")
-+#undef __RESTORE_MACRO
#endif
- #if defined(__cplusplus) && !defined(SYS_CPLUSPLUS)
---- third_party/crashpad/crashpad/util/linux/ptracer.cc
-+++ third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -28,6 +28,10 @@
- #include <asm/ldt.h>
- #endif
+--- third_party/nasm/nasmlib/realpath.c.orig 2019-07-03 12:23:05.021949895 -0400
++++ third_party/nasm/nasmlib/realpath.c 2019-07-03 12:24:24.246862665 -0400
+@@ -49,7 +49,7 @@
-+#if defined(ARCH_CPU_ARM_FAMILY)
-+#include <asm/ptrace.h>
-+#endif
-+
- namespace crashpad {
-
- namespace {
---- third_party/crashpad/crashpad/util/linux/thread_info.h
-+++ third_party/crashpad/crashpad/util/linux/thread_info.h
-@@ -273,7 +273,7 @@
- "Size mismatch");
- #elif defined(ARCH_CPU_ARMEL)
- static_assert(sizeof(f32_t::fpregs) == sizeof(user_fpregs), "Size mismatch");
--#if !defined(__GLIBC__)
-+#if !defined(__linux__)
- static_assert(sizeof(f32_t::vfp) == sizeof(user_vfp), "Size mismatch");
- #endif
- #elif defined(ARCH_CPU_ARM64)
+ #include "nasmlib.h"
+
+-#ifdef HAVE_CANONICALIZE_FILE_NAME
++#if defined(__GLIBC__)
+
+ /*
+ * GNU-specific, but avoids the realpath(..., NULL)