summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtwebengine
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-07-13 00:41:52 -0700
committerMartin Jansa <Martin.Jansa@gmail.com>2017-07-14 23:56:51 +0200
commitd69be5de8c15bfe015c8a6ffb15eee3afb43b841 (patch)
tree225ef848492aa1aa1817d7702215ff413076abb1 /recipes-qt/qt5/qtwebengine
parent92c634e9d584ebbf508b5ca4fea6d61d38373513 (diff)
downloadmeta-qt5-d69be5de8c15bfe015c8a6ffb15eee3afb43b841.tar.gz
qtwebengine: Fix build on musl
import needed chromium patches from meta-browser Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'recipes-qt/qt5/qtwebengine')
-rw-r--r--recipes-qt/qt5/qtwebengine/0001-sandbox-Define-TEMP_FAILURE_RETRY-if-not-defined.patch35
-rw-r--r--recipes-qt/qt5/qtwebengine/0003-Avoid-mallinfo-APIs-on-non-glibc-linux.patch48
-rw-r--r--recipes-qt/qt5/qtwebengine/0004-include-fcntl.h-for-loff_t.patch25
-rw-r--r--recipes-qt/qt5/qtwebengine/0005-use-off64_t-instead-of-the-internal-__off64_t.patch65
-rw-r--r--recipes-qt/qt5/qtwebengine/0006-linux-glibc-make-the-distinction.patch26
-rw-r--r--recipes-qt/qt5/qtwebengine/0007-allocator-Do-not-include-glibc_weak_symbols-for-musl.patch26
-rw-r--r--recipes-qt/qt5/qtwebengine/0008-Use-correct-member-name-__si_fields-from-LinuxSigInf.patch26
-rw-r--r--recipes-qt/qt5/qtwebengine/0009-Match-syscalls-to-match-musl.patch47
-rw-r--r--recipes-qt/qt5/qtwebengine/0010-Define-res_ninit-and-res_nclose-for-non-glibc-platfo.patch81
-rw-r--r--recipes-qt/qt5/qtwebengine/0011-Do-not-define-__sbrk-on-musl.patch29
-rw-r--r--recipes-qt/qt5/qtwebengine/0012-Adjust-default-pthread-stack-size.patch51
-rw-r--r--recipes-qt/qt5/qtwebengine/0013-include-asm-generic-ioctl.h-for-TCGETS2.patch25
-rw-r--r--recipes-qt/qt5/qtwebengine/0014-link-with-libexecinfo-on-musl.patch25
-rw-r--r--recipes-qt/qt5/qtwebengine/0018-tcmalloc-Use-off64_t-insread-of-__off64_t.patch26
14 files changed, 535 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtwebengine/0001-sandbox-Define-TEMP_FAILURE_RETRY-if-not-defined.patch b/recipes-qt/qt5/qtwebengine/0001-sandbox-Define-TEMP_FAILURE_RETRY-if-not-defined.patch
new file mode 100644
index 00000000..c56cfc7b
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/0001-sandbox-Define-TEMP_FAILURE_RETRY-if-not-defined.patch
@@ -0,0 +1,35 @@
1From 89d6283c91f2229cc51f473eed344de97d09e946 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 7 Jul 2017 14:01:12 -0700
4Subject: [PATCH 01/12] sandbox: Define TEMP_FAILURE_RETRY if not defined
5
6Musl does not define this Macro
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 sandbox/linux/suid/sandbox.c | 9 +++++++++
11 1 file changed, 9 insertions(+)
12
13diff --git a/sandbox/linux/suid/sandbox.c b/sandbox/linux/suid/sandbox.c
14index b655d1c79..3de34e36f 100644
15--- a/sandbox/linux/suid/sandbox.c
16+++ b/sandbox/linux/suid/sandbox.c
17@@ -44,6 +44,15 @@ static bool DropRoot();
18
19 #define HANDLE_EINTR(x) TEMP_FAILURE_RETRY(x)
20
21+#ifndef TEMP_FAILURE_RETRY
22+# define TEMP_FAILURE_RETRY(expression) \
23+ (__extension__ \
24+ ({ long int __result; \
25+ do __result = (long int) (expression); \
26+ while (__result == -1L && errno == EINTR); \
27+ __result; }))
28+#endif
29+
30 static void FatalError(const char* msg, ...)
31 __attribute__((noreturn, format(printf, 1, 2)));
32
33--
342.13.2
35
diff --git a/recipes-qt/qt5/qtwebengine/0003-Avoid-mallinfo-APIs-on-non-glibc-linux.patch b/recipes-qt/qt5/qtwebengine/0003-Avoid-mallinfo-APIs-on-non-glibc-linux.patch
new file mode 100644
index 00000000..2e0b1f00
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/0003-Avoid-mallinfo-APIs-on-non-glibc-linux.patch
@@ -0,0 +1,48 @@
1From 8defe37306b0d1548592afc12baa45f4aec5375c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 7 Jul 2017 14:09:06 -0700
4Subject: [PATCH 03/12] Avoid mallinfo() APIs on non-glibc/linux
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 base/trace_event/malloc_dump_provider.cc | 3 ++-
9 content/child/content_child_helpers.cc | 2 +-
10 2 files changed, 3 insertions(+), 2 deletions(-)
11
12diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc
13index 3b1a933bc..a554d0373 100644
14--- a/base/trace_event/malloc_dump_provider.cc
15+++ b/base/trace_event/malloc_dump_provider.cc
16@@ -103,6 +103,7 @@ MallocDumpProvider::~MallocDumpProvider() {}
17 // the current process.
18 bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
19 ProcessMemoryDump* pmd) {
20+#if defined(__GLIBC__)
21 size_t total_virtual_size = 0;
22 size_t resident_size = 0;
23 size_t allocated_objects_size = 0;
24@@ -195,7 +196,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
25 pmd->DumpHeapUsage(metrics_by_context, overhead, "malloc");
26 }
27 tid_dumping_heap_ = kInvalidThreadId;
28-
29+#endif // __GLIBC__
30 return true;
31 }
32
33diff --git a/content/child/content_child_helpers.cc b/content/child/content_child_helpers.cc
34index 7ddeb4d16..b8c73b09c 100644
35--- a/content/child/content_child_helpers.cc
36+++ b/content/child/content_child_helpers.cc
37@@ -25,7 +25,7 @@ namespace content {
38 // though, this provides only a partial and misleading value.
39 // Unfortunately some telemetry benchmark rely on it and these need to
40 // be refactored before getting rid of this. See crbug.com/581365 .
41-#if defined(OS_LINUX) || defined(OS_ANDROID)
42+#if defined(__GLIBC__) || defined(OS_ANDROID)
43 size_t GetMemoryUsageKB() {
44 struct mallinfo minfo = mallinfo();
45 uint64_t mem_usage =
46--
472.13.2
48
diff --git a/recipes-qt/qt5/qtwebengine/0004-include-fcntl.h-for-loff_t.patch b/recipes-qt/qt5/qtwebengine/0004-include-fcntl.h-for-loff_t.patch
new file mode 100644
index 00000000..da8503bf
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/0004-include-fcntl.h-for-loff_t.patch
@@ -0,0 +1,25 @@
1From a0b40dcdfb3331d2b8351bdfb27f1ba3e8a2c33c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 7 Jul 2017 14:37:49 -0700
4Subject: [PATCH 04/12] include fcntl.h for loff_t
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 third_party/tcmalloc/chromium/src/base/linux_syscall_support.h | 1 +
9 1 file changed, 1 insertion(+)
10
11diff --git a/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h b/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
12index bdbc4b7e3..b53dd46c5 100644
13--- a/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
14+++ b/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
15@@ -151,6 +151,7 @@ extern "C" {
16 #include <stddef.h>
17 #include <stdint.h>
18 #include <string.h>
19+#include <fcntl.h>
20 #include <sys/ptrace.h>
21 #include <sys/resource.h>
22 #include <sys/time.h>
23--
242.13.2
25
diff --git a/recipes-qt/qt5/qtwebengine/0005-use-off64_t-instead-of-the-internal-__off64_t.patch b/recipes-qt/qt5/qtwebengine/0005-use-off64_t-instead-of-the-internal-__off64_t.patch
new file mode 100644
index 00000000..d552a34e
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/0005-use-off64_t-instead-of-the-internal-__off64_t.patch
@@ -0,0 +1,65 @@
1From badea43b85346525b7c43c38c32d150b7eb85b13 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 7 Jul 2017 14:38:37 -0700
4Subject: [PATCH 05/12] use off64_t instead of the internal __off64_t
5
6- only do the glibc 32-bit ABI check for mmap/mmap64 on gnu libc. musl
7 does not support the 32-bit ABI.
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h | 10 +++++-----
12 1 file changed, 5 insertions(+), 5 deletions(-)
13
14diff --git a/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h b/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h
15index 715c045f6..edc8cf2db 100644
16--- a/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h
17+++ b/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h
18@@ -77,7 +77,7 @@ typedef off64_t __off64_t;
19
20 static inline void* do_mmap64(void *start, size_t length,
21 int prot, int flags,
22- int fd, __off64_t offset) __THROW {
23+ int fd, off64_t offset) __THROW {
24 // The original gperftools uses sys_mmap() here. But, it is not allowed by
25 // Chromium's sandbox.
26 return (void *)syscall(SYS_mmap, start, length, prot, flags, fd, offset);
27@@ -90,7 +90,7 @@ static inline void* do_mmap64(void *start, size_t length,
28
29 static inline void* do_mmap64(void *start, size_t length,
30 int prot, int flags,
31- int fd, __off64_t offset) __THROW {
32+ int fd, off64_t offset) __THROW {
33 void *result;
34
35 // Try mmap2() unless it's not supported
36@@ -161,7 +161,7 @@ static inline void* do_mmap64(void *start, size_t length,
37
38 extern "C" {
39 void* mmap64(void *start, size_t length, int prot, int flags,
40- int fd, __off64_t offset ) __THROW
41+ int fd, off64_t offset ) __THROW
42 ATTRIBUTE_SECTION(malloc_hook);
43 void* mmap(void *start, size_t length,int prot, int flags,
44 int fd, off_t offset) __THROW
45@@ -178,7 +178,7 @@ extern "C" {
46 }
47
48 extern "C" void* mmap64(void *start, size_t length, int prot, int flags,
49- int fd, __off64_t offset) __THROW {
50+ int fd, off64_t offset) __THROW {
51 MallocHook::InvokePreMmapHook(start, length, prot, flags, fd, offset);
52 void *result;
53 if (!MallocHook::InvokeMmapReplacement(
54@@ -189,7 +189,7 @@ extern "C" void* mmap64(void *start, size_t length, int prot, int flags,
55 return result;
56 }
57
58-# if !defined(__USE_FILE_OFFSET64) || !defined(__REDIRECT_NTH)
59+# if defined(__GLIBC__) && (!defined(__USE_FILE_OFFSET64) || !defined(__REDIRECT_NTH))
60
61 extern "C" void* mmap(void *start, size_t length, int prot, int flags,
62 int fd, off_t offset) __THROW {
63--
642.13.2
65
diff --git a/recipes-qt/qt5/qtwebengine/0006-linux-glibc-make-the-distinction.patch b/recipes-qt/qt5/qtwebengine/0006-linux-glibc-make-the-distinction.patch
new file mode 100644
index 00000000..257d873e
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/0006-linux-glibc-make-the-distinction.patch
@@ -0,0 +1,26 @@
1From 4913850cd644e1fd44ecade5e9faa460de35a7d6 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 7 Jul 2017 14:54:38 -0700
4Subject: [PATCH 06/12] linux != glibc, make the distinction
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 base/allocator/allocator_check.cc | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/base/allocator/allocator_check.cc b/base/allocator/allocator_check.cc
12index 5a0564d2f..8c2dc6491 100644
13--- a/base/allocator/allocator_check.cc
14+++ b/base/allocator/allocator_check.cc
15@@ -21,7 +21,7 @@ bool IsAllocatorInitialized() {
16 #if defined(OS_WIN) && defined(ALLOCATOR_SHIM)
17 // Set by allocator_shim_win.cc when the shimmed _set_new_mode() is called.
18 return g_is_win_shim_layer_initialized;
19-#elif defined(OS_LINUX) && defined(USE_TCMALLOC) && \
20+#elif defined(__GLIBC__) && defined(USE_TCMALLOC) && \
21 !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
22 // From third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h.
23 // TODO(primiano): replace with an include once base can depend on allocator.
24--
252.13.2
26
diff --git a/recipes-qt/qt5/qtwebengine/0007-allocator-Do-not-include-glibc_weak_symbols-for-musl.patch b/recipes-qt/qt5/qtwebengine/0007-allocator-Do-not-include-glibc_weak_symbols-for-musl.patch
new file mode 100644
index 00000000..b999c599
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/0007-allocator-Do-not-include-glibc_weak_symbols-for-musl.patch
@@ -0,0 +1,26 @@
1From 482e77e9562b8a158b5b212e9f1c83c697fed2e2 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 7 Jul 2017 15:09:02 -0700
4Subject: [PATCH 07/12] allocator: Do not include glibc_weak_symbols for musl
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 base/allocator/allocator_shim.cc | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/base/allocator/allocator_shim.cc b/base/allocator/allocator_shim.cc
12index 57a398aaa..54c79063a 100644
13--- a/base/allocator/allocator_shim.cc
14+++ b/base/allocator/allocator_shim.cc
15@@ -263,7 +263,7 @@ void ShimFree(void* address) {
16 // In the case of tcmalloc we also want to plumb into the glibc hooks
17 // to avoid that allocations made in glibc itself (e.g., strdup()) get
18 // accidentally performed on the glibc heap instead of the tcmalloc one.
19-#if defined(USE_TCMALLOC)
20+#if defined(USE_TCMALLOC) && defined(__GLIBC__)
21 #include "base/allocator/allocator_shim_override_glibc_weak_symbols.h"
22 #endif
23
24--
252.13.2
26
diff --git a/recipes-qt/qt5/qtwebengine/0008-Use-correct-member-name-__si_fields-from-LinuxSigInf.patch b/recipes-qt/qt5/qtwebengine/0008-Use-correct-member-name-__si_fields-from-LinuxSigInf.patch
new file mode 100644
index 00000000..3bd0a9d4
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/0008-Use-correct-member-name-__si_fields-from-LinuxSigInf.patch
@@ -0,0 +1,26 @@
1From 3d12eb821e105111cbd88f5598746bd77c3a9ef0 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 7 Jul 2017 15:12:39 -0700
4Subject: [PATCH 08/12] Use correct member name __si_fields from LinuxSigInfo
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 sandbox/linux/seccomp-bpf/trap.cc | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc
12index 003708d2c..0fef3148f 100644
13--- a/sandbox/linux/seccomp-bpf/trap.cc
14+++ b/sandbox/linux/seccomp-bpf/trap.cc
15@@ -168,7 +168,7 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
16 // most versions of glibc don't include this information in siginfo_t. So,
17 // we need to explicitly copy it into a arch_sigsys structure.
18 struct arch_sigsys sigsys;
19- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
20+ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys));
21
22 #if defined(__mips__)
23 // When indirect syscall (syscall(__NR_foo, ...)) is made on Mips, the
24--
252.13.2
26
diff --git a/recipes-qt/qt5/qtwebengine/0009-Match-syscalls-to-match-musl.patch b/recipes-qt/qt5/qtwebengine/0009-Match-syscalls-to-match-musl.patch
new file mode 100644
index 00000000..bfb6ebb6
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/0009-Match-syscalls-to-match-musl.patch
@@ -0,0 +1,47 @@
1From 5843df01580b0fb956ee4b7e1a60c0130c8c90f9 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 7 Jul 2017 15:24:49 -0700
4Subject: [PATCH 09/12] Match syscalls to match musl
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 third_party/lss/linux_syscall_support.h | 16 ++++++++++++++++
9 1 file changed, 16 insertions(+)
10
11diff --git a/third_party/lss/linux_syscall_support.h b/third_party/lss/linux_syscall_support.h
12index 9dbd2391b..a715de177 100644
13--- a/third_party/lss/linux_syscall_support.h
14+++ b/third_party/lss/linux_syscall_support.h
15@@ -793,6 +793,14 @@ struct kernel_statfs {
16 #endif
17
18
19+#undef stat64
20+#undef fstat64
21+
22+#ifndef __NR_fstatat
23+#define __NR_fstatat __NR_fstatat64
24+#endif
25+
26+
27 #if defined(__x86_64__)
28 #ifndef ARCH_SET_GS
29 #define ARCH_SET_GS 0x1001
30@@ -1210,6 +1218,14 @@ struct kernel_statfs {
31 #ifndef __NR_fallocate
32 #define __NR_fallocate 285
33 #endif
34+
35+#ifndef __NR_pread
36+#define __NR_pread __NR_pread64
37+#endif
38+#ifndef __NR_pwrite
39+#define __NR_pwrite __NR_pwrite64
40+#endif
41+
42 /* End of x86-64 definitions */
43 #elif defined(__mips__)
44 #if _MIPS_SIM == _MIPS_SIM_ABI32
45--
462.13.2
47
diff --git a/recipes-qt/qt5/qtwebengine/0010-Define-res_ninit-and-res_nclose-for-non-glibc-platfo.patch b/recipes-qt/qt5/qtwebengine/0010-Define-res_ninit-and-res_nclose-for-non-glibc-platfo.patch
new file mode 100644
index 00000000..1825ed7b
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/0010-Define-res_ninit-and-res_nclose-for-non-glibc-platfo.patch
@@ -0,0 +1,81 @@
1From df3fd62f7f0c51c11e7f715c2523418c31eb6b0f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 7 Jul 2017 15:27:50 -0700
4Subject: [PATCH 10/12] Define res_ninit and res_nclose for non-glibc platforms
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 net/dns/dns_config_service_posix.cc | 4 ++++
9 net/dns/dns_reloader.cc | 4 ++++
10 net/dns/resolv_compat.h | 29 +++++++++++++++++++++++++++++
11 3 files changed, 37 insertions(+)
12 create mode 100644 net/dns/resolv_compat.h
13
14diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
15index ba8a36913..e9b40d07f 100644
16--- a/net/dns/dns_config_service_posix.cc
17+++ b/net/dns/dns_config_service_posix.cc
18@@ -25,6 +25,10 @@
19 #include "net/dns/notify_watcher_mac.h"
20 #include "net/dns/serial_worker.h"
21
22+#if defined(OS_LINUX) && !defined(__GLIBC__)
23+#include "net/dns/resolv_compat.h"
24+#endif
25+
26 #if defined(OS_MACOSX) && !defined(OS_IOS)
27 #include "net/dns/dns_config_watcher_mac.h"
28 #endif
29diff --git a/net/dns/dns_reloader.cc b/net/dns/dns_reloader.cc
30index 74534e6b1..2780a776e 100644
31--- a/net/dns/dns_reloader.cc
32+++ b/net/dns/dns_reloader.cc
33@@ -9,6 +9,10 @@
34
35 #include <resolv.h>
36
37+#if defined(OS_LINUX) && !defined(__GLIBC__)
38+#include "net/dns/resolv_compat.h"
39+#endif
40+
41 #include "base/lazy_instance.h"
42 #include "base/logging.h"
43 #include "base/macros.h"
44diff --git a/net/dns/resolv_compat.h b/net/dns/resolv_compat.h
45new file mode 100644
46index 000000000..4f0e852a1
47--- /dev/null
48+++ b/net/dns/resolv_compat.h
49@@ -0,0 +1,29 @@
50+#if !defined(__GLIBC__)
51+/***************************************************************************
52+ * resolv_compat.h
53+ *
54+ * Mimick GLIBC's res_ninit() and res_nclose() for musl libc
55+ * Note: res_init() is actually deprecated according to
56+ * http://docs.oracle.com/cd/E36784_01/html/E36875/res-nclose-3resolv.html
57+ **************************************************************************/
58+#include <string.h>
59+
60+static inline int res_ninit(res_state statp)
61+{
62+ int rc = res_init();
63+ if (statp != &_res) {
64+ memcpy(statp, &_res, sizeof(*statp));
65+ }
66+ return rc;
67+}
68+
69+static inline int res_nclose(res_state statp)
70+{
71+ if (!statp)
72+ return -1;
73+ if (statp != &_res) {
74+ memset(statp, 0, sizeof(*statp));
75+ }
76+ return 0;
77+}
78+#endif
79--
802.13.2
81
diff --git a/recipes-qt/qt5/qtwebengine/0011-Do-not-define-__sbrk-on-musl.patch b/recipes-qt/qt5/qtwebengine/0011-Do-not-define-__sbrk-on-musl.patch
new file mode 100644
index 00000000..a2c2b901
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/0011-Do-not-define-__sbrk-on-musl.patch
@@ -0,0 +1,29 @@
1From 8a6553232988a5bfc8f0c48d4214a3982025fb2c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 7 Jul 2017 15:39:57 -0700
4Subject: [PATCH 11/12] Do not define __sbrk on musl
5
6musl libc does not have sbrk. on musl libc will only work when called with 0 as
7argument, so we just let it out for now
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h b/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h
15index edc8cf2db..a868b50d3 100644
16--- a/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h
17+++ b/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h
18@@ -233,7 +233,7 @@ extern "C" void* mremap(void* old_addr, size_t old_size, size_t new_size,
19 }
20
21 // Don't hook sbrk() in Android, since it doesn't expose __sbrk.
22-#if !defined(__ANDROID__)
23+#if !defined(__ANDROID__) && defined(__GLIBC__)
24 // libc's version:
25 extern "C" void* __sbrk(ptrdiff_t increment);
26
27--
282.13.2
29
diff --git a/recipes-qt/qt5/qtwebengine/0012-Adjust-default-pthread-stack-size.patch b/recipes-qt/qt5/qtwebengine/0012-Adjust-default-pthread-stack-size.patch
new file mode 100644
index 00000000..de2ec97d
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/0012-Adjust-default-pthread-stack-size.patch
@@ -0,0 +1,51 @@
1From 65d516f64c1cca91868cb26aeb93802382704fd5 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 7 Jul 2017 16:41:23 -0700
4Subject: [PATCH 1/2] Adjust default pthread stack size
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 base/threading/platform_thread_linux.cc | 3 ++-
9 chrome/browser/chrome_browser_main_posix.cc | 9 +++++++++
10 third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp | 4 ++--
11 3 files changed, 13 insertions(+), 3 deletions(-)
12
13diff --git a/base/threading/platform_thread_linux.cc b/base/threading/platform_thread_linux.cc
14index 95ed32418..666e85ba3 100644
15--- a/base/threading/platform_thread_linux.cc
16+++ b/base/threading/platform_thread_linux.cc
17@@ -96,7 +96,8 @@ void TerminateOnThread() {}
18
19 size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
20 #if !defined(THREAD_SANITIZER)
21- return 0;
22+ // use 8mb like glibc to avoid running out of space
23+ return (1 << 23);
24 #else
25 // ThreadSanitizer bloats the stack heavily. Evidence has been that the
26 // default stack size isn't enough for some browser tests.
27diff --git a/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp b/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
28index 3c0a0395b..2af6073e2 100644
29--- a/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
30+++ b/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
31@@ -73,7 +73,7 @@ size_t StackFrameDepth::getUnderestimatedStackSize()
32 // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
33 // correctly for the main thread.
34
35-#if defined(__GLIBC__) || OS(ANDROID) || OS(FREEBSD)
36+#if OS(LINUX) || OS(ANDROID) || OS(FREEBSD)
37 // pthread_getattr_np() can fail if the thread is not invoked by
38 // pthread_create() (e.g., the main thread of webkit_unit_tests).
39 // If so, a conservative size estimate is returned.
40@@ -135,7 +135,7 @@ size_t StackFrameDepth::getUnderestimatedStackSize()
41
42 void* StackFrameDepth::getStackStart()
43 {
44-#if defined(__GLIBC__) || OS(ANDROID) || OS(FREEBSD)
45+#if OS(LINUX) || OS(ANDROID) || OS(FREEBSD)
46 pthread_attr_t attr;
47 int error;
48 #if OS(FREEBSD)
49--
502.13.2
51
diff --git a/recipes-qt/qt5/qtwebengine/0013-include-asm-generic-ioctl.h-for-TCGETS2.patch b/recipes-qt/qt5/qtwebengine/0013-include-asm-generic-ioctl.h-for-TCGETS2.patch
new file mode 100644
index 00000000..abe2eaf8
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/0013-include-asm-generic-ioctl.h-for-TCGETS2.patch
@@ -0,0 +1,25 @@
1From d5014cf9a97cf97a6e9bb7f751c7cee3c24e17fd Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 7 Jul 2017 17:15:34 -0700
4Subject: [PATCH 1/2] include asm-generic/ioctl.h for TCGETS2
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 device/serial/serial_io_handler_posix.cc | 1 +
9 1 file changed, 1 insertion(+)
10
11diff --git a/device/serial/serial_io_handler_posix.cc b/device/serial/serial_io_handler_posix.cc
12index 158c374a0..c08fb4a8e 100644
13--- a/device/serial/serial_io_handler_posix.cc
14+++ b/device/serial/serial_io_handler_posix.cc
15@@ -6,6 +6,7 @@
16
17 #include <sys/ioctl.h>
18 #include <termios.h>
19+#include <asm-generic/ioctls.h>
20
21 #include "base/posix/eintr_wrapper.h"
22 #include "build/build_config.h"
23--
242.13.2
25
diff --git a/recipes-qt/qt5/qtwebengine/0014-link-with-libexecinfo-on-musl.patch b/recipes-qt/qt5/qtwebengine/0014-link-with-libexecinfo-on-musl.patch
new file mode 100644
index 00000000..1b65420b
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/0014-link-with-libexecinfo-on-musl.patch
@@ -0,0 +1,25 @@
1From 4b5aab95e34e1cbebc7566c1267cddc2560601c8 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 7 Jul 2017 17:41:43 -0700
4Subject: [PATCH 2/2] link with libexecinfo on musl
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 base/base.gyp | 1 +
9 1 file changed, 1 insertion(+)
10
11diff --git a/base/base.gyp b/base/base.gyp
12index 67e051ae4..7f5dfe214 100644
13--- a/base/base.gyp
14+++ b/base/base.gyp
15@@ -126,6 +126,7 @@
16 '-lrt',
17 # For 'native_library_linux.cc'
18 '-ldl',
19+ '-lexecinfo',
20 ],
21 },
22 'conditions': [
23--
242.13.2
25
diff --git a/recipes-qt/qt5/qtwebengine/0018-tcmalloc-Use-off64_t-insread-of-__off64_t.patch b/recipes-qt/qt5/qtwebengine/0018-tcmalloc-Use-off64_t-insread-of-__off64_t.patch
new file mode 100644
index 00000000..2ef54339
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/0018-tcmalloc-Use-off64_t-insread-of-__off64_t.patch
@@ -0,0 +1,26 @@
1From 1a468dd5239ebdf013d9ffb3a2d181d0434b4c6c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 8 Jul 2017 09:08:23 -0700
4Subject: [PATCH 2/2] tcmalloc: Use off64_t insread of __off64_t
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 third_party/tcmalloc/chromium/src/base/linux_syscall_support.h | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h b/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
12index b53dd46c5..58da4d19d 100644
13--- a/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
14+++ b/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
15@@ -1930,7 +1930,7 @@ typedef unsigned long int ulong;
16 #if defined(__x86_64__)
17 /* Need to make sure __off64_t isn't truncated to 32-bits under x32. */
18 LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
19- __off64_t o) {
20+ off64_t o) {
21 LSS_BODY(6, void*, mmap, LSS_SYSCALL_ARG(s), LSS_SYSCALL_ARG(l),
22 LSS_SYSCALL_ARG(p), LSS_SYSCALL_ARG(f),
23 LSS_SYSCALL_ARG(d), (uint64_t)(o));
24--
252.13.2
26