diff options
Diffstat (limited to 'dev-qt/qtwebengine/files')
21 files changed, 1128 insertions, 0 deletions
diff --git a/dev-qt/qtwebengine/files/musl/arm-missing-files.patch b/dev-qt/qtwebengine/files/musl/arm-missing-files.patch new file mode 100644 index 00000000..59af5db0 --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/arm-missing-files.patch @@ -0,0 +1,205 @@ +From bf9a9d0532d7749901082ffce976d182672c2d36 Mon Sep 17 00:00:00 2001 +From: Allan Sandfeld Jensen <allan.jensen@qt.io> +Date: Mon, 10 Dec 2018 14:35:22 +0100 +Subject: [PATCH] Fix building gn on arm + +Two arm header files were missing. + +Change-Id: I3d9cd03c682b9de6b38e75085bcda9deef81b5fa +Fixes: QTBUG-72393 +Reviewed-by: Michal Klocek <michal.klocek@qt.io> +--- + gn/base/numerics/safe_conversions_arm_impl.h | 51 +++++++++++ + gn/base/numerics/safe_math_arm_impl.h | 122 +++++++++++++++++++++++++++ + 2 files changed, 173 insertions(+) + create mode 100644 gn/base/numerics/safe_conversions_arm_impl.h + create mode 100644 gn/base/numerics/safe_math_arm_impl.h + +diff --git a/src/3rdparty/gn/base/numerics/safe_conversions_arm_impl.h b/src/3rdparty/gn/base/numerics/safe_conversions_arm_impl.h +new file mode 100644 +index 0000000000..da5813f65e +--- /dev/null ++++ b/src/3rdparty/gn/base/numerics/safe_conversions_arm_impl.h +@@ -0,0 +1,51 @@ ++// Copyright 2017 The Chromium Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef BASE_NUMERICS_SAFE_CONVERSIONS_ARM_IMPL_H_ ++#define BASE_NUMERICS_SAFE_CONVERSIONS_ARM_IMPL_H_ ++ ++#include <cassert> ++#include <limits> ++#include <type_traits> ++ ++#include "base/numerics/safe_conversions_impl.h" ++ ++namespace base { ++namespace internal { ++ ++// Fast saturation to a destination type. ++template <typename Dst, typename Src> ++struct SaturateFastAsmOp { ++ static const bool is_supported = ++ std::is_signed<Src>::value && std::is_integral<Dst>::value && ++ std::is_integral<Src>::value && ++ IntegerBitsPlusSign<Src>::value <= IntegerBitsPlusSign<int32_t>::value && ++ IntegerBitsPlusSign<Dst>::value <= IntegerBitsPlusSign<int32_t>::value && ++ !IsTypeInRangeForNumericType<Dst, Src>::value; ++ ++ __attribute__((always_inline)) static Dst Do(Src value) { ++ int32_t src = value; ++ typename std::conditional<std::is_signed<Dst>::value, int32_t, ++ uint32_t>::type result; ++ if (std::is_signed<Dst>::value) { ++ asm("ssat %[dst], %[shift], %[src]" ++ : [dst] "=r"(result) ++ : [src] "r"(src), [shift] "n"(IntegerBitsPlusSign<Dst>::value <= 32 ++ ? IntegerBitsPlusSign<Dst>::value ++ : 32)); ++ } else { ++ asm("usat %[dst], %[shift], %[src]" ++ : [dst] "=r"(result) ++ : [src] "r"(src), [shift] "n"(IntegerBitsPlusSign<Dst>::value < 32 ++ ? IntegerBitsPlusSign<Dst>::value ++ : 31)); ++ } ++ return static_cast<Dst>(result); ++ } ++}; ++ ++} // namespace internal ++} // namespace base ++ ++#endif // BASE_NUMERICS_SAFE_CONVERSIONS_ARM_IMPL_H_ +diff --git a/src/3rdparty/gn/base/numerics/safe_math_arm_impl.h b/src/3rdparty/gn/base/numerics/safe_math_arm_impl.h +new file mode 100644 +index 0000000000..a7cda1bb23 +--- /dev/null ++++ b/src/3rdparty/gn/base/numerics/safe_math_arm_impl.h +@@ -0,0 +1,122 @@ ++// Copyright 2017 The Chromium Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef BASE_NUMERICS_SAFE_MATH_ARM_IMPL_H_ ++#define BASE_NUMERICS_SAFE_MATH_ARM_IMPL_H_ ++ ++#include <cassert> ++#include <limits> ++#include <type_traits> ++ ++#include "base/numerics/safe_conversions.h" ++ ++namespace base { ++namespace internal { ++ ++template <typename T, typename U> ++struct CheckedMulFastAsmOp { ++ static const bool is_supported = ++ FastIntegerArithmeticPromotion<T, U>::is_contained; ++ ++ // The following is much more efficient than the Clang and GCC builtins for ++ // performing overflow-checked multiplication when a twice wider type is ++ // available. The below compiles down to 2-3 instructions, depending on the ++ // width of the types in use. ++ // As an example, an int32_t multiply compiles to: ++ // smull r0, r1, r0, r1 ++ // cmp r1, r1, asr #31 ++ // And an int16_t multiply compiles to: ++ // smulbb r1, r1, r0 ++ // asr r2, r1, #16 ++ // cmp r2, r1, asr #15 ++ template <typename V> ++ __attribute__((always_inline)) static bool Do(T x, U y, V* result) { ++ using Promotion = typename FastIntegerArithmeticPromotion<T, U>::type; ++ Promotion presult; ++ ++ presult = static_cast<Promotion>(x) * static_cast<Promotion>(y); ++ *result = static_cast<V>(presult); ++ return IsValueInRangeForNumericType<V>(presult); ++ } ++}; ++ ++template <typename T, typename U> ++struct ClampedAddFastAsmOp { ++ static const bool is_supported = ++ BigEnoughPromotion<T, U>::is_contained && ++ IsTypeInRangeForNumericType< ++ int32_t, ++ typename BigEnoughPromotion<T, U>::type>::value; ++ ++ template <typename V> ++ __attribute__((always_inline)) static V Do(T x, U y) { ++ // This will get promoted to an int, so let the compiler do whatever is ++ // clever and rely on the saturated cast to bounds check. ++ if (IsIntegerArithmeticSafe<int, T, U>::value) ++ return saturated_cast<V>(x + y); ++ ++ int32_t result; ++ int32_t x_i32 = x; ++ int32_t y_i32 = y; ++ ++ asm("qadd %[result], %[first], %[second]" ++ : [result] "=r"(result) ++ : [first] "r"(x_i32), [second] "r"(y_i32)); ++ return saturated_cast<V>(result); ++ } ++}; ++ ++template <typename T, typename U> ++struct ClampedSubFastAsmOp { ++ static const bool is_supported = ++ BigEnoughPromotion<T, U>::is_contained && ++ IsTypeInRangeForNumericType< ++ int32_t, ++ typename BigEnoughPromotion<T, U>::type>::value; ++ ++ template <typename V> ++ __attribute__((always_inline)) static V Do(T x, U y) { ++ // This will get promoted to an int, so let the compiler do whatever is ++ // clever and rely on the saturated cast to bounds check. ++ if (IsIntegerArithmeticSafe<int, T, U>::value) ++ return saturated_cast<V>(x - y); ++ ++ int32_t result; ++ int32_t x_i32 = x; ++ int32_t y_i32 = y; ++ ++ asm("qsub %[result], %[first], %[second]" ++ : [result] "=r"(result) ++ : [first] "r"(x_i32), [second] "r"(y_i32)); ++ return saturated_cast<V>(result); ++ } ++}; ++ ++template <typename T, typename U> ++struct ClampedMulFastAsmOp { ++ static const bool is_supported = CheckedMulFastAsmOp<T, U>::is_supported; ++ ++ template <typename V> ++ __attribute__((always_inline)) static V Do(T x, U y) { ++ // Use the CheckedMulFastAsmOp for full-width 32-bit values, because ++ // it's fewer instructions than promoting and then saturating. ++ if (!IsIntegerArithmeticSafe<int32_t, T, U>::value && ++ !IsIntegerArithmeticSafe<uint32_t, T, U>::value) { ++ V result; ++ if (CheckedMulFastAsmOp<T, U>::Do(x, y, &result)) ++ return result; ++ return CommonMaxOrMin<V>(IsValueNegative(x) ^ IsValueNegative(y)); ++ } ++ ++ assert((FastIntegerArithmeticPromotion<T, U>::is_contained)); ++ using Promotion = typename FastIntegerArithmeticPromotion<T, U>::type; ++ return saturated_cast<V>(static_cast<Promotion>(x) * ++ static_cast<Promotion>(y)); ++ } ++}; ++ ++} // namespace internal ++} // namespace base ++ ++#endif // BASE_NUMERICS_SAFE_MATH_ARM_IMPL_H_ +-- +2.16.3 + diff --git a/dev-qt/qtwebengine/files/musl/arm-void-is-not-android.patch b/dev-qt/qtwebengine/files/musl/arm-void-is-not-android.patch new file mode 100644 index 00000000..6ae86dde --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/arm-void-is-not-android.patch @@ -0,0 +1,17 @@ +--- qtwebengine/src/3rdparty/chromium/third_party/openmax_dl/dl/BUILD.gn 2017-11-28 14:06:53.000000000 +0100 ++++ qtwebengine/src/3rdparty/chromium/third_party/openmax_dl/dl/BUILD.gn 2018-01-30 16:42:15.332826020 +0100 +@@ -194,14 +194,6 @@ + "sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S", + "sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S", + ] +- if (arm_optionally_use_neon) { +- # Run-time NEON detection. +- deps = [ "//third_party/android_tools:cpu_features" ] +- # To get the __android_log_print routine +- libs = [ "log" ] +- # Detection routine +- sources += [ "sp/src/arm/detect.c" ] +- } + } + + # GYP: third_party/openmax_dl/dl/dl.gyp:openmax_dl_neon diff --git a/dev-qt/qtwebengine/files/musl/musl-sandbox.patch b/dev-qt/qtwebengine/files/musl/musl-sandbox.patch new file mode 100644 index 00000000..46b5d0bc --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/musl-sandbox.patch @@ -0,0 +1,70 @@ +diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc +index 5f81dff..85b7ea0 100644 +--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc ++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc +@@ -129,23 +129,13 @@ namespace sandbox { + // CLONE_VM, nor CLONE_THREAD, which includes all fork() implementations. + ResultExpr RestrictCloneToThreadsAndEPERMFork() { + const Arg<unsigned long> flags(0); ++ const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | ++ CLONE_THREAD | CLONE_SYSVSEM; ++ const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID | ++ CLONE_DETACHED; ++ const BoolExpr thread_clone_ok = (flags&~safe)==required; + +- // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2. +- const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES | +- CLONE_SIGHAND | CLONE_THREAD | +- CLONE_SYSVSEM; +- const uint64_t kObsoleteAndroidCloneMask = kAndroidCloneMask | CLONE_DETACHED; +- +- const uint64_t kGlibcPthreadFlags = +- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD | +- CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID; +- const BoolExpr glibc_test = flags == kGlibcPthreadFlags; +- +- const BoolExpr android_test = +- AnyOf(flags == kAndroidCloneMask, flags == kObsoleteAndroidCloneMask, +- flags == kGlibcPthreadFlags); +- +- return If(IsAndroid() ? android_test : glibc_test, Allow()) ++ return If(thread_clone_ok, Allow()) + .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM)) + .Else(CrashSIGSYSClone()); + } +diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +index 1d9f95c..21fbe21 100644 +--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc ++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +@@ -373,6 +373,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) { + #if defined(__i386__) + case __NR_waitpid: + #endif ++ case __NR_set_tid_address: + return true; + case __NR_clone: // Should be parameter-restricted. + case __NR_setns: // Privileged. +@@ -385,7 +386,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) { + #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) + case __NR_set_thread_area: + #endif +- case __NR_set_tid_address: + case __NR_unshare: + #if !defined(__mips__) && !defined(__aarch64__) + case __NR_vfork: +@@ -492,6 +492,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) { + case __NR_mlock: + case __NR_munlock: + case __NR_munmap: ++ case __NR_mremap: + return true; + case __NR_madvise: + case __NR_mincore: +@@ -507,7 +508,6 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) { + case __NR_modify_ldt: + #endif + case __NR_mprotect: +- case __NR_mremap: + case __NR_msync: + case __NR_munlockall: + case __NR_readahead: diff --git a/dev-qt/qtwebengine/files/musl/qt-musl-dispatch_to_musl.patch b/dev-qt/qtwebengine/files/musl/qt-musl-dispatch_to_musl.patch new file mode 100644 index 00000000..1258d4f3 --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/qt-musl-dispatch_to_musl.patch @@ -0,0 +1,103 @@ +--- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc ++++ qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc +@@ -6,6 +6,7 @@ + + #include <malloc.h> + ++#if defined(__GLIBC__) + // This translation unit defines a default dispatch for the allocator shim which + // routes allocations to libc functions. + // The code here is strongly inspired from tcmalloc's libc_override_glibc.h. +@@ -73,3 +74,92 @@ const AllocatorDispatch AllocatorDispatch::default_dispatch = { + nullptr, /* free_definite_size_function */ + nullptr, /* next */ + }; ++ ++#else // defined(__GLIBC__) ++ ++#include <dlfcn.h> ++ ++extern "C" { ++// Declare function pointers to the memory functions ++typedef void* (*t_libc_malloc)(size_t size); ++typedef void* (*t_libc_calloc)(size_t n, size_t size); ++typedef void* (*t_libc_realloc)(void* address, size_t size); ++typedef void* (*t_libc_memalign)(size_t alignment, size_t size); ++typedef void (*t_libc_free)(void* ptr); ++typedef size_t (*t_libc_malloc_usable_size)(void* ptr); ++ ++// Static instances of pointers to libc.so dl symbols ++static t_libc_malloc libc_malloc = NULL; ++static t_libc_calloc libc_calloc = NULL; ++static t_libc_realloc libc_realloc = NULL; ++static t_libc_memalign libc_memalign = NULL; ++static t_libc_free libc_free = NULL; ++static t_libc_malloc_usable_size libc_malloc_usable_size = NULL; ++ ++// resolve the symbols in libc.so ++void musl_libc_memory_init(void) ++{ ++ libc_malloc = (t_libc_malloc) dlsym(RTLD_NEXT, "malloc"); ++ libc_calloc = (t_libc_calloc) dlsym(RTLD_NEXT, "calloc"); ++ libc_realloc = (t_libc_realloc) dlsym(RTLD_NEXT, "realloc"); ++ libc_memalign = (t_libc_memalign) dlsym(RTLD_NEXT, "memalign"); ++ libc_free = (t_libc_free) dlsym(RTLD_NEXT, "free"); ++ libc_malloc_usable_size = (t_libc_malloc_usable_size) dlsym(RTLD_NEXT, "malloc_usable_size"); ++} ++} // extern "C" ++ ++namespace { ++ ++using base::allocator::AllocatorDispatch; ++ ++void* MuslMalloc(const AllocatorDispatch*, size_t size, void* context) { ++ if (!libc_malloc) ++ musl_libc_memory_init(); ++ return (*libc_malloc)(size); ++} ++ ++void* MuslCalloc(const AllocatorDispatch*, size_t n, size_t size, void* context) { ++ if (!libc_calloc) ++ musl_libc_memory_init(); ++ return (*libc_calloc)(n, size); ++} ++ ++void* MuslRealloc(const AllocatorDispatch*, void* address, size_t size, void* context) { ++ if (!libc_realloc) ++ musl_libc_memory_init(); ++ return (*libc_realloc)(address, size); ++} ++ ++void* MuslMemalign(const AllocatorDispatch*, size_t alignment, size_t size, void* context) { ++ if (!libc_memalign) ++ musl_libc_memory_init(); ++ return (*libc_memalign)(alignment, size); ++} ++ ++void MuslFree(const AllocatorDispatch*, void* address, void* context) { ++ if (!libc_free) ++ musl_libc_memory_init(); ++ (*libc_free)(address); ++} ++ ++size_t MuslGetSizeEstimate(const AllocatorDispatch*, void* address, void* context) { ++ // TODO(siggi, primiano): malloc_usable_size may need redirection in the ++ // presence of interposing shims that divert allocations. ++ if (!libc_malloc_usable_size) ++ musl_libc_memory_init(); ++ return (*libc_malloc_usable_size)(address); ++} ++ ++} // namespace ++ ++const AllocatorDispatch AllocatorDispatch::default_dispatch = { ++ &MuslMalloc, /* alloc_function */ ++ &MuslCalloc, /* alloc_zero_initialized_function */ ++ &MuslMemalign, /* alloc_aligned_function */ ++ &MuslRealloc, /* realloc_function */ ++ &MuslFree, /* free_function */ ++ &MuslGetSizeEstimate, /* get_size_estimate_function */ ++ nullptr, /* next */ ++}; ++ ++#endif diff --git a/dev-qt/qtwebengine/files/musl/qt-musl-execinfo.patch b/dev-qt/qtwebengine/files/musl/qt-musl-execinfo.patch new file mode 100644 index 00000000..af8d55ca --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/qt-musl-execinfo.patch @@ -0,0 +1,259 @@ +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/base/debug/leak_tracker.h qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/base/debug/leak_tracker.h +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/base/debug/leak_tracker.h 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/base/debug/leak_tracker.h 2019-01-03 16:49:39.751073711 +0000 +@@ -10,7 +10,7 @@ + #include "build/build_config.h" + + // Only enable leak tracking in non-uClibc debug builds. +-#if !defined(NDEBUG) && !defined(__UCLIBC__) ++#if !defined(NDEBUG) && defined(__GLIBC__) + #define ENABLE_LEAK_TRACKER + #endif + +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/base/debug/stack_trace.cc qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/base/debug/stack_trace.cc +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/base/debug/stack_trace.cc 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/base/debug/stack_trace.cc 2019-01-03 16:49:46.971351734 +0000 +@@ -214,7 +214,7 @@ + + std::string StackTrace::ToString() const { + std::stringstream stream; +-#if !defined(__UCLIBC__) && !defined(_AIX) ++#if defined(__GLIBC__) && !defined(_AIX) + OutputToStream(&stream); + #endif + return stream.str(); +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/base/debug/stack_trace.h qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/base/debug/stack_trace.h +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/base/debug/stack_trace.h 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/base/debug/stack_trace.h 2019-01-03 16:49:59.271825377 +0000 +@@ -83,7 +83,7 @@ + // Prints the stack trace to stderr. + void Print() const; + +-#if !defined(__UCLIBC__) & !defined(_AIX) ++#if defined(__GLIBC__) & !defined(_AIX) + // Resolves backtrace to symbols and write to stream. + void OutputToStream(std::ostream* os) const; + #endif +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/base/debug/stack_trace_posix.cc qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/base/debug/stack_trace_posix.cc +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/base/debug/stack_trace_posix.cc 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/base/debug/stack_trace_posix.cc 2019-01-03 16:48:39.980772200 +0000 +@@ -27,7 +27,7 @@ + #if !defined(USE_SYMBOLIZE) + #include <cxxabi.h> + #endif +-#if !defined(__UCLIBC__) && !defined(_AIX) ++#if defined(__GLIBC__) && !defined(_AIX) + #include <execinfo.h> + #endif + +@@ -85,7 +85,7 @@ + // Note: code in this function is NOT async-signal safe (std::string uses + // malloc internally). + +-#if !defined(__UCLIBC__) && !defined(_AIX) ++#if defined(__GLIBC__) && !defined(_AIX) + std::string::size_type search_from = 0; + while (search_from < text->size()) { + // Look for the start of a mangled symbol, from search_from. +@@ -120,7 +120,7 @@ + search_from = mangled_start + 2; + } + } +-#endif // !defined(__UCLIBC__) && !defined(_AIX) ++#endif // defined(__GLIBC__) && !defined(_AIX) + } + #endif // !defined(USE_SYMBOLIZE) + +@@ -132,7 +132,7 @@ + virtual ~BacktraceOutputHandler() = default; + }; + +-#if !defined(__UCLIBC__) && !defined(_AIX) ++#if defined(__GLIBC__) && !defined(_AIX) + void OutputPointer(void* pointer, BacktraceOutputHandler* handler) { + // This should be more than enough to store a 64-bit number in hex: + // 16 hex digits + 1 for null-terminator. +@@ -209,7 +209,7 @@ + } + #endif // defined(USE_SYMBOLIZE) + } +-#endif // !defined(__UCLIBC__) && !defined(_AIX) ++#endif // defined(__GLIBC__) && !defined(_AIX) + + void PrintToStderr(const char* output) { + // NOTE: This code MUST be async-signal safe (it's used by in-process +@@ -800,7 +800,7 @@ + // NOTE: This code MUST be async-signal safe (it's used by in-process + // stack dumping signal handler). NO malloc or stdio is allowed here. + +-#if !defined(__UCLIBC__) && !defined(_AIX) ++#if defined(__GLIBC__) && !defined(_AIX) + count = std::min(arraysize(trace_), count); + + // Though the backtrace API man page does not list any possible negative +@@ -815,13 +815,13 @@ + // NOTE: This code MUST be async-signal safe (it's used by in-process + // stack dumping signal handler). NO malloc or stdio is allowed here. + +-#if !defined(__UCLIBC__) && !defined(_AIX) ++#if defined(__GLIBC__) && !defined(_AIX) + PrintBacktraceOutputHandler handler; + ProcessBacktrace(trace_, count_, &handler); + #endif + } + +-#if !defined(__UCLIBC__) && !defined(_AIX) ++#if defined(__GLIBC__) && !defined(_AIX) + void StackTrace::OutputToStream(std::ostream* os) const { + StreamBacktraceOutputHandler handler(os); + ProcessBacktrace(trace_, count_, &handler); +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/base/debug/stack_trace_unittest.cc qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/base/debug/stack_trace_unittest.cc +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/base/debug/stack_trace_unittest.cc 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/base/debug/stack_trace_unittest.cc 2019-01-03 16:49:05.605758913 +0000 +@@ -39,7 +39,7 @@ + #else + #define MAYBE_OutputToStream OutputToStream + #endif +-#if !defined(__UCLIBC__) && !defined(_AIX) ++#if defined(__GLIBC__) && !defined(_AIX) + TEST_F(StackTraceTest, MAYBE_OutputToStream) { + StackTrace trace; + +@@ -151,7 +151,7 @@ + TEST_F(StackTraceTest, DebugPrintBacktrace) { + StackTrace().Print(); + } +-#endif // !defined(__UCLIBC__) ++#endif // defined(__GLIBC__) + + #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_FUCHSIA) + #if !defined(OS_IOS) +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/base/logging.cc qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/base/logging.cc +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/base/logging.cc 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/base/logging.cc 2019-01-03 16:50:39.137361583 +0000 +@@ -574,7 +574,7 @@ + + 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(__GLIBC__) && \ + !defined(OS_AIX) + if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) { + // Include a stack trace on a fatal, unless a debugger is attached. +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/build/build_config.h qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/build/build_config.h +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/build/build_config.h 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/build/build_config.h 2019-01-03 16:47:30.314089618 +0000 +@@ -43,7 +43,7 @@ + #define OS_LINUX 1 + // include a system header to pull in features.h for glibc/uclibc macros. + #include <unistd.h> +-#if defined(__GLIBC__) && !defined(__UCLIBC__) ++#if defined(__GLIBC__) + // we really are using glibc, not uClibc pretending to be glibc + #define LIBC_GLIBC 1 + #endif +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/WebKit/Source/platform/wtf/Assertions.cpp qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/WebKit/Source/platform/wtf/Assertions.cpp +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/WebKit/Source/platform/wtf/Assertions.cpp 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/WebKit/Source/platform/wtf/Assertions.cpp 2019-01-03 16:53:50.292728521 +0000 +@@ -49,7 +49,7 @@ + #include <windows.h> + #endif + +-#if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(__UCLIBC__)) ++#if defined(OS_MACOSX) || (defined(OS_LINUX) && defined(__GLIBC__)) + #include <cxxabi.h> + #include <dlfcn.h> + #include <execinfo.h> +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/mesa/src/src/glsl/strtod.c qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/mesa/src/src/glsl/strtod.c +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/mesa/src/src/glsl/strtod.c 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/mesa/src/src/glsl/strtod.c 2019-01-03 16:51:04.446336966 +0000 +@@ -45,7 +45,7 @@ + glsl_strtod(const char *s, char **end) + { + #if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \ +- !defined(__HAIKU__) && !defined(__UCLIBC__) && !defined(ANDROID) ++ !defined(__HAIKU__) && defined(__GLIBC__) && !defined(ANDROID) + static locale_t loc = NULL; + if (!loc) { + loc = newlocale(LC_CTYPE_MASK, "C", NULL); +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/mesa/src/src/mesa/drivers/dri/common/xmlconfig.c qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/mesa/src/src/mesa/drivers/dri/common/xmlconfig.c +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/mesa/src/src/mesa/drivers/dri/common/xmlconfig.c 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/mesa/src/src/mesa/drivers/dri/common/xmlconfig.c 2019-01-03 16:52:43.126139986 +0000 +@@ -41,7 +41,7 @@ + + #undef GET_PROGRAM_NAME + +-#if (defined(__GNU_LIBRARY__) || defined(__GLIBC__)) && !defined(__UCLIBC__) ++#if (defined(__GNU_LIBRARY__) || defined(__GLIBC__)) + # if !defined(__GLIBC__) || (__GLIBC__ < 2) + /* These aren't declared in any libc5 header */ + extern char *program_invocation_name, *program_invocation_short_name; +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/mesa/src/src/mesa/main/imports.c qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/mesa/src/src/mesa/main/imports.c +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/mesa/src/src/mesa/main/imports.c 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/mesa/src/src/mesa/main/imports.c 2019-01-03 16:52:34.009788651 +0000 +@@ -542,7 +542,7 @@ + _mesa_strtof( const char *s, char **end ) + { + #if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \ +- !defined(ANDROID) && !defined(__HAIKU__) && !defined(__UCLIBC__) ++ !defined(ANDROID) && !defined(__HAIKU__) && defined(__GLIBC__) + static locale_t loc = NULL; + if (!loc) { + loc = newlocale(LC_CTYPE_MASK, "C", NULL); +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/pdfium/third_party/build/build_config.h qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/pdfium/third_party/build/build_config.h +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/pdfium/third_party/build/build_config.h 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/pdfium/third_party/build/build_config.h 2019-01-03 16:51:13.710694002 +0000 +@@ -43,7 +43,7 @@ + #define OS_LINUX 1 + // include a system header to pull in features.h for glibc/uclibc macros. + #include <unistd.h> +-#if defined(__GLIBC__) && !defined(__UCLIBC__) ++#if defined(__GLIBC__) + // we really are using glibc, not uClibc pretending to be glibc + #define LIBC_GLIBC 1 + #endif +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/skia/src/ports/SkOSFile_stdio.cpp qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/skia/src/ports/SkOSFile_stdio.cpp +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/skia/src/ports/SkOSFile_stdio.cpp 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/skia/src/ports/SkOSFile_stdio.cpp 2019-01-03 16:50:46.693652796 +0000 +@@ -88,7 +88,7 @@ + } + + void sk_fsync(FILE* f) { +-#if !defined(_WIN32) && !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__) \ ++#if !defined(_WIN32) && !defined(SK_BUILD_FOR_ANDROID) && defined(__GLIBC__) \ + && !defined(_NEWLIB_VERSION) + int fd = fileno(f); + fsync(fd); +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/sqlite/amalgamation/config.h qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/sqlite/amalgamation/config.h +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/sqlite/amalgamation/config.h 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/sqlite/amalgamation/config.h 2019-01-03 16:53:47.012602106 +0000 +@@ -33,7 +33,7 @@ + * malloc_usable_size() is not exported by the Android NDK. It is not + * implemented by uclibc. + */ +-#if defined(__linux__) && !defined(__UCLIBC__) ++#if defined(__linux__) && defined(__GLIBC__) + #define HAVE_MALLOC_H 1 + #define HAVE_MALLOC_USABLE_SIZE 1 + #endif +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/webrtc/rtc_base/checks.cc qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/webrtc/rtc_base/checks.cc +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/webrtc/rtc_base/checks.cc 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/webrtc/rtc_base/checks.cc 2019-01-03 16:53:17.723473331 +0000 +@@ -16,7 +16,7 @@ + #include <cstdio> + #include <cstdlib> + +-#if defined(__GLIBCXX__) && !defined(__UCLIBC__) ++#if defined(__GLIBCXX__) && defined(__GLIBC__) + #include <cxxabi.h> + #include <execinfo.h> + #endif +@@ -73,7 +73,7 @@ + // to get usable symbols on Linux. This is copied from V8. Chromium has a more + // advanced stace trace system; also more difficult to copy. + void DumpBacktrace() { +-#if defined(__GLIBCXX__) && !defined(__UCLIBC__) ++#if defined(__GLIBCXX__) && defined(__GLIBC__) + void* trace[100]; + int size = backtrace(trace, sizeof(trace) / sizeof(*trace)); + char** symbols = backtrace_symbols(trace, size); diff --git a/dev-qt/qtwebengine/files/musl/qt-musl-fpstate.patch b/dev-qt/qtwebengine/files/musl/qt-musl-fpstate.patch new file mode 100644 index 00000000..42fe1579 --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/qt-musl-fpstate.patch @@ -0,0 +1,48 @@ +diff --git a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc +index 052ce37..95b0fb4 100644 +--- a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc ++++ b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc +@@ -49,7 +49,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { + } + + void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, +- const struct _libc_fpstate* fp) { ++ const struct _fpstate* fp) { + const greg_t* regs = uc->uc_mcontext.gregs; + + out->context_flags = MD_CONTEXT_X86_FULL | +@@ -97,7 +97,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { + } + + void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, +- const struct _libc_fpstate* fpregs) { ++ const struct _fpstate* fpregs) { + const greg_t* regs = uc->uc_mcontext.gregs; + + out->context_flags = MD_CONTEXT_AMD64_FULL; +diff --git a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h +index f830618..f3dde1f 100644 +--- a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h ++++ b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h +@@ -50,7 +50,7 @@ struct UContextReader { + // info: the collection of register structures. + #if defined(__i386__) || defined(__x86_64) + static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc, +- const struct _libc_fpstate* fp); ++ const struct _fpstate* fp); + #elif defined(__aarch64__) + static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc, + const struct fpsimd_context* fpregs); +diff --git a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h +index d1dc331..d1cc562 100644 +--- a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h ++++ b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h +@@ -48,7 +48,7 @@ class ExceptionHandler; + #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 diff --git a/dev-qt/qtwebengine/files/musl/qt-musl-mallinfo.patch b/dev-qt/qtwebengine/files/musl/qt-musl-mallinfo.patch new file mode 100644 index 00000000..545b7bfd --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/qt-musl-mallinfo.patch @@ -0,0 +1,42 @@ +--- qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc 2017-11-28 14:06:53.000000000 +0100 ++++ qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc 2018-01-27 20:13:26.960932805 +0100 +@@ -243,7 +243,7 @@ + allocated_objects_count = main_heap_info.block_count; + #elif defined(OS_FUCHSIA) + // TODO(fuchsia): Port, see https://crbug.com/706592. +-#else ++#elif defined(__GLIBC__) + struct mallinfo info = mallinfo(); + DCHECK_GE(info.arena + info.hblkhd, info.uordblks); + +@@ -255,6 +255,8 @@ + + // Total allocated space is given by |uordblks|. + allocated_objects_size = info.uordblks; ++#else ++// musl libc does not support mallinfo() + #endif + + MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc"); +--- qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc 2017-11-28 14:06:53.000000000 +0100 ++++ qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc 2018-01-27 20:48:11.571040348 +0100 +@@ -94,7 +94,7 @@ + malloc_statistics_t stats = {0}; + malloc_zone_statistics(nullptr, &stats); + return stats.size_in_use; +-#elif defined(OS_LINUX) || defined(OS_ANDROID) ++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID) + struct mallinfo minfo = mallinfo(); + #if defined(USE_TCMALLOC) + return minfo.uordblks; +--- qtwebengine/src/3rdparty/chromium/content/child/content_child_helpers.cc 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine/src/3rdparty/chromium/content/child/content_child_helpers.cc 2019-01-05 00:34:23.346513661 +0000 +@@ -25,7 +25,7 @@ + // though, this provides only a partial and misleading value. + // Unfortunately some telemetry benchmark rely on it and these need to + // be refactored before getting rid of this. See crbug.com/581365 . +-#if defined(OS_LINUX) || defined(OS_ANDROID) ++#if defined(__GLIBC__) && ( defined(OS_LINUX) || defined(OS_ANDROID) ) + size_t GetMemoryUsageKB() { + struct mallinfo minfo = mallinfo(); + uint64_t mem_usage = diff --git a/dev-qt/qtwebengine/files/musl/qt-musl-off_t.patch b/dev-qt/qtwebengine/files/musl/qt-musl-off_t.patch new file mode 100644 index 00000000..52db3b9e --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/qt-musl-off_t.patch @@ -0,0 +1,10 @@ +--- qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h 2016-05-26 14:58:54.000000000 +0200 ++++ qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h 2016-10-01 14:31:30.885000000 +0200 +@@ -21,6 +21,7 @@ + #define htons(x) _byteswap_ushort (x) + #else + #include <arpa/inet.h> ++#include <sys/types.h> + #include <stdint.h> + #endif + diff --git a/dev-qt/qtwebengine/files/musl/qt-musl-pread-pwrite.patch b/dev-qt/qtwebengine/files/musl/qt-musl-pread-pwrite.patch new file mode 100644 index 00000000..c5dcfd81 --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/qt-musl-pread-pwrite.patch @@ -0,0 +1,20 @@ +diff --git a/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h b/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h +index 5d9c2e8..e81e7b4 100644 +--- a/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h ++++ b/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h +@@ -1794,6 +1794,15 @@ struct kernel_statfs { + /* End of s390/s390x definitions */ + #endif + ++#ifndef __GLIBC__ ++ /* For Musl libc pread/pread is the same as pread64/pwrite64 */ ++#ifndef __NR_pread ++#define __NR_pread __NR_pread64 ++#endif ++#ifndef __NR_pwrite ++#define __NR_pwrite __NR_pwrite64 ++#endif ++#endif /* ifndef __GLIBC__ */ + + /* After forking, we must make sure to only call system calls. */ + #if defined(__BOUNDED_POINTERS__) diff --git a/dev-qt/qtwebengine/files/musl/qt-musl-pvalloc.patch b/dev-qt/qtwebengine/files/musl/qt-musl-pvalloc.patch new file mode 100644 index 00000000..d5caf383 --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/qt-musl-pvalloc.patch @@ -0,0 +1,14 @@ +--- qtwebengine/src/core/api/qtbug-61521.cpp 2017-11-29 09:42:29.000000000 +0100 ++++ qtwebengine/src/core/api/qtbug-61521.cpp 2018-01-28 06:49:29.454175725 +0100 +@@ -111,7 +111,11 @@ + } + + SHIM_HIDDEN void* ShimPvalloc(size_t size) { ++#if defined(__GLIBC__) + return pvalloc(size); ++#else ++ return valloc((size+4095)&~4095); ++#endif + } + + SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) { diff --git a/dev-qt/qtwebengine/files/musl/qt-musl-remove-cdefs.patch b/dev-qt/qtwebengine/files/musl/qt-musl-remove-cdefs.patch new file mode 100644 index 00000000..2c02dae0 --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/qt-musl-remove-cdefs.patch @@ -0,0 +1,12 @@ +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/base/allocator/allocator_shim_internals.h qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/base/allocator/allocator_shim_internals.h +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/base/allocator/allocator_shim_internals.h 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/base/allocator/allocator_shim_internals.h 2019-01-05 00:17:19.461697601 +0000 +@@ -7,7 +7,7 @@ + + #if defined(__GNUC__) + +-#include <sys/cdefs.h> // for __THROW ++//#include <sys/cdefs.h> // for __THROW + + #ifndef __THROW // Not a glibc system + #ifdef _NOEXCEPT // LLVM libc++ uses noexcept instead diff --git a/dev-qt/qtwebengine/files/musl/qt-musl-resolve.patch b/dev-qt/qtwebengine/files/musl/qt-musl-resolve.patch new file mode 100644 index 00000000..a481e50d --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/qt-musl-resolve.patch @@ -0,0 +1,61 @@ +--- qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc 2016-11-07 15:46:18.000000000 +0100 ++++ qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc 2016-12-20 03:33:11.749059656 +0100 +@@ -9,6 +9,10 @@ + + #include <resolv.h> + ++#if !defined(__GLIBC__) ++#include "resolv_compat.h" ++#endif ++ + #include "base/lazy_instance.h" + #include "base/logging.h" + #include "base/macros.h" +--- qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc 2016-11-07 15:46:18.000000000 +0100 ++++ qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc 2016-12-20 03:40:07.671953098 +0100 +@@ -6,6 +6,10 @@ + + #include <string> + ++#if !defined(__GLIBC__) ++#include "resolv_compat.h" ++#endif ++ + #include "base/bind.h" + #include "base/files/file.h" + #include "base/files/file_path.h" +diff --git a/src/3rdparty/chromium/net/dns/resolv_compat.h b/src/3rdparty/chromium/net/dns/resolv_compat.h +new file mode 100644 +index 0000000..4f0e852 +--- /dev/null ++++ b/src/3rdparty/chromium/net/dns/resolv_compat.h +@@ -0,0 +1,29 @@ ++#if !defined(__GLIBC__) ++/*************************************************************************** ++ * resolv_compat.h ++ * ++ * Mimick GLIBC's res_ninit() and res_nclose() for musl libc ++ * Note: res_init() is actually deprecated according to ++ * http://docs.oracle.com/cd/E36784_01/html/E36875/res-nclose-3resolv.html ++ **************************************************************************/ ++#include <string.h> ++ ++static inline int res_ninit(res_state statp) ++{ ++ int rc = res_init(); ++ if (statp != &_res) { ++ memcpy(statp, &_res, sizeof(*statp)); ++ } ++ return rc; ++} ++ ++static inline int res_nclose(res_state statp) ++{ ++ if (!statp) ++ return -1; ++ if (statp != &_res) { ++ memset(statp, 0, sizeof(*statp)); ++ } ++ return 0; ++} ++#endif diff --git a/dev-qt/qtwebengine/files/musl/qt-musl-serialio.patch b/dev-qt/qtwebengine/files/musl/qt-musl-serialio.patch new file mode 100644 index 00000000..cf0e0fa7 --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/qt-musl-serialio.patch @@ -0,0 +1,12 @@ +--- qtwebengine/src/3rdparty/chromium/device/serial/serial_io_handler_posix.cc 2017-01-03 10:28:53.000000000 +0100 ++++ qtwebengine/src/3rdparty/chromium/device/serial/serial_io_handler_posix.cc 2017-02-23 21:20:42.650669563 +0100 +@@ -12,6 +12,9 @@ + + #if defined(OS_LINUX) + #include <linux/serial.h> ++#if !defined(__GLIBC__) ++#include <asm-generic/ioctls.h> ++#endif + + // The definition of struct termios2 is copied from asm-generic/termbits.h + // because including that header directly conflicts with termios.h. diff --git a/dev-qt/qtwebengine/files/musl/qt-musl-siginfo_t.patch b/dev-qt/qtwebengine/files/musl/qt-musl-siginfo_t.patch new file mode 100644 index 00000000..fe760be1 --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/qt-musl-siginfo_t.patch @@ -0,0 +1,18 @@ +There's a subtle difference in the internal name of siginfo_t fields +between glibc and musl. The structure itself is equivalent, so it +should suffice to add a macro to rename the field. + +--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc 2015-02-17 05:57:43.000000000 +0100 ++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc 2015-06-03 08:20:25.032716427 +0200 +@@ -22,6 +22,11 @@ + #include "sandbox/linux/services/android_ucontext.h" + #endif + ++// musl libc defines siginfo_t __si_fields instead of _sifields ++#if !defined(__GLIBC__) ++#define _sifields __si_fields ++#endif ++ + namespace { + + const int kCapacityIncrement = 20; diff --git a/dev-qt/qtwebengine/files/musl/qt-musl-stackstart.patch b/dev-qt/qtwebengine/files/musl/qt-musl-stackstart.patch new file mode 100644 index 00000000..5002cfd4 --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/qt-musl-stackstart.patch @@ -0,0 +1,21 @@ +diff -Naur qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/WebKit/Source/platform/wtf/StackUtil.cpp qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/WebKit/Source/platform/wtf/StackUtil.cpp +--- qtwebengine-everywhere-src-5.11.3.orig/src/3rdparty/chromium/third_party/WebKit/Source/platform/wtf/StackUtil.cpp 2018-11-19 18:55:45.000000000 +0000 ++++ qtwebengine-everywhere-src-5.11.3/src/3rdparty/chromium/third_party/WebKit/Source/platform/wtf/StackUtil.cpp 2019-01-05 00:28:12.437391690 +0000 +@@ -28,7 +28,7 @@ + // FIXME: On Mac OSX and Linux, this method cannot estimate stack size + // correctly for the main thread. + +-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \ ++#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 webkit_unit_tests). +@@ -96,7 +96,7 @@ + } + + 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; diff --git a/dev-qt/qtwebengine/files/musl/qt-musl-sysreg-for__WORDSIZE.patch b/dev-qt/qtwebengine/files/musl/qt-musl-sysreg-for__WORDSIZE.patch new file mode 100644 index 00000000..a8b74e40 --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/qt-musl-sysreg-for__WORDSIZE.patch @@ -0,0 +1,14 @@ +diff --git a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h +index d03c7a8..d43fda0 100644 +--- a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h ++++ b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h +@@ -36,6 +36,9 @@ + #include <elf.h> + #include <link.h> + #include <stddef.h> ++#ifndef __GLIBC__ ++#include <sys/reg.h> ++#endif + + #include "common/memory_range.h" + diff --git a/dev-qt/qtwebengine/files/musl/qt-musl-thread-stacksize.patch b/dev-qt/qtwebengine/files/musl/qt-musl-thread-stacksize.patch new file mode 100644 index 00000000..a5c59fe7 --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/qt-musl-thread-stacksize.patch @@ -0,0 +1,26 @@ +diff --git a/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc b/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc +index 02bf49b..05ee182 100644 +--- a/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc ++++ b/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc +@@ -13,7 +13,7 @@ namespace pp { + namespace { + + // Use 2MB default stack size for Native Client, otherwise use system default. +-#if defined(__native_client__) ++#if defined(__native_client__) || !defined(__GLIBC__) + const size_t kDefaultStackSize = 2 * 1024 * 1024; + #else + const size_t kDefaultStackSize = 0; +diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc +index cf7f3ec..e06a5ce 100644 +--- a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc ++++ b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc +@@ -761,7 +761,7 @@ void Thread::Start() { + #if V8_OS_MACOSX + // Default on Mac OS X is 512kB -- bump up to 1MB + stack_size = 1 * 1024 * 1024; +-#elif V8_OS_AIX ++#elif V8_OS_AIX || !defined(__GLIBC__) + // Default on AIX is 96kB -- bump up to 2MB + stack_size = 2 * 1024 * 1024; + #endif diff --git a/dev-qt/qtwebengine/files/musl/yasm-nls.patch b/dev-qt/qtwebengine/files/musl/yasm-nls.patch new file mode 100644 index 00000000..6b412abd --- /dev/null +++ b/dev-qt/qtwebengine/files/musl/yasm-nls.patch @@ -0,0 +1,13 @@ +diff --git a/src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h b/src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h +index 9e36539..f588083 100644 +--- a/src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h ++++ b/src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h +@@ -5,7 +5,7 @@ + #define CPP_PROG "gcc -E" + + /* */ +-#define ENABLE_NLS 1 ++/* #undef ENABLE_NLS 1 */ + + /* Define to 1 if you have the `abort' function. */ + #define HAVE_ABORT 1 diff --git a/dev-qt/qtwebengine/files/qtwebengine-5.11.1-nouveau-disable-gpu.patch b/dev-qt/qtwebengine/files/qtwebengine-5.11.1-nouveau-disable-gpu.patch new file mode 100644 index 00000000..aaf3aae4 --- /dev/null +++ b/dev-qt/qtwebengine/files/qtwebengine-5.11.1-nouveau-disable-gpu.patch @@ -0,0 +1,98 @@ +From: Antonio Larrosa <alarrosa@suse.com> +Subject: Disable GPU when using nouveau or running on wayland +References: boo#1005323, boo#1060990 + +Qt WebEngine uses multi-threaded OpenGL, which nouveau does not support. +It also crashes when running on wayland, the cause is not yet known. +Work around these issues by not doing GPU-accelerated rendering in such +cases. + +Index: qtwebengine-everywhere-src-5.11.0/src/core/web_engine_context.cpp +=================================================================== +--- qtwebengine-everywhere-src-5.11.0.orig/src/core/web_engine_context.cpp ++++ qtwebengine-everywhere-src-5.11.0/src/core/web_engine_context.cpp +@@ -100,6 +100,7 @@ + #include <QOffscreenSurface> + #ifndef QT_NO_OPENGL + # include <QOpenGLContext> ++# include <QOpenGLFunctions> + #endif + #include <QQuickWindow> + #include <QStringList> +@@ -178,6 +179,39 @@ void dummyGetPluginCallback(const std::v + } + #endif + ++#ifndef QT_NO_OPENGL ++QString openGLVendor() ++{ ++ QString vendor; ++ ++ QOpenGLContext *oldContext = QOpenGLContext::currentContext(); ++ QSurface *oldSurface = 0; ++ if (oldContext) ++ oldSurface = oldContext->surface(); ++ ++ QScopedPointer<QOffscreenSurface> surface( new QOffscreenSurface ); ++ surface->create(); ++ QOpenGLContext context; ++ if (!context.create()) { ++ qDebug() << "Error creating openGL context"; ++ } ++ else if (!context.makeCurrent(surface.data())) { ++ qDebug() << "Error making openGL context current context"; ++ } else { ++ const GLubyte *p; ++ QOpenGLFunctions *f = context.functions(); ++ if ((p = f->glGetString(GL_VENDOR))) ++ vendor = QString::fromLatin1(reinterpret_cast<const char *>(p)); ++ } ++ ++ context.doneCurrent(); ++ if (oldContext && oldSurface) ++ oldContext->makeCurrent(oldSurface); ++ ++ return vendor; ++} ++#endif ++ + } // namespace + + namespace QtWebEngineCore { +@@ -414,6 +448,27 @@ WebEngineContext::WebEngineContext() + const char *glType = 0; + #ifndef QT_NO_OPENGL + ++ bool disableGpu = qEnvironmentVariableIsSet("QT_WEBENGINE_DISABLE_GPU"); ++ ++ if (!qEnvironmentVariableIsSet("QT_WEBENGINE_DISABLE_WAYLAND_WORKAROUND") && platform.startsWith("wayland", Qt::CaseInsensitive)) ++ { ++ qWarning() << "Running on wayland. Qt WebEngine will disable usage of the GPU.\n" ++ "Note: you can set the QT_WEBENGINE_DISABLE_WAYLAND_WORKAROUND\n" ++ "environment variable before running this application, but this is \n" ++ "not recommended since this usually causes applications to crash."; ++ disableGpu = true; ++ } ++ ++ if (!qEnvironmentVariableIsSet("QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND") && openGLVendor() == QStringLiteral("nouveau")) ++ { ++ qWarning() << "Nouveau openGL driver detected. Qt WebEngine will disable usage of the GPU.\n" ++ "Note: you can set the QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND\n" ++ "environment variable before running this application, but this is \n" ++ "not recommended since this usually causes applications to crash as\n" ++ "Nouveau openGL drivers don't support multithreaded rendering"; ++ disableGpu = true; ++ } ++ + bool tryGL = + !usingANGLE() + && (!usingSoftwareDynamicGL() +@@ -424,7 +479,7 @@ WebEngineContext::WebEngineContext() + || enableWebGLSoftwareRendering + #endif + ) +- && !usingQtQuick2DRenderer(); ++ && !usingQtQuick2DRenderer() && !disableGpu; + + if (tryGL) { + if (qt_gl_global_share_context() && qt_gl_global_share_context()->isValid()) { diff --git a/dev-qt/qtwebengine/files/qtwebengine-5.11.2-paxmark-mksnapshot.patch b/dev-qt/qtwebengine/files/qtwebengine-5.11.2-paxmark-mksnapshot.patch new file mode 100644 index 00000000..f7a5c064 --- /dev/null +++ b/dev-qt/qtwebengine/files/qtwebengine-5.11.2-paxmark-mksnapshot.patch @@ -0,0 +1,41 @@ +Bug: https://bugs.gentoo.org/634220 + +--- a/src/3rdparty/chromium/v8/BUILD.gn ++++ b/src/3rdparty/chromium/v8/BUILD.gn +@@ -803,6 +803,7 @@ + + deps = [ + ":mksnapshot($v8_snapshot_toolchain)", ++ ":run_paxmark", + ] + + script = "tools/run.py" +@@ -854,6 +855,28 @@ + } + } + } ++action("run_paxmark") { ++ visibility = [ ":*" ] # Only targets in this file can depend on this. ++ ++ deps = [ ++ ":mksnapshot($v8_snapshot_toolchain)", ++ ] ++ ++ script = "/usr/sbin/pypaxctl" ++ ++ sources = [] ++ ++ outputs = [ ++ "$target_out_dir/mksnapshot", ++ ] ++ ++ args = [ ++ "-sm", ++ "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)", ++ "root_out_dir") + "/mksnapshot", ++ root_build_dir), ++ ] ++} + + action("v8_dump_build_config") { + script = "tools/testrunner/utils/dump_build_config.py" diff --git a/dev-qt/qtwebengine/files/qtwebengine-5.9.6-gcc8.patch b/dev-qt/qtwebengine/files/qtwebengine-5.9.6-gcc8.patch new file mode 100644 index 00000000..ba6a49fd --- /dev/null +++ b/dev-qt/qtwebengine/files/qtwebengine-5.9.6-gcc8.patch @@ -0,0 +1,24 @@ +From: Fedora +Subject: Fix build for 32-bit platforms + +Apparently not upstream, can't find this anywhere. So I assume Fedora is the actual source? +https://src.fedoraproject.org/cgit/rpms/chromium.git/tree/chromium-66.0.3359.170-gcc8-alignof.patch + +diff -up chromium-66.0.3359.170/src/3rdparty/chromium/mojo/public/c/system/macros.h.gcc8-alignof chromium-66.0.3359.170/src/3rdparty/chromium/mojo/public/c/system/macros.h +--- a/src/3rdparty/chromium/mojo/public/c/system/macros.h 2018-05-15 14:58:46.448912634 -0400 ++++ b/src/3rdparty/chromium/mojo/public/c/system/macros.h 2018-05-15 14:58:52.041784613 -0400 +@@ -18,7 +18,13 @@ + #endif + + // Like the C++11 |alignof| operator. +-#if __cplusplus >= 201103L ++#if defined(__GNUC__) && __GNUC__ >= 8 ++// GCC 8 has changed the alignof operator to return the minimal alignment ++// required by the target ABI, instead of the preferred alignment. ++// This means that on 32-bit x86, it will return 4 instead of 8. ++// Use __alignof__ instead to avoid this. ++#define MOJO_ALIGNOF(type) __alignof__(type) ++#elif __cplusplus >= 201103L + #define MOJO_ALIGNOF(type) alignof(type) + #elif defined(__GNUC__) + #define MOJO_ALIGNOF(type) __alignof__(type) |