diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2018-06-06 08:25:33 +0000 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2018-06-06 11:32:55 +0000 |
commit | 33f58ffa657c3ae924f86a65be117be3562b2bf3 (patch) | |
tree | 6b71aa37166b5a7e184a33b89f32d666d9dd99fb /recipes-qt/qt5/qtwebengine/chromium | |
parent | 267a38fddeecb28b269fc86f7024e50dbc47acbe (diff) |
qtwebengine: fix build with gcc8, part II
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'recipes-qt/qt5/qtwebengine/chromium')
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 @@ +From e3b98ab1d2e08c0072bd83dd7f487f404cc3a44a Mon Sep 17 00:00:00 2001 +From: Samuli Piippo <samuli.piippo@qt.io> +Date: Wed, 15 Mar 2017 13:53:28 +0200 +Subject: [PATCH] chromium: Force host toolchain configuration + +Force gcc/g++ to be used for parts using host toolchain, since +the option(host_build) does not work in yocto builds. + +Upstream-Status: Inappropriate [OE specific] +Signed-off-by: Samuli Piippo <samuli.piippo@qt.io> +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> +--- + chromium/tools/gn/bootstrap/bootstrap.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/chromium/tools/gn/bootstrap/bootstrap.py b/chromium/tools/gn/bootstrap/bootstrap.py +index 93c6446f28..0fe7e6737d 100755 +--- a/chromium/tools/gn/bootstrap/bootstrap.py ++++ b/chromium/tools/gn/bootstrap/bootstrap.py +@@ -352,10 +352,10 @@ def write_gn_ninja(path, root_gen_dir, options): + ld = os.environ.get('LD', cxx) + ar = os.environ.get('AR', 'ar -X64') + else: +- cc = os.environ.get('CC', 'cc') +- cxx = os.environ.get('CXX', 'c++') ++ cc = os.environ.get('CC_host', 'gcc') ++ cxx = os.environ.get('CXX_host', 'g++') + ld = cxx +- ar = os.environ.get('AR', 'ar') ++ ar = os.environ.get('AR_host', 'ar') + + # QTBUG-64759 + # 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 @@ +From d39590cf1ee3adcf6d93cc40263c377e2a5cf0e2 Mon Sep 17 00:00:00 2001 +From: Samuli Piippo <samuli.piippo@qt.io> +Date: Thu, 30 Mar 2017 11:37:24 +0300 +Subject: [PATCH] chromium: workaround for too long .rps file name + +Ninja may fail when the build directory is too long: + +ninja: error: WriteFile(__third_party_WebKit_Source_bindings_modules_\ +interfaces_info_individual_modules__home_qt_work_build_build-nitrogen\ +6x_tmp_work_cortexa9hf-neon-mx6qdl-poky-linux-gnueabi_qtwebengine_5.9\ +.0_gitAUTOINC_29afdb0a34_049134677a-r0_build_src_toolchain_target__ru\ +le.rsp): Unable to create file. File name too long + +Task-number: QTBUG-59769 +Change-Id: I73c5e64ae5174412be2a675e35b0b6047f2bf4c1 +--- + chromium/tools/gn/ninja_action_target_writer.cc | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/chromium/tools/gn/ninja_action_target_writer.cc b/chromium/tools/gn/ninja_action_target_writer.cc +index bab07c5d2b..8f889aebc1 100644 +--- a/chromium/tools/gn/ninja_action_target_writer.cc ++++ b/chromium/tools/gn/ninja_action_target_writer.cc +@@ -117,9 +117,18 @@ std::string NinjaActionTargetWriter::WriteRuleDefinition() { + // strictly necessary for regular one-shot actions, but it's easier to + // just always define unique_name. + std::string rspfile = custom_rule_name; ++ ++ //quick workaround if filename length > 255 - ".rsp", just cut the dirs starting from the end ++ //please note ".$unique_name" is not used at the moment ++ int pos = 0; ++ std::string delimiter("_"); ++ while (rspfile.length() > 251 && (pos = rspfile.find_last_of(delimiter)) != std::string::npos) ++ rspfile = rspfile.substr(0,pos); ++ + if (!target_->sources().empty()) + rspfile += ".$unique_name"; + rspfile += ".rsp"; ++ + out_ << " rspfile = " << rspfile << std::endl; + + // 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 @@ +From c0047b885faafaab35d6dde4578c3c1a00b80cee Mon Sep 17 00:00:00 2001 +From: Martin Jansa <Martin.Jansa@gmail.com> +Date: Tue, 5 Jun 2018 13:58:16 +0000 +Subject: [PATCH] chromium: Fix build with gcc8 + +--- + chromium/mojo/public/c/system/buffer.h | 2 +- + chromium/mojo/public/c/system/data_pipe.h | 2 +- + chromium/mojo/public/c/system/message_pipe.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/chromium/mojo/public/c/system/buffer.h b/chromium/mojo/public/c/system/buffer.h +index 09f6d285f3..e516a09e49 100644 +--- a/chromium/mojo/public/c/system/buffer.h ++++ b/chromium/mojo/public/c/system/buffer.h +@@ -35,7 +35,7 @@ const MojoCreateSharedBufferOptionsFlags + ((MojoCreateSharedBufferOptionsFlags)0) + #endif + +-MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment"); ++MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int64_t) == 4 || MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment"); + struct MOJO_ALIGNAS(8) MojoCreateSharedBufferOptions { + uint32_t struct_size; + MojoCreateSharedBufferOptionsFlags flags; +diff --git a/chromium/mojo/public/c/system/data_pipe.h b/chromium/mojo/public/c/system/data_pipe.h +index 62adbea1ea..76225858ba 100644 +--- a/chromium/mojo/public/c/system/data_pipe.h ++++ b/chromium/mojo/public/c/system/data_pipe.h +@@ -46,7 +46,7 @@ const MojoCreateDataPipeOptionsFlags MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE = + ((MojoCreateDataPipeOptionsFlags)0) + #endif + +-MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment"); ++MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int64_t) == 4 || MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment"); + struct MOJO_ALIGNAS(8) MojoCreateDataPipeOptions { + MOJO_ALIGNAS(4) uint32_t struct_size; + MOJO_ALIGNAS(4) MojoCreateDataPipeOptionsFlags flags; +diff --git a/chromium/mojo/public/c/system/message_pipe.h b/chromium/mojo/public/c/system/message_pipe.h +index f0f69d1025..364a02971e 100644 +--- a/chromium/mojo/public/c/system/message_pipe.h ++++ b/chromium/mojo/public/c/system/message_pipe.h +@@ -44,7 +44,7 @@ const MojoCreateMessagePipeOptionsFlags + ((MojoCreateMessagePipeOptionsFlags)0) + #endif + +-MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment"); ++MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int64_t) == 4 || MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment"); + struct MOJO_ALIGNAS(8) MojoCreateMessagePipeOptions { + uint32_t struct_size; + 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 @@ +From e8df2acf2ce52972b2ed2596f2ca6dac8656eded Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=BCri=20Valdmann?= <juri.valdmann@qt.io> +Date: Mon, 14 May 2018 10:15:50 +0200 +Subject: [PATCH] chromium: Fix build with GCC 8.1.0 + +Task-number: QTBUG-68203 +Change-Id: I780d884d5e20ef04e902d7b449da4aa3f97d8d0b +Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> + +Upstream-Status: Backport (from newer 65-based revision) +--- + .../mojo/public/cpp/bindings/associated_interface_ptr_info.h | 2 +- + .../mojo/public/cpp/bindings/associated_interface_request.h | 2 +- + chromium/mojo/public/cpp/bindings/interface_request.h | 2 +- + .../mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h | 2 ++ + chromium/mojo/public/cpp/system/handle.h | 2 +- + 5 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/chromium/mojo/public/cpp/bindings/associated_interface_ptr_info.h b/chromium/mojo/public/cpp/bindings/associated_interface_ptr_info.h +index 1f79662bd7..184ba6a9e8 100644 +--- a/chromium/mojo/public/cpp/bindings/associated_interface_ptr_info.h ++++ b/chromium/mojo/public/cpp/bindings/associated_interface_ptr_info.h +@@ -45,7 +45,7 @@ class AssociatedInterfacePtrInfo { + + bool is_valid() const { return handle_.is_valid(); } + +- explicit operator bool() const { return handle_; } ++ explicit operator bool() const { return !!handle_; } + + ScopedInterfaceEndpointHandle PassHandle() { + return std::move(handle_); +diff --git a/chromium/mojo/public/cpp/bindings/associated_interface_request.h b/chromium/mojo/public/cpp/bindings/associated_interface_request.h +index 12d2f3ce1d..fcdc2b9321 100644 +--- a/chromium/mojo/public/cpp/bindings/associated_interface_request.h ++++ b/chromium/mojo/public/cpp/bindings/associated_interface_request.h +@@ -50,7 +50,7 @@ class AssociatedInterfaceRequest { + // handle. + bool is_pending() const { return handle_.is_valid(); } + +- explicit operator bool() const { return handle_; } ++ explicit operator bool() const { return !!handle_; } + + ScopedInterfaceEndpointHandle PassHandle() { return std::move(handle_); } + +diff --git a/chromium/mojo/public/cpp/bindings/interface_request.h b/chromium/mojo/public/cpp/bindings/interface_request.h +index 1007cb0b8c..da1f3244a3 100644 +--- a/chromium/mojo/public/cpp/bindings/interface_request.h ++++ b/chromium/mojo/public/cpp/bindings/interface_request.h +@@ -54,7 +54,7 @@ class InterfaceRequest { + // Indicates whether the request currently contains a valid message pipe. + bool is_pending() const { return handle_.is_valid(); } + +- explicit operator bool() const { return handle_; } ++ explicit operator bool() const { return !!handle_; } + + // Removes the message pipe from the request and returns it. + ScopedMessagePipeHandle PassMessagePipe() { return std::move(handle_); } +diff --git a/chromium/mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h b/chromium/mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h +index 5d00e5019e..ef8a927ba6 100644 +--- a/chromium/mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h ++++ b/chromium/mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h +@@ -45,6 +45,8 @@ class MOJO_CPP_BINDINGS_EXPORT ScopedInterfaceEndpointHandle { + + bool is_valid() const; + ++ explicit operator bool() const { return is_valid(); } ++ + // Returns true if the interface hasn't associated with a message pipe. + bool pending_association() const; + +diff --git a/chromium/mojo/public/cpp/system/handle.h b/chromium/mojo/public/cpp/system/handle.h +index 7c886e8825..c9f9e961db 100644 +--- a/chromium/mojo/public/cpp/system/handle.h ++++ b/chromium/mojo/public/cpp/system/handle.h +@@ -121,7 +121,7 @@ class ScopedHandleBase { + + bool is_valid() const { return handle_.is_valid(); } + +- explicit operator bool() const { return handle_; } ++ explicit operator bool() const { return !!handle_; } + + bool operator==(const ScopedHandleBase& other) const { + 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 @@ +From c2c6c36c4a04816dd1c6815ed4df14b7f3a00d61 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 7 Jul 2017 14:01:12 -0700 +Subject: [PATCH] chromium: musl: sandbox: Define TEMP_FAILURE_RETRY if not + defined + +Musl does not define this Macro + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + chromium/sandbox/linux/suid/sandbox.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/chromium/sandbox/linux/suid/sandbox.c b/chromium/sandbox/linux/suid/sandbox.c +index 66f68ef138..9284d0d4fc 100644 +--- a/chromium/sandbox/linux/suid/sandbox.c ++++ b/chromium/sandbox/linux/suid/sandbox.c +@@ -44,6 +44,15 @@ static bool DropRoot(); + + #define HANDLE_EINTR(x) TEMP_FAILURE_RETRY(x) + ++#ifndef TEMP_FAILURE_RETRY ++# define TEMP_FAILURE_RETRY(expression) \ ++ (__extension__ \ ++ ({ long int __result; \ ++ do __result = (long int) (expression); \ ++ while (__result == -1L && errno == EINTR); \ ++ __result; })) ++#endif ++ + static void FatalError(const char* msg, ...) + __attribute__((noreturn, format(printf, 1, 2))); + 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 @@ +From 79365295aa98d6e40aff1493febd1725caff0893 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 7 Jul 2017 14:09:06 -0700 +Subject: [PATCH] chromium: musl: Avoid mallinfo() APIs on non-glibc/linux + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + chromium/base/process/process_metrics_posix.cc | 4 ++-- + chromium/base/trace_event/malloc_dump_provider.cc | 3 ++- + chromium/content/child/content_child_helpers.cc | 2 +- + 3 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/chromium/base/process/process_metrics_posix.cc b/chromium/base/process/process_metrics_posix.cc +index 73a52d6210..4867198a50 100644 +--- a/chromium/base/process/process_metrics_posix.cc ++++ b/chromium/base/process/process_metrics_posix.cc +@@ -94,14 +94,14 @@ size_t ProcessMetrics::GetMallocUsage() { + malloc_statistics_t stats = {0}; + malloc_zone_statistics(nullptr, &stats); + return stats.size_in_use; +-#elif defined(OS_LINUX) || defined(OS_ANDROID) ++#elif defined(__GLIBC__) || defined(OS_ANDROID) + struct mallinfo minfo = mallinfo(); + #if defined(USE_TCMALLOC) + return minfo.uordblks; + #else + return minfo.hblkhd + minfo.arena; + #endif +-#elif defined(OS_FUCHSIA) ++#else + // TODO(fuchsia): Not currently exposed. https://crbug.com/735087. + return 0; + #endif +diff --git a/chromium/base/trace_event/malloc_dump_provider.cc b/chromium/base/trace_event/malloc_dump_provider.cc +index ffd519133c..0c9131e98e 100644 +--- a/chromium/base/trace_event/malloc_dump_provider.cc ++++ b/chromium/base/trace_event/malloc_dump_provider.cc +@@ -197,6 +197,7 @@ MallocDumpProvider::~MallocDumpProvider() = default; + // the current process. + bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args, + ProcessMemoryDump* pmd) { ++#if defined(__GLIBC__) + { + base::AutoLock auto_lock(emit_metrics_on_memory_dump_lock_); + if (!emit_metrics_on_memory_dump_) +@@ -322,7 +323,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args, + pmd->DumpHeapUsage(metrics_by_context, overhead, "malloc"); + } + tid_dumping_heap_ = kInvalidThreadId; +- ++#endif // __GLIBC__ + return true; + } + +diff --git a/chromium/content/child/content_child_helpers.cc b/chromium/content/child/content_child_helpers.cc +index 7ddeb4d16a..b8c73b09c5 100644 +--- a/chromium/content/child/content_child_helpers.cc ++++ b/chromium/content/child/content_child_helpers.cc +@@ -25,7 +25,7 @@ namespace content { + // 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_ANDROID) + size_t GetMemoryUsageKB() { + struct mallinfo minfo = mallinfo(); + 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 @@ +From 7eaf0542be69e41d5dbb013a09ebc0f8c413d688 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 7 Jul 2017 14:37:49 -0700 +Subject: [PATCH] chromium: musl: include fcntl.h for loff_t + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + .../tcmalloc/chromium/src/base/linux_syscall_support.h | 1 + + 1 file changed, 1 insertion(+) + +diff --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 +index b29ec2d29a..91f77dd88d 100644 +--- a/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h ++++ b/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h +@@ -150,6 +150,7 @@ extern "C" { + #include <stddef.h> + #include <stdint.h> + #include <string.h> ++#include <fcntl.h> + #include <sys/ptrace.h> + #include <sys/resource.h> + #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 @@ +From 3896238d9c177c216ffcac111feb36a622da8cf0 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 7 Jul 2017 14:38:37 -0700 +Subject: [PATCH] chromium: musl: use off64_t instead of the internal __off64_t + +- only do the glibc 32-bit ABI check for mmap/mmap64 on gnu libc. musl + does not support the 32-bit ABI. + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + .../tcmalloc/chromium/src/malloc_hook_mmap_linux.h | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --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 +index 715c045f66..edc8cf2db7 100644 +--- a/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h ++++ b/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h +@@ -77,7 +77,7 @@ typedef off64_t __off64_t; + + static inline void* do_mmap64(void *start, size_t length, + int prot, int flags, +- int fd, __off64_t offset) __THROW { ++ int fd, off64_t offset) __THROW { + // The original gperftools uses sys_mmap() here. But, it is not allowed by + // Chromium's sandbox. + return (void *)syscall(SYS_mmap, start, length, prot, flags, fd, offset); +@@ -90,7 +90,7 @@ static inline void* do_mmap64(void *start, size_t length, + + static inline void* do_mmap64(void *start, size_t length, + int prot, int flags, +- int fd, __off64_t offset) __THROW { ++ int fd, off64_t offset) __THROW { + void *result; + + // Try mmap2() unless it's not supported +@@ -161,7 +161,7 @@ static inline void* do_mmap64(void *start, size_t length, + + extern "C" { + void* mmap64(void *start, size_t length, int prot, int flags, +- int fd, __off64_t offset ) __THROW ++ int fd, off64_t offset ) __THROW + ATTRIBUTE_SECTION(malloc_hook); + void* mmap(void *start, size_t length,int prot, int flags, + int fd, off_t offset) __THROW +@@ -178,7 +178,7 @@ extern "C" { + } + + extern "C" void* mmap64(void *start, size_t length, int prot, int flags, +- int fd, __off64_t offset) __THROW { ++ int fd, off64_t offset) __THROW { + MallocHook::InvokePreMmapHook(start, length, prot, flags, fd, offset); + void *result; + if (!MallocHook::InvokeMmapReplacement( +@@ -189,7 +189,7 @@ extern "C" void* mmap64(void *start, size_t length, int prot, int flags, + return result; + } + +-# if !defined(__USE_FILE_OFFSET64) || !defined(__REDIRECT_NTH) ++# if defined(__GLIBC__) && (!defined(__USE_FILE_OFFSET64) || !defined(__REDIRECT_NTH)) + + extern "C" void* mmap(void *start, size_t length, int prot, int flags, + 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 @@ +From 7c63f8cbe68a241d5e4c82f96286c125be3035e6 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 7 Jul 2017 14:54:38 -0700 +Subject: [PATCH] chromium: musl: linux != glibc, make the distinction + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + chromium/base/allocator/allocator_check.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chromium/base/allocator/allocator_check.cc b/chromium/base/allocator/allocator_check.cc +index 9cd5d2207d..1e70095648 100644 +--- a/chromium/base/allocator/allocator_check.cc ++++ b/chromium/base/allocator/allocator_check.cc +@@ -27,7 +27,7 @@ bool IsAllocatorInitialized() { + // Set by allocator_shim_override_ucrt_symbols_win.h when the + // shimmed _set_new_mode() is called. + return g_is_win_shim_layer_initialized; +-#elif defined(OS_LINUX) && defined(USE_TCMALLOC) && \ ++#elif defined(__GLIBC__) && defined(USE_TCMALLOC) && \ + !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) + // From third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h. + // 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 @@ +From 2feb363e9a5e256c68b2f3c0207d9d057a51440f Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 7 Jul 2017 15:09:02 -0700 +Subject: [PATCH] chromium: musl: allocator: Do not include glibc_weak_symbols + for musl + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + chromium/base/allocator/allocator_shim.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chromium/base/allocator/allocator_shim.cc b/chromium/base/allocator/allocator_shim.cc +index 4b7de5e1a3..fe565223f2 100644 +--- a/chromium/base/allocator/allocator_shim.cc ++++ b/chromium/base/allocator/allocator_shim.cc +@@ -302,7 +302,7 @@ ALWAYS_INLINE void ShimFreeDefiniteSize(void* ptr, size_t size, void* context) { + // In the case of tcmalloc we also want to plumb into the glibc hooks + // to avoid that allocations made in glibc itself (e.g., strdup()) get + // accidentally performed on the glibc heap instead of the tcmalloc one. +-#if defined(USE_TCMALLOC) ++#if defined(USE_TCMALLOC) && defined(__GLIBC__) + #include "base/allocator/allocator_shim_override_glibc_weak_symbols.h" + #endif + 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 @@ +From d1ca892f6547403bcb11449565796aaa5a29b2ee Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 7 Jul 2017 15:12:39 -0700 +Subject: [PATCH] chromium: musl: Use correct member name __si_fields from + LinuxSigInfo + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + chromium/sandbox/linux/seccomp-bpf/trap.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chromium/sandbox/linux/seccomp-bpf/trap.cc b/chromium/sandbox/linux/seccomp-bpf/trap.cc +index 003708d2c8..0fef3148f9 100644 +--- a/chromium/sandbox/linux/seccomp-bpf/trap.cc ++++ b/chromium/sandbox/linux/seccomp-bpf/trap.cc +@@ -168,7 +168,7 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) { + // most versions of glibc don't include this information in siginfo_t. So, + // we need to explicitly copy it into a arch_sigsys structure. + struct arch_sigsys sigsys; +- memcpy(&sigsys, &info->_sifields, sizeof(sigsys)); ++ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys)); + + #if defined(__mips__) + // 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 @@ +From b27f5caada6437f0dcec1c616c290fdf9e95d1f8 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 7 Jul 2017 15:27:50 -0700 +Subject: [PATCH] chromium: musl: Define res_ninit and res_nclose for non-glibc + platforms + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + chromium/net/dns/dns_config_service_posix.cc | 4 +++ + chromium/net/dns/dns_reloader.cc | 4 +++ + chromium/net/dns/resolv_compat.h | 29 ++++++++++++++++++++ + 3 files changed, 37 insertions(+) + create mode 100644 chromium/net/dns/resolv_compat.h + +diff --git a/chromium/net/dns/dns_config_service_posix.cc b/chromium/net/dns/dns_config_service_posix.cc +index f2e66331e3..6fe84dd66a 100644 +--- a/chromium/net/dns/dns_config_service_posix.cc ++++ b/chromium/net/dns/dns_config_service_posix.cc +@@ -27,6 +27,10 @@ + #include "net/dns/notify_watcher_mac.h" + #include "net/dns/serial_worker.h" + ++#if defined(OS_LINUX) && !defined(__GLIBC__) ++#include "net/dns/resolv_compat.h" ++#endif ++ + #if defined(OS_MACOSX) && !defined(OS_IOS) + #include "net/dns/dns_config_watcher_mac.h" + #endif +diff --git a/chromium/net/dns/dns_reloader.cc b/chromium/net/dns/dns_reloader.cc +index 322c8a5f0f..72ff40dbe1 100644 +--- a/chromium/net/dns/dns_reloader.cc ++++ b/chromium/net/dns/dns_reloader.cc +@@ -9,6 +9,10 @@ + + #include <resolv.h> + ++#if defined(OS_LINUX) && !defined(__GLIBC__) ++#include "net/dns/resolv_compat.h" ++#endif ++ + #include "base/lazy_instance.h" + #include "base/logging.h" + #include "base/macros.h" +diff --git a/chromium/net/dns/resolv_compat.h b/chromium/net/dns/resolv_compat.h +new file mode 100644 +index 0000000000..4f0e852a19 +--- /dev/null ++++ b/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/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 @@ +From 81439c06b19c58a34a5fd3fc2a391561b4120b5e Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 7 Jul 2017 15:39:57 -0700 +Subject: [PATCH] chromium: musl: Do not define __sbrk on musl + +musl libc does not have sbrk. on musl libc will only work when called with 0 as +argument, so we just let it out for now + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + .../third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --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 +index edc8cf2db7..a868b50d30 100644 +--- a/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h ++++ b/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h +@@ -233,7 +233,7 @@ extern "C" void* mremap(void* old_addr, size_t old_size, size_t new_size, + } + + // Don't hook sbrk() in Android, since it doesn't expose __sbrk. +-#if !defined(__ANDROID__) ++#if !defined(__ANDROID__) && defined(__GLIBC__) + // libc's version: + extern "C" void* __sbrk(ptrdiff_t increment); + 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 @@ +From f3a917e4f78f49742e53c2a9d5a4b289159546d0 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 7 Jul 2017 16:41:23 -0700 +Subject: [PATCH] chromium: musl: Adjust default pthread stack size + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + chromium/base/threading/platform_thread_linux.cc | 3 ++- + chromium/third_party/WebKit/Source/platform/wtf/StackUtil.cpp | 4 ++-- + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/chromium/base/threading/platform_thread_linux.cc b/chromium/base/threading/platform_thread_linux.cc +index 9917a7b1fd..cb406659b9 100644 +--- a/chromium/base/threading/platform_thread_linux.cc ++++ b/chromium/base/threading/platform_thread_linux.cc +@@ -173,7 +173,8 @@ void TerminateOnThread() {} + + size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) { + #if !defined(THREAD_SANITIZER) +- return 0; ++ // use 8mb like glibc to avoid running out of space ++ return (1 << 23); + #else + // ThreadSanitizer bloats the stack heavily. Evidence has been that the + // default stack size isn't enough for some browser tests. +diff --git a/chromium/third_party/WebKit/Source/platform/wtf/StackUtil.cpp b/chromium/third_party/WebKit/Source/platform/wtf/StackUtil.cpp +index 13c3f907f8..07308e0835 100644 +--- a/chromium/third_party/WebKit/Source/platform/wtf/StackUtil.cpp ++++ b/chromium/third_party/WebKit/Source/platform/wtf/StackUtil.cpp +@@ -28,7 +28,7 @@ size_t GetUnderestimatedStackSize() { + // 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 @@ size_t GetUnderestimatedStackSize() { + } + + 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/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 @@ +From 5924e39e96f891c1fa7239d91507b2a48d5c47b2 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 7 Jul 2017 17:15:34 -0700 +Subject: [PATCH] chromium: musl: include asm-generic/ioctl.h for TCGETS2 + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + chromium/device/serial/serial_io_handler_posix.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/chromium/device/serial/serial_io_handler_posix.cc b/chromium/device/serial/serial_io_handler_posix.cc +index d6ed5e1f88..b550f895ef 100644 +--- a/chromium/device/serial/serial_io_handler_posix.cc ++++ b/chromium/device/serial/serial_io_handler_posix.cc +@@ -6,6 +6,7 @@ + + #include <sys/ioctl.h> + #include <termios.h> ++#include <asm-generic/ioctls.h> + + #include "base/files/file_util.h" + #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 @@ +From af1843ce7883c1ff6f686089540eac5ee9541c3b Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 8 Jul 2017 09:08:23 -0700 +Subject: [PATCH] chromium: musl: tcmalloc: Use off64_t insread of __off64_t + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + .../tcmalloc/chromium/src/base/linux_syscall_support.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --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 +index 91f77dd88d..bb84a0b305 100644 +--- a/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h ++++ b/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h +@@ -1929,7 +1929,7 @@ typedef unsigned long int ulong; + #if defined(__x86_64__) + /* Need to make sure __off64_t isn't truncated to 32-bits under x32. */ + LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d, +- __off64_t o) { ++ off64_t o) { + LSS_BODY(6, void*, mmap, LSS_SYSCALL_ARG(s), LSS_SYSCALL_ARG(l), + LSS_SYSCALL_ARG(p), LSS_SYSCALL_ARG(f), + LSS_SYSCALL_ARG(d), (uint64_t)(o)); |