summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtwebengine/chromium
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2018-06-06 08:25:33 +0000
committerMartin Jansa <Martin.Jansa@gmail.com>2018-06-06 11:32:55 +0000
commit33f58ffa657c3ae924f86a65be117be3562b2bf3 (patch)
tree6b71aa37166b5a7e184a33b89f32d666d9dd99fb /recipes-qt/qt5/qtwebengine/chromium
parent267a38fddeecb28b269fc86f7024e50dbc47acbe (diff)
downloadmeta-qt5-33f58ffa657c3ae924f86a65be117be3562b2bf3.tar.gz
qtwebengine: fix build with gcc8, part II
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'recipes-qt/qt5/qtwebengine/chromium')
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0001-chromium-Force-host-toolchain-configuration.patch33
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0002-chromium-workaround-for-too-long-.rps-file-name.patch42
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0003-chromium-Fix-build-with-gcc8.patch50
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0004-chromium-Fix-build-with-GCC-8.1.0.patch83
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0005-chromium-musl-sandbox-Define-TEMP_FAILURE_RETRY-if-n.patch33
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0006-chromium-musl-Avoid-mallinfo-APIs-on-non-glibc-linux.patch67
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0007-chromium-musl-include-fcntl.h-for-loff_t.patch22
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0008-chromium-musl-use-off64_t-instead-of-the-internal-__.patch62
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0009-chromium-musl-linux-glibc-make-the-distinction.patch23
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0010-chromium-musl-allocator-Do-not-include-glibc_weak_sy.patch24
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0011-chromium-musl-Use-correct-member-name-__si_fields-fr.patch24
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0012-chromium-musl-Define-res_ninit-and-res_nclose-for-no.patch79
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0013-chromium-musl-Do-not-define-__sbrk-on-musl.patch26
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0014-chromium-musl-Adjust-default-pthread-stack-size.patch47
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0015-chromium-musl-include-asm-generic-ioctl.h-for-TCGETS.patch22
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0016-chromium-musl-tcmalloc-Use-off64_t-insread-of-__off6.patch23
16 files changed, 660 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0001-chromium-Force-host-toolchain-configuration.patch b/recipes-qt/qt5/qtwebengine/chromium/0001-chromium-Force-host-toolchain-configuration.patch
new file mode 100644
index 00000000..6de64b03
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0001-chromium-Force-host-toolchain-configuration.patch
@@ -0,0 +1,33 @@
1From e3b98ab1d2e08c0072bd83dd7f487f404cc3a44a Mon Sep 17 00:00:00 2001
2From: Samuli Piippo <samuli.piippo@qt.io>
3Date: Wed, 15 Mar 2017 13:53:28 +0200
4Subject: [PATCH] chromium: Force host toolchain configuration
5
6Force gcc/g++ to be used for parts using host toolchain, since
7the option(host_build) does not work in yocto builds.
8
9Upstream-Status: Inappropriate [OE specific]
10Signed-off-by: Samuli Piippo <samuli.piippo@qt.io>
11Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
12---
13 chromium/tools/gn/bootstrap/bootstrap.py | 6 +++---
14 1 file changed, 3 insertions(+), 3 deletions(-)
15
16diff --git a/chromium/tools/gn/bootstrap/bootstrap.py b/chromium/tools/gn/bootstrap/bootstrap.py
17index 93c6446f28..0fe7e6737d 100755
18--- a/chromium/tools/gn/bootstrap/bootstrap.py
19+++ b/chromium/tools/gn/bootstrap/bootstrap.py
20@@ -352,10 +352,10 @@ def write_gn_ninja(path, root_gen_dir, options):
21 ld = os.environ.get('LD', cxx)
22 ar = os.environ.get('AR', 'ar -X64')
23 else:
24- cc = os.environ.get('CC', 'cc')
25- cxx = os.environ.get('CXX', 'c++')
26+ cc = os.environ.get('CC_host', 'gcc')
27+ cxx = os.environ.get('CXX_host', 'g++')
28 ld = cxx
29- ar = os.environ.get('AR', 'ar')
30+ ar = os.environ.get('AR_host', 'ar')
31
32 # QTBUG-64759
33 # cflags = os.environ.get('CFLAGS', '').split()
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0002-chromium-workaround-for-too-long-.rps-file-name.patch b/recipes-qt/qt5/qtwebengine/chromium/0002-chromium-workaround-for-too-long-.rps-file-name.patch
new file mode 100644
index 00000000..42eb193b
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0002-chromium-workaround-for-too-long-.rps-file-name.patch
@@ -0,0 +1,42 @@
1From d39590cf1ee3adcf6d93cc40263c377e2a5cf0e2 Mon Sep 17 00:00:00 2001
2From: Samuli Piippo <samuli.piippo@qt.io>
3Date: Thu, 30 Mar 2017 11:37:24 +0300
4Subject: [PATCH] chromium: workaround for too long .rps file name
5
6Ninja may fail when the build directory is too long:
7
8ninja: error: WriteFile(__third_party_WebKit_Source_bindings_modules_\
9interfaces_info_individual_modules__home_qt_work_build_build-nitrogen\
106x_tmp_work_cortexa9hf-neon-mx6qdl-poky-linux-gnueabi_qtwebengine_5.9\
11.0_gitAUTOINC_29afdb0a34_049134677a-r0_build_src_toolchain_target__ru\
12le.rsp): Unable to create file. File name too long
13
14Task-number: QTBUG-59769
15Change-Id: I73c5e64ae5174412be2a675e35b0b6047f2bf4c1
16---
17 chromium/tools/gn/ninja_action_target_writer.cc | 9 +++++++++
18 1 file changed, 9 insertions(+)
19
20diff --git a/chromium/tools/gn/ninja_action_target_writer.cc b/chromium/tools/gn/ninja_action_target_writer.cc
21index bab07c5d2b..8f889aebc1 100644
22--- a/chromium/tools/gn/ninja_action_target_writer.cc
23+++ b/chromium/tools/gn/ninja_action_target_writer.cc
24@@ -117,9 +117,18 @@ std::string NinjaActionTargetWriter::WriteRuleDefinition() {
25 // strictly necessary for regular one-shot actions, but it's easier to
26 // just always define unique_name.
27 std::string rspfile = custom_rule_name;
28+
29+ //quick workaround if filename length > 255 - ".rsp", just cut the dirs starting from the end
30+ //please note ".$unique_name" is not used at the moment
31+ int pos = 0;
32+ std::string delimiter("_");
33+ while (rspfile.length() > 251 && (pos = rspfile.find_last_of(delimiter)) != std::string::npos)
34+ rspfile = rspfile.substr(0,pos);
35+
36 if (!target_->sources().empty())
37 rspfile += ".$unique_name";
38 rspfile += ".rsp";
39+
40 out_ << " rspfile = " << rspfile << std::endl;
41
42 // Response file contents.
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0003-chromium-Fix-build-with-gcc8.patch b/recipes-qt/qt5/qtwebengine/chromium/0003-chromium-Fix-build-with-gcc8.patch
new file mode 100644
index 00000000..f79b0e8c
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0003-chromium-Fix-build-with-gcc8.patch
@@ -0,0 +1,50 @@
1From c0047b885faafaab35d6dde4578c3c1a00b80cee Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Tue, 5 Jun 2018 13:58:16 +0000
4Subject: [PATCH] chromium: Fix build with gcc8
5
6---
7 chromium/mojo/public/c/system/buffer.h | 2 +-
8 chromium/mojo/public/c/system/data_pipe.h | 2 +-
9 chromium/mojo/public/c/system/message_pipe.h | 2 +-
10 3 files changed, 3 insertions(+), 3 deletions(-)
11
12diff --git a/chromium/mojo/public/c/system/buffer.h b/chromium/mojo/public/c/system/buffer.h
13index 09f6d285f3..e516a09e49 100644
14--- a/chromium/mojo/public/c/system/buffer.h
15+++ b/chromium/mojo/public/c/system/buffer.h
16@@ -35,7 +35,7 @@ const MojoCreateSharedBufferOptionsFlags
17 ((MojoCreateSharedBufferOptionsFlags)0)
18 #endif
19
20-MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment");
21+MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int64_t) == 4 || MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment");
22 struct MOJO_ALIGNAS(8) MojoCreateSharedBufferOptions {
23 uint32_t struct_size;
24 MojoCreateSharedBufferOptionsFlags flags;
25diff --git a/chromium/mojo/public/c/system/data_pipe.h b/chromium/mojo/public/c/system/data_pipe.h
26index 62adbea1ea..76225858ba 100644
27--- a/chromium/mojo/public/c/system/data_pipe.h
28+++ b/chromium/mojo/public/c/system/data_pipe.h
29@@ -46,7 +46,7 @@ const MojoCreateDataPipeOptionsFlags MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE =
30 ((MojoCreateDataPipeOptionsFlags)0)
31 #endif
32
33-MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment");
34+MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int64_t) == 4 || MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment");
35 struct MOJO_ALIGNAS(8) MojoCreateDataPipeOptions {
36 MOJO_ALIGNAS(4) uint32_t struct_size;
37 MOJO_ALIGNAS(4) MojoCreateDataPipeOptionsFlags flags;
38diff --git a/chromium/mojo/public/c/system/message_pipe.h b/chromium/mojo/public/c/system/message_pipe.h
39index f0f69d1025..364a02971e 100644
40--- a/chromium/mojo/public/c/system/message_pipe.h
41+++ b/chromium/mojo/public/c/system/message_pipe.h
42@@ -44,7 +44,7 @@ const MojoCreateMessagePipeOptionsFlags
43 ((MojoCreateMessagePipeOptionsFlags)0)
44 #endif
45
46-MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment");
47+MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int64_t) == 4 || MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment");
48 struct MOJO_ALIGNAS(8) MojoCreateMessagePipeOptions {
49 uint32_t struct_size;
50 MojoCreateMessagePipeOptionsFlags flags;
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0004-chromium-Fix-build-with-GCC-8.1.0.patch b/recipes-qt/qt5/qtwebengine/chromium/0004-chromium-Fix-build-with-GCC-8.1.0.patch
new file mode 100644
index 00000000..297700be
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0004-chromium-Fix-build-with-GCC-8.1.0.patch
@@ -0,0 +1,83 @@
1From e8df2acf2ce52972b2ed2596f2ca6dac8656eded Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?J=C3=BCri=20Valdmann?= <juri.valdmann@qt.io>
3Date: Mon, 14 May 2018 10:15:50 +0200
4Subject: [PATCH] chromium: Fix build with GCC 8.1.0
5
6Task-number: QTBUG-68203
7Change-Id: I780d884d5e20ef04e902d7b449da4aa3f97d8d0b
8Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
9
10Upstream-Status: Backport (from newer 65-based revision)
11---
12 .../mojo/public/cpp/bindings/associated_interface_ptr_info.h | 2 +-
13 .../mojo/public/cpp/bindings/associated_interface_request.h | 2 +-
14 chromium/mojo/public/cpp/bindings/interface_request.h | 2 +-
15 .../mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h | 2 ++
16 chromium/mojo/public/cpp/system/handle.h | 2 +-
17 5 files changed, 6 insertions(+), 4 deletions(-)
18
19diff --git a/chromium/mojo/public/cpp/bindings/associated_interface_ptr_info.h b/chromium/mojo/public/cpp/bindings/associated_interface_ptr_info.h
20index 1f79662bd7..184ba6a9e8 100644
21--- a/chromium/mojo/public/cpp/bindings/associated_interface_ptr_info.h
22+++ b/chromium/mojo/public/cpp/bindings/associated_interface_ptr_info.h
23@@ -45,7 +45,7 @@ class AssociatedInterfacePtrInfo {
24
25 bool is_valid() const { return handle_.is_valid(); }
26
27- explicit operator bool() const { return handle_; }
28+ explicit operator bool() const { return !!handle_; }
29
30 ScopedInterfaceEndpointHandle PassHandle() {
31 return std::move(handle_);
32diff --git a/chromium/mojo/public/cpp/bindings/associated_interface_request.h b/chromium/mojo/public/cpp/bindings/associated_interface_request.h
33index 12d2f3ce1d..fcdc2b9321 100644
34--- a/chromium/mojo/public/cpp/bindings/associated_interface_request.h
35+++ b/chromium/mojo/public/cpp/bindings/associated_interface_request.h
36@@ -50,7 +50,7 @@ class AssociatedInterfaceRequest {
37 // handle.
38 bool is_pending() const { return handle_.is_valid(); }
39
40- explicit operator bool() const { return handle_; }
41+ explicit operator bool() const { return !!handle_; }
42
43 ScopedInterfaceEndpointHandle PassHandle() { return std::move(handle_); }
44
45diff --git a/chromium/mojo/public/cpp/bindings/interface_request.h b/chromium/mojo/public/cpp/bindings/interface_request.h
46index 1007cb0b8c..da1f3244a3 100644
47--- a/chromium/mojo/public/cpp/bindings/interface_request.h
48+++ b/chromium/mojo/public/cpp/bindings/interface_request.h
49@@ -54,7 +54,7 @@ class InterfaceRequest {
50 // Indicates whether the request currently contains a valid message pipe.
51 bool is_pending() const { return handle_.is_valid(); }
52
53- explicit operator bool() const { return handle_; }
54+ explicit operator bool() const { return !!handle_; }
55
56 // Removes the message pipe from the request and returns it.
57 ScopedMessagePipeHandle PassMessagePipe() { return std::move(handle_); }
58diff --git a/chromium/mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h b/chromium/mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h
59index 5d00e5019e..ef8a927ba6 100644
60--- a/chromium/mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h
61+++ b/chromium/mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h
62@@ -45,6 +45,8 @@ class MOJO_CPP_BINDINGS_EXPORT ScopedInterfaceEndpointHandle {
63
64 bool is_valid() const;
65
66+ explicit operator bool() const { return is_valid(); }
67+
68 // Returns true if the interface hasn't associated with a message pipe.
69 bool pending_association() const;
70
71diff --git a/chromium/mojo/public/cpp/system/handle.h b/chromium/mojo/public/cpp/system/handle.h
72index 7c886e8825..c9f9e961db 100644
73--- a/chromium/mojo/public/cpp/system/handle.h
74+++ b/chromium/mojo/public/cpp/system/handle.h
75@@ -121,7 +121,7 @@ class ScopedHandleBase {
76
77 bool is_valid() const { return handle_.is_valid(); }
78
79- explicit operator bool() const { return handle_; }
80+ explicit operator bool() const { return !!handle_; }
81
82 bool operator==(const ScopedHandleBase& other) const {
83 return handle_.value() == other.get().value();
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0005-chromium-musl-sandbox-Define-TEMP_FAILURE_RETRY-if-n.patch b/recipes-qt/qt5/qtwebengine/chromium/0005-chromium-musl-sandbox-Define-TEMP_FAILURE_RETRY-if-n.patch
new file mode 100644
index 00000000..15911d3d
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0005-chromium-musl-sandbox-Define-TEMP_FAILURE_RETRY-if-n.patch
@@ -0,0 +1,33 @@
1From c2c6c36c4a04816dd1c6815ed4df14b7f3a00d61 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] chromium: musl: sandbox: Define TEMP_FAILURE_RETRY if not
5 defined
6
7Musl does not define this Macro
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 chromium/sandbox/linux/suid/sandbox.c | 9 +++++++++
12 1 file changed, 9 insertions(+)
13
14diff --git a/chromium/sandbox/linux/suid/sandbox.c b/chromium/sandbox/linux/suid/sandbox.c
15index 66f68ef138..9284d0d4fc 100644
16--- a/chromium/sandbox/linux/suid/sandbox.c
17+++ b/chromium/sandbox/linux/suid/sandbox.c
18@@ -44,6 +44,15 @@ static bool DropRoot();
19
20 #define HANDLE_EINTR(x) TEMP_FAILURE_RETRY(x)
21
22+#ifndef TEMP_FAILURE_RETRY
23+# define TEMP_FAILURE_RETRY(expression) \
24+ (__extension__ \
25+ ({ long int __result; \
26+ do __result = (long int) (expression); \
27+ while (__result == -1L && errno == EINTR); \
28+ __result; }))
29+#endif
30+
31 static void FatalError(const char* msg, ...)
32 __attribute__((noreturn, format(printf, 1, 2)));
33
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0006-chromium-musl-Avoid-mallinfo-APIs-on-non-glibc-linux.patch b/recipes-qt/qt5/qtwebengine/chromium/0006-chromium-musl-Avoid-mallinfo-APIs-on-non-glibc-linux.patch
new file mode 100644
index 00000000..bd74bba6
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0006-chromium-musl-Avoid-mallinfo-APIs-on-non-glibc-linux.patch
@@ -0,0 +1,67 @@
1From 79365295aa98d6e40aff1493febd1725caff0893 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] chromium: musl: Avoid mallinfo() APIs on non-glibc/linux
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 chromium/base/process/process_metrics_posix.cc | 4 ++--
9 chromium/base/trace_event/malloc_dump_provider.cc | 3 ++-
10 chromium/content/child/content_child_helpers.cc | 2 +-
11 3 files changed, 5 insertions(+), 4 deletions(-)
12
13diff --git a/chromium/base/process/process_metrics_posix.cc b/chromium/base/process/process_metrics_posix.cc
14index 73a52d6210..4867198a50 100644
15--- a/chromium/base/process/process_metrics_posix.cc
16+++ b/chromium/base/process/process_metrics_posix.cc
17@@ -94,14 +94,14 @@ size_t ProcessMetrics::GetMallocUsage() {
18 malloc_statistics_t stats = {0};
19 malloc_zone_statistics(nullptr, &stats);
20 return stats.size_in_use;
21-#elif defined(OS_LINUX) || defined(OS_ANDROID)
22+#elif defined(__GLIBC__) || defined(OS_ANDROID)
23 struct mallinfo minfo = mallinfo();
24 #if defined(USE_TCMALLOC)
25 return minfo.uordblks;
26 #else
27 return minfo.hblkhd + minfo.arena;
28 #endif
29-#elif defined(OS_FUCHSIA)
30+#else
31 // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
32 return 0;
33 #endif
34diff --git a/chromium/base/trace_event/malloc_dump_provider.cc b/chromium/base/trace_event/malloc_dump_provider.cc
35index ffd519133c..0c9131e98e 100644
36--- a/chromium/base/trace_event/malloc_dump_provider.cc
37+++ b/chromium/base/trace_event/malloc_dump_provider.cc
38@@ -197,6 +197,7 @@ MallocDumpProvider::~MallocDumpProvider() = default;
39 // the current process.
40 bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
41 ProcessMemoryDump* pmd) {
42+#if defined(__GLIBC__)
43 {
44 base::AutoLock auto_lock(emit_metrics_on_memory_dump_lock_);
45 if (!emit_metrics_on_memory_dump_)
46@@ -322,7 +323,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
47 pmd->DumpHeapUsage(metrics_by_context, overhead, "malloc");
48 }
49 tid_dumping_heap_ = kInvalidThreadId;
50-
51+#endif // __GLIBC__
52 return true;
53 }
54
55diff --git a/chromium/content/child/content_child_helpers.cc b/chromium/content/child/content_child_helpers.cc
56index 7ddeb4d16a..b8c73b09c5 100644
57--- a/chromium/content/child/content_child_helpers.cc
58+++ b/chromium/content/child/content_child_helpers.cc
59@@ -25,7 +25,7 @@ namespace content {
60 // though, this provides only a partial and misleading value.
61 // Unfortunately some telemetry benchmark rely on it and these need to
62 // be refactored before getting rid of this. See crbug.com/581365 .
63-#if defined(OS_LINUX) || defined(OS_ANDROID)
64+#if defined(__GLIBC__) || defined(OS_ANDROID)
65 size_t GetMemoryUsageKB() {
66 struct mallinfo minfo = mallinfo();
67 uint64_t mem_usage =
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0007-chromium-musl-include-fcntl.h-for-loff_t.patch b/recipes-qt/qt5/qtwebengine/chromium/0007-chromium-musl-include-fcntl.h-for-loff_t.patch
new file mode 100644
index 00000000..67dc1b96
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0007-chromium-musl-include-fcntl.h-for-loff_t.patch
@@ -0,0 +1,22 @@
1From 7eaf0542be69e41d5dbb013a09ebc0f8c413d688 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] chromium: musl: include fcntl.h for loff_t
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 .../tcmalloc/chromium/src/base/linux_syscall_support.h | 1 +
9 1 file changed, 1 insertion(+)
10
11diff --git a/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h b/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
12index b29ec2d29a..91f77dd88d 100644
13--- a/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
14+++ b/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
15@@ -150,6 +150,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>
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0008-chromium-musl-use-off64_t-instead-of-the-internal-__.patch b/recipes-qt/qt5/qtwebengine/chromium/0008-chromium-musl-use-off64_t-instead-of-the-internal-__.patch
new file mode 100644
index 00000000..704469d1
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0008-chromium-musl-use-off64_t-instead-of-the-internal-__.patch
@@ -0,0 +1,62 @@
1From 3896238d9c177c216ffcac111feb36a622da8cf0 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] chromium: musl: 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 .../tcmalloc/chromium/src/malloc_hook_mmap_linux.h | 10 +++++-----
12 1 file changed, 5 insertions(+), 5 deletions(-)
13
14diff --git a/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h b/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h
15index 715c045f66..edc8cf2db7 100644
16--- a/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h
17+++ b/chromium/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 {
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0009-chromium-musl-linux-glibc-make-the-distinction.patch b/recipes-qt/qt5/qtwebengine/chromium/0009-chromium-musl-linux-glibc-make-the-distinction.patch
new file mode 100644
index 00000000..0ebd5564
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0009-chromium-musl-linux-glibc-make-the-distinction.patch
@@ -0,0 +1,23 @@
1From 7c63f8cbe68a241d5e4c82f96286c125be3035e6 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] chromium: musl: linux != glibc, make the distinction
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 chromium/base/allocator/allocator_check.cc | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/chromium/base/allocator/allocator_check.cc b/chromium/base/allocator/allocator_check.cc
12index 9cd5d2207d..1e70095648 100644
13--- a/chromium/base/allocator/allocator_check.cc
14+++ b/chromium/base/allocator/allocator_check.cc
15@@ -27,7 +27,7 @@ bool IsAllocatorInitialized() {
16 // Set by allocator_shim_override_ucrt_symbols_win.h when the
17 // 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.
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0010-chromium-musl-allocator-Do-not-include-glibc_weak_sy.patch b/recipes-qt/qt5/qtwebengine/chromium/0010-chromium-musl-allocator-Do-not-include-glibc_weak_sy.patch
new file mode 100644
index 00000000..85a911bf
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0010-chromium-musl-allocator-Do-not-include-glibc_weak_sy.patch
@@ -0,0 +1,24 @@
1From 2feb363e9a5e256c68b2f3c0207d9d057a51440f 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] chromium: musl: allocator: Do not include glibc_weak_symbols
5 for musl
6
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8---
9 chromium/base/allocator/allocator_shim.cc | 2 +-
10 1 file changed, 1 insertion(+), 1 deletion(-)
11
12diff --git a/chromium/base/allocator/allocator_shim.cc b/chromium/base/allocator/allocator_shim.cc
13index 4b7de5e1a3..fe565223f2 100644
14--- a/chromium/base/allocator/allocator_shim.cc
15+++ b/chromium/base/allocator/allocator_shim.cc
16@@ -302,7 +302,7 @@ ALWAYS_INLINE void ShimFreeDefiniteSize(void* ptr, size_t size, void* context) {
17 // In the case of tcmalloc we also want to plumb into the glibc hooks
18 // to avoid that allocations made in glibc itself (e.g., strdup()) get
19 // accidentally performed on the glibc heap instead of the tcmalloc one.
20-#if defined(USE_TCMALLOC)
21+#if defined(USE_TCMALLOC) && defined(__GLIBC__)
22 #include "base/allocator/allocator_shim_override_glibc_weak_symbols.h"
23 #endif
24
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0011-chromium-musl-Use-correct-member-name-__si_fields-fr.patch b/recipes-qt/qt5/qtwebengine/chromium/0011-chromium-musl-Use-correct-member-name-__si_fields-fr.patch
new file mode 100644
index 00000000..d0bcd098
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0011-chromium-musl-Use-correct-member-name-__si_fields-fr.patch
@@ -0,0 +1,24 @@
1From d1ca892f6547403bcb11449565796aaa5a29b2ee 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] chromium: musl: Use correct member name __si_fields from
5 LinuxSigInfo
6
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8---
9 chromium/sandbox/linux/seccomp-bpf/trap.cc | 2 +-
10 1 file changed, 1 insertion(+), 1 deletion(-)
11
12diff --git a/chromium/sandbox/linux/seccomp-bpf/trap.cc b/chromium/sandbox/linux/seccomp-bpf/trap.cc
13index 003708d2c8..0fef3148f9 100644
14--- a/chromium/sandbox/linux/seccomp-bpf/trap.cc
15+++ b/chromium/sandbox/linux/seccomp-bpf/trap.cc
16@@ -168,7 +168,7 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
17 // most versions of glibc don't include this information in siginfo_t. So,
18 // we need to explicitly copy it into a arch_sigsys structure.
19 struct arch_sigsys sigsys;
20- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
21+ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys));
22
23 #if defined(__mips__)
24 // When indirect syscall (syscall(__NR_foo, ...)) is made on Mips, the
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0012-chromium-musl-Define-res_ninit-and-res_nclose-for-no.patch b/recipes-qt/qt5/qtwebengine/chromium/0012-chromium-musl-Define-res_ninit-and-res_nclose-for-no.patch
new file mode 100644
index 00000000..9ff95aef
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0012-chromium-musl-Define-res_ninit-and-res_nclose-for-no.patch
@@ -0,0 +1,79 @@
1From b27f5caada6437f0dcec1c616c290fdf9e95d1f8 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] chromium: musl: Define res_ninit and res_nclose for non-glibc
5 platforms
6
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8---
9 chromium/net/dns/dns_config_service_posix.cc | 4 +++
10 chromium/net/dns/dns_reloader.cc | 4 +++
11 chromium/net/dns/resolv_compat.h | 29 ++++++++++++++++++++
12 3 files changed, 37 insertions(+)
13 create mode 100644 chromium/net/dns/resolv_compat.h
14
15diff --git a/chromium/net/dns/dns_config_service_posix.cc b/chromium/net/dns/dns_config_service_posix.cc
16index f2e66331e3..6fe84dd66a 100644
17--- a/chromium/net/dns/dns_config_service_posix.cc
18+++ b/chromium/net/dns/dns_config_service_posix.cc
19@@ -27,6 +27,10 @@
20 #include "net/dns/notify_watcher_mac.h"
21 #include "net/dns/serial_worker.h"
22
23+#if defined(OS_LINUX) && !defined(__GLIBC__)
24+#include "net/dns/resolv_compat.h"
25+#endif
26+
27 #if defined(OS_MACOSX) && !defined(OS_IOS)
28 #include "net/dns/dns_config_watcher_mac.h"
29 #endif
30diff --git a/chromium/net/dns/dns_reloader.cc b/chromium/net/dns/dns_reloader.cc
31index 322c8a5f0f..72ff40dbe1 100644
32--- a/chromium/net/dns/dns_reloader.cc
33+++ b/chromium/net/dns/dns_reloader.cc
34@@ -9,6 +9,10 @@
35
36 #include <resolv.h>
37
38+#if defined(OS_LINUX) && !defined(__GLIBC__)
39+#include "net/dns/resolv_compat.h"
40+#endif
41+
42 #include "base/lazy_instance.h"
43 #include "base/logging.h"
44 #include "base/macros.h"
45diff --git a/chromium/net/dns/resolv_compat.h b/chromium/net/dns/resolv_compat.h
46new file mode 100644
47index 0000000000..4f0e852a19
48--- /dev/null
49+++ b/chromium/net/dns/resolv_compat.h
50@@ -0,0 +1,29 @@
51+#if !defined(__GLIBC__)
52+/***************************************************************************
53+ * resolv_compat.h
54+ *
55+ * Mimick GLIBC's res_ninit() and res_nclose() for musl libc
56+ * Note: res_init() is actually deprecated according to
57+ * http://docs.oracle.com/cd/E36784_01/html/E36875/res-nclose-3resolv.html
58+ **************************************************************************/
59+#include <string.h>
60+
61+static inline int res_ninit(res_state statp)
62+{
63+ int rc = res_init();
64+ if (statp != &_res) {
65+ memcpy(statp, &_res, sizeof(*statp));
66+ }
67+ return rc;
68+}
69+
70+static inline int res_nclose(res_state statp)
71+{
72+ if (!statp)
73+ return -1;
74+ if (statp != &_res) {
75+ memset(statp, 0, sizeof(*statp));
76+ }
77+ return 0;
78+}
79+#endif
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0013-chromium-musl-Do-not-define-__sbrk-on-musl.patch b/recipes-qt/qt5/qtwebengine/chromium/0013-chromium-musl-Do-not-define-__sbrk-on-musl.patch
new file mode 100644
index 00000000..4b5d0642
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0013-chromium-musl-Do-not-define-__sbrk-on-musl.patch
@@ -0,0 +1,26 @@
1From 81439c06b19c58a34a5fd3fc2a391561b4120b5e 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] chromium: musl: 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/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h b/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h
15index edc8cf2db7..a868b50d30 100644
16--- a/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h
17+++ b/chromium/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
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0014-chromium-musl-Adjust-default-pthread-stack-size.patch b/recipes-qt/qt5/qtwebengine/chromium/0014-chromium-musl-Adjust-default-pthread-stack-size.patch
new file mode 100644
index 00000000..05761172
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0014-chromium-musl-Adjust-default-pthread-stack-size.patch
@@ -0,0 +1,47 @@
1From f3a917e4f78f49742e53c2a9d5a4b289159546d0 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] chromium: musl: Adjust default pthread stack size
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 chromium/base/threading/platform_thread_linux.cc | 3 ++-
9 chromium/third_party/WebKit/Source/platform/wtf/StackUtil.cpp | 4 ++--
10 2 files changed, 4 insertions(+), 3 deletions(-)
11
12diff --git a/chromium/base/threading/platform_thread_linux.cc b/chromium/base/threading/platform_thread_linux.cc
13index 9917a7b1fd..cb406659b9 100644
14--- a/chromium/base/threading/platform_thread_linux.cc
15+++ b/chromium/base/threading/platform_thread_linux.cc
16@@ -173,7 +173,8 @@ void TerminateOnThread() {}
17
18 size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
19 #if !defined(THREAD_SANITIZER)
20- return 0;
21+ // use 8mb like glibc to avoid running out of space
22+ return (1 << 23);
23 #else
24 // ThreadSanitizer bloats the stack heavily. Evidence has been that the
25 // default stack size isn't enough for some browser tests.
26diff --git a/chromium/third_party/WebKit/Source/platform/wtf/StackUtil.cpp b/chromium/third_party/WebKit/Source/platform/wtf/StackUtil.cpp
27index 13c3f907f8..07308e0835 100644
28--- a/chromium/third_party/WebKit/Source/platform/wtf/StackUtil.cpp
29+++ b/chromium/third_party/WebKit/Source/platform/wtf/StackUtil.cpp
30@@ -28,7 +28,7 @@ size_t GetUnderestimatedStackSize() {
31 // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
32 // correctly for the main thread.
33
34-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
35+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
36 defined(OS_FUCHSIA)
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@@ -96,7 +96,7 @@ size_t GetUnderestimatedStackSize() {
40 }
41
42 void* GetStackStart() {
43-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
44+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
45 defined(OS_FUCHSIA)
46 pthread_attr_t attr;
47 int error;
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0015-chromium-musl-include-asm-generic-ioctl.h-for-TCGETS.patch b/recipes-qt/qt5/qtwebengine/chromium/0015-chromium-musl-include-asm-generic-ioctl.h-for-TCGETS.patch
new file mode 100644
index 00000000..67dbab68
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0015-chromium-musl-include-asm-generic-ioctl.h-for-TCGETS.patch
@@ -0,0 +1,22 @@
1From 5924e39e96f891c1fa7239d91507b2a48d5c47b2 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] chromium: musl: include asm-generic/ioctl.h for TCGETS2
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 chromium/device/serial/serial_io_handler_posix.cc | 1 +
9 1 file changed, 1 insertion(+)
10
11diff --git a/chromium/device/serial/serial_io_handler_posix.cc b/chromium/device/serial/serial_io_handler_posix.cc
12index d6ed5e1f88..b550f895ef 100644
13--- a/chromium/device/serial/serial_io_handler_posix.cc
14+++ b/chromium/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/files/file_util.h"
22 #include "base/posix/eintr_wrapper.h"
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0016-chromium-musl-tcmalloc-Use-off64_t-insread-of-__off6.patch b/recipes-qt/qt5/qtwebengine/chromium/0016-chromium-musl-tcmalloc-Use-off64_t-insread-of-__off6.patch
new file mode 100644
index 00000000..c006e6f7
--- /dev/null
+++ b/recipes-qt/qt5/qtwebengine/chromium/0016-chromium-musl-tcmalloc-Use-off64_t-insread-of-__off6.patch
@@ -0,0 +1,23 @@
1From af1843ce7883c1ff6f686089540eac5ee9541c3b 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] chromium: musl: tcmalloc: Use off64_t insread of __off64_t
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 .../tcmalloc/chromium/src/base/linux_syscall_support.h | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h b/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
12index 91f77dd88d..bb84a0b305 100644
13--- a/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
14+++ b/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
15@@ -1929,7 +1929,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));