Add qtwebengine & qtwebchannel from luna work (#999)
This commit is contained in:
parent
b62a89e63e
commit
6792641fd1
54 changed files with 4568 additions and 0 deletions
|
@ -0,0 +1,63 @@
|
|||
From d559da6ab0834aeb7307008015b6232e586fea00 Mon Sep 17 00:00:00 2001
|
||||
From: Cleiton Bueno <cleitonrbueno@gmail.com>
|
||||
Date: Thu, 24 Dec 2015 12:46:58 -0200
|
||||
Subject: [PATCH] chromium: Change false to FALSE and 1 to TRUE, FIX
|
||||
qtwebengine compile
|
||||
|
||||
Signed-off-by: Cleiton Bueno <cleitonrbueno@gmail.com>
|
||||
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
|
||||
---
|
||||
chromium/ui/gfx/codec/jpeg_codec.cc | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc b/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
|
||||
index 6d926378be..738d3fdedf 100644
|
||||
--- a/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
|
||||
+++ b/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
|
||||
@@ -121,7 +121,7 @@ boolean EmptyOutputBuffer(jpeg_compress_struct* cinfo) {
|
||||
// tell libjpeg where to write the next data
|
||||
cinfo->dest->next_output_byte = &(*state->out)[state->image_buffer_used];
|
||||
cinfo->dest->free_in_buffer = state->out->size() - state->image_buffer_used;
|
||||
- return 1;
|
||||
+ return TRUE;
|
||||
}
|
||||
|
||||
// Cleans up the JpegEncoderState to prepare for returning in the final form.
|
||||
@@ -262,7 +262,7 @@ bool JPEGCodec::Encode(const unsigned char* input, ColorFormat format,
|
||||
cinfo.data_precision = 8;
|
||||
|
||||
jpeg_set_defaults(&cinfo);
|
||||
- jpeg_set_quality(&cinfo, quality, 1); // quality here is 0-100
|
||||
+ jpeg_set_quality(&cinfo, quality, TRUE); // quality here is 0-100
|
||||
|
||||
// set up the destination manager
|
||||
jpeg_destination_mgr destmgr;
|
||||
@@ -274,7 +274,7 @@ bool JPEGCodec::Encode(const unsigned char* input, ColorFormat format,
|
||||
JpegEncoderState state(output);
|
||||
cinfo.client_data = &state;
|
||||
|
||||
- jpeg_start_compress(&cinfo, 1);
|
||||
+ jpeg_start_compress(&cinfo, TRUE);
|
||||
|
||||
// feed it the rows, doing necessary conversions for the color format
|
||||
#ifdef JCS_EXTENSIONS
|
||||
@@ -360,7 +360,7 @@ void InitSource(j_decompress_ptr cinfo) {
|
||||
// set to a positive value if TRUE is returned. A FALSE return should only
|
||||
// be used when I/O suspension is desired."
|
||||
boolean FillInputBuffer(j_decompress_ptr cinfo) {
|
||||
- return false;
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
// Skip data in the buffer. Since we have all the data at once, this operation
|
||||
@@ -488,8 +488,8 @@ bool JPEGCodec::Decode(const unsigned char* input, size_t input_size,
|
||||
cinfo.client_data = &state;
|
||||
|
||||
// fill the file metadata into our buffer
|
||||
- if (jpeg_read_header(&cinfo, true) != JPEG_HEADER_OK)
|
||||
- return false;
|
||||
+ if (jpeg_read_header(&cinfo, TRUE) != JPEG_HEADER_OK)
|
||||
+ return FALSE;
|
||||
|
||||
// we want to always get RGB data out
|
||||
switch (cinfo.jpeg_color_space) {
|
|
@ -0,0 +1,30 @@
|
|||
From 96746f09947cc36f6c9fc8631bc6a6e7f59efe24 Mon Sep 17 00:00:00 2001
|
||||
From: Frieder Schrempf <frieder.schrempf@online.de>
|
||||
Date: Mon, 1 Dec 2014 14:34:40 +0000
|
||||
Subject: [PATCH] functions.prf: allow build for linux-oe-g++ platform
|
||||
|
||||
Upstream-Status: Inappropriate [OE specific]
|
||||
|
||||
Signed-off-by: Frieder Schrempf <frieder.schrempf@online.de>
|
||||
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
|
||||
---
|
||||
mkspecs/features/functions.prf | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf
|
||||
index 56894e58..ef418a4c 100644
|
||||
--- a/mkspecs/features/functions.prf
|
||||
+++ b/mkspecs/features/functions.prf
|
||||
@@ -21,6 +21,12 @@ defineTest(isPlatformSupported) {
|
||||
return(false)
|
||||
}
|
||||
gcc:!clang:!isGCCVersionSupported(): return(false)
|
||||
+ } else:linux-oe-g++* {
|
||||
+ !gcc:!clang {
|
||||
+ skipBuild("Qt WebEngine on Linux requires clang or GCC.")
|
||||
+ return(false)
|
||||
+ }
|
||||
+ gcc:!clang:!isGCCVersionSupported(): return(false)
|
||||
} else:win32 {
|
||||
winrt {
|
||||
skipBuild("WinRT is not supported.")
|
|
@ -0,0 +1,23 @@
|
|||
From 06e9e7844ffa2b6985e5fa7a1c475c8a54ca252a Mon Sep 17 00:00:00 2001
|
||||
From: Cleiton Bueno <cleitonrbueno@gmail.com>
|
||||
Date: Fri, 25 Dec 2015 18:16:05 -0200
|
||||
Subject: [PATCH] WebEngine qquickwebengineview_p_p.h add include QColor
|
||||
|
||||
Signed-off-by: Cleiton Bueno <cleitonrbueno@gmail.com>
|
||||
---
|
||||
src/webengine/api/qquickwebengineview_p_p.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
|
||||
index 19ecf5e1..f6f638ee 100644
|
||||
--- a/src/webengine/api/qquickwebengineview_p_p.h
|
||||
+++ b/src/webengine/api/qquickwebengineview_p_p.h
|
||||
@@ -59,6 +59,8 @@
|
||||
#include <QString>
|
||||
#include <QtCore/qcompilerdetection.h>
|
||||
#include <QtGui/qaccessibleobject.h>
|
||||
+#include <QColor>
|
||||
+
|
||||
|
||||
namespace QtWebEngineCore {
|
||||
class WebContentsAdapter;
|
|
@ -0,0 +1,40 @@
|
|||
From a0b1a742813d0846472fab4aada2388bf2d42d80 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 | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py b/src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py
|
||||
index 43d252b43e..e58347848e 100755
|
||||
--- a/src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py
|
||||
+++ b/src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py
|
||||
@@ -298,14 +298,14 @@ def write_gn_ninja(path, root_gen_dir, options):
|
||||
ld = os.environ.get('LD', 'link.exe')
|
||||
ar = os.environ.get('AR', 'lib.exe')
|
||||
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')
|
||||
|
||||
- cflags = os.environ.get('CFLAGS', '').split()
|
||||
- cflags_cc = os.environ.get('CXXFLAGS', '').split()
|
||||
- ldflags = os.environ.get('LDFLAGS', '').split()
|
||||
+ cflags = os.environ.get('CFLAGS_host', '').split()
|
||||
+ cflags_cc = os.environ.get('CXXFLAGS_host', '').split()
|
||||
+ ldflags = os.environ.get('LDFLAGS_host', '').split()
|
||||
include_dirs = [root_gen_dir, SRC_ROOT]
|
||||
libs = []
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
From bfd5e19fea1315d10b3217acaf92dfc32018ad03 Mon Sep 17 00:00:00 2001
|
||||
From: Cleiton Bueno <cleitonrbueno@gmail.com>
|
||||
Date: Thu, 24 Dec 2015 15:59:51 -0200
|
||||
Subject: [PATCH] Include dependency to QCoreApplication::translate()
|
||||
|
||||
Signed-off-by: Cleiton Bueno <cleitonrbueno@gmail.com>
|
||||
---
|
||||
src/core/media_capture_devices_dispatcher.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/core/media_capture_devices_dispatcher.h b/src/core/media_capture_devices_dispatcher.h
|
||||
index c378c327..1d33d956 100644
|
||||
--- a/src/core/media_capture_devices_dispatcher.h
|
||||
+++ b/src/core/media_capture_devices_dispatcher.h
|
||||
@@ -45,6 +45,8 @@
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
||||
+#include <QCoreApplication>
|
||||
+
|
||||
#include "web_contents_adapter_client.h"
|
||||
|
||||
#include "base/callback.h"
|
|
@ -0,0 +1,42 @@
|
|||
From 5c31bc4a7ae6133fe4cb60fa71465c6706a071c8 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/src/3rdparty/chromium/tools/gn/ninja_action_target_writer.cc b/src/3rdparty/chromium/tools/gn/ninja_action_target_writer.cc
|
||||
index a5bc6cd526..5cefbfe77c 100644
|
||||
--- a/src/3rdparty/chromium/tools/gn/ninja_action_target_writer.cc
|
||||
+++ b/src/3rdparty/chromium/tools/gn/ninja_action_target_writer.cc
|
||||
@@ -115,9 +115,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.
|
|
@ -0,0 +1,33 @@
|
|||
From 71b3c3d4160c5e98cc0a0797710bdd121a79e8b8 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/src/3rdparty/chromium/sandbox/linux/suid/sandbox.c b/src/3rdparty/chromium/sandbox/linux/suid/sandbox.c
|
||||
index b655d1c79c..3de34e36f2 100644
|
||||
--- a/src/3rdparty/chromium/sandbox/linux/suid/sandbox.c
|
||||
+++ b/src/3rdparty/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)));
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
From e695f37fc52defd1b96664b003444692e9b6cb65 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/trace_event/malloc_dump_provider.cc | 3 ++-
|
||||
chromium/content/child/content_child_helpers.cc | 2 +-
|
||||
2 files changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc b/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc
|
||||
index 7d0cb57931..10be59ebad 100644
|
||||
--- a/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc
|
||||
+++ b/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc
|
||||
@@ -210,6 +210,7 @@ MallocDumpProvider::~MallocDumpProvider() {}
|
||||
// the current process.
|
||||
bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
|
||||
ProcessMemoryDump* pmd) {
|
||||
+#if defined(__GLIBC__)
|
||||
size_t total_virtual_size = 0;
|
||||
size_t resident_size = 0;
|
||||
size_t allocated_objects_size = 0;
|
||||
@@ -321,7 +322,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/src/3rdparty/chromium/content/child/content_child_helpers.cc b/src/3rdparty/chromium/content/child/content_child_helpers.cc
|
||||
index 7ddeb4d16a..b8c73b09c5 100644
|
||||
--- a/src/3rdparty/chromium/content/child/content_child_helpers.cc
|
||||
+++ b/src/3rdparty/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 =
|
|
@ -0,0 +1,22 @@
|
|||
From ee6aec4439a7ee320d7700d7f10cd3948a73f3e3 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>
|
||||
---
|
||||
chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h b/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
|
||||
index b29ec2d29a..91f77dd88d 100644
|
||||
--- a/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
|
||||
+++ b/src/3rdparty/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>
|
|
@ -0,0 +1,62 @@
|
|||
From 90ebe616e563ab1224234281ea7b1a478f42ca92 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>
|
||||
---
|
||||
.../third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h b/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h
|
||||
index 715c045f66..edc8cf2db7 100644
|
||||
--- a/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h
|
||||
+++ b/src/3rdparty/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 {
|
|
@ -0,0 +1,23 @@
|
|||
From d0621f9278ddd04c05b6ab3ef638be65f96f1bd6 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/src/3rdparty/chromium/base/allocator/allocator_check.cc b/src/3rdparty/chromium/base/allocator/allocator_check.cc
|
||||
index 5a0564d2f3..8c2dc6491d 100644
|
||||
--- a/src/3rdparty/chromium/base/allocator/allocator_check.cc
|
||||
+++ b/src/3rdparty/chromium/base/allocator/allocator_check.cc
|
||||
@@ -21,7 +21,7 @@ bool IsAllocatorInitialized() {
|
||||
#if defined(OS_WIN) && defined(ALLOCATOR_SHIM)
|
||||
// Set by allocator_shim_win.cc 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.
|
|
@ -0,0 +1,24 @@
|
|||
From e8f8e7aa48e97b9b91858ef94f1940464a9178a3 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/src/3rdparty/chromium/base/allocator/allocator_shim.cc b/src/3rdparty/chromium/base/allocator/allocator_shim.cc
|
||||
index 95480ea4b6..1de3d1a532 100644
|
||||
--- a/src/3rdparty/chromium/base/allocator/allocator_shim.cc
|
||||
+++ b/src/3rdparty/chromium/base/allocator/allocator_shim.cc
|
||||
@@ -266,7 +266,7 @@ void ShimFree(void* address) {
|
||||
// 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
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
From ab272bfc9aef6d50c44e1c1bdfdb8a325aebaefc 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/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
|
||||
index 003708d2c8..0fef3148f9 100644
|
||||
--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
|
||||
+++ b/src/3rdparty/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
|
|
@ -0,0 +1,44 @@
|
|||
From bd3d6bd46e792e312435897e925cca5ccedc1dda Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 7 Jul 2017 15:24:49 -0700
|
||||
Subject: [PATCH] chromium: musl: Match syscalls to match musl
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
chromium/third_party/lss/linux_syscall_support.h | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
diff --git a/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h b/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
|
||||
index 9dbd2391b2..a715de177c 100644
|
||||
--- a/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
|
||||
+++ b/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
|
||||
@@ -793,6 +793,14 @@ struct kernel_statfs {
|
||||
#endif
|
||||
|
||||
|
||||
+#undef stat64
|
||||
+#undef fstat64
|
||||
+
|
||||
+#ifndef __NR_fstatat
|
||||
+#define __NR_fstatat __NR_fstatat64
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
#if defined(__x86_64__)
|
||||
#ifndef ARCH_SET_GS
|
||||
#define ARCH_SET_GS 0x1001
|
||||
@@ -1210,6 +1218,14 @@ struct kernel_statfs {
|
||||
#ifndef __NR_fallocate
|
||||
#define __NR_fallocate 285
|
||||
#endif
|
||||
+
|
||||
+#ifndef __NR_pread
|
||||
+#define __NR_pread __NR_pread64
|
||||
+#endif
|
||||
+#ifndef __NR_pwrite
|
||||
+#define __NR_pwrite __NR_pwrite64
|
||||
+#endif
|
||||
+
|
||||
/* End of x86-64 definitions */
|
||||
#elif defined(__mips__)
|
||||
#if _MIPS_SIM == _MIPS_SIM_ABI32
|
|
@ -0,0 +1,79 @@
|
|||
From 505fcfa52c49c9975e63066f631244ace6061d3c 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/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc b/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc
|
||||
index ba8a369133..e9b40d07fc 100644
|
||||
--- a/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc
|
||||
+++ b/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc
|
||||
@@ -25,6 +25,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/src/3rdparty/chromium/net/dns/dns_reloader.cc b/src/3rdparty/chromium/net/dns/dns_reloader.cc
|
||||
index 74534e6b1b..2780a776e4 100644
|
||||
--- a/src/3rdparty/chromium/net/dns/dns_reloader.cc
|
||||
+++ b/src/3rdparty/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/src/3rdparty/chromium/net/dns/resolv_compat.h b/src/3rdparty/chromium/net/dns/resolv_compat.h
|
||||
new file mode 100644
|
||||
index 0000000000..4f0e852a19
|
||||
--- /dev/null
|
||||
+++ b/src/3rdparty/chromium/net/dns/resolv_compat.h
|
||||
@@ -0,0 +1,29 @@
|
||||
+#if !defined(__GLIBC__)
|
||||
+/***************************************************************************
|
||||
+ * resolv_compat.h
|
||||
+ *
|
||||
+ * Mimick GLIBC's res_ninit() and res_nclose() for musl libc
|
||||
+ * Note: res_init() is actually deprecated according to
|
||||
+ * http://docs.oracle.com/cd/E36784_01/html/E36875/res-nclose-3resolv.html
|
||||
+ **************************************************************************/
|
||||
+#include <string.h>
|
||||
+
|
||||
+static inline int res_ninit(res_state statp)
|
||||
+{
|
||||
+ int rc = res_init();
|
||||
+ if (statp != &_res) {
|
||||
+ memcpy(statp, &_res, sizeof(*statp));
|
||||
+ }
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+static inline int res_nclose(res_state statp)
|
||||
+{
|
||||
+ if (!statp)
|
||||
+ return -1;
|
||||
+ if (statp != &_res) {
|
||||
+ memset(statp, 0, sizeof(*statp));
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+#endif
|
|
@ -0,0 +1,26 @@
|
|||
From e4d5b6ccd77506edb7d52f3857c4a5f22bea2437 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>
|
||||
---
|
||||
chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h b/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h
|
||||
index edc8cf2db7..a868b50d30 100644
|
||||
--- a/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/malloc_hook_mmap_linux.h
|
||||
+++ b/src/3rdparty/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);
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
From 72a77c994434ecb708b2790ba9efaf1decc02503 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/heap/StackFrameDepth.cpp | 4 ++--
|
||||
2 files changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/3rdparty/chromium/base/threading/platform_thread_linux.cc b/src/3rdparty/chromium/base/threading/platform_thread_linux.cc
|
||||
index 92fbda5ee1..c41579d4ed 100644
|
||||
--- a/src/3rdparty/chromium/base/threading/platform_thread_linux.cc
|
||||
+++ b/src/3rdparty/chromium/base/threading/platform_thread_linux.cc
|
||||
@@ -175,7 +175,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/src/3rdparty/chromium/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp b/src/3rdparty/chromium/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
|
||||
index 1d164f510a..3358deb256 100644
|
||||
--- a/src/3rdparty/chromium/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
|
||||
+++ b/src/3rdparty/chromium/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
|
||||
@@ -68,7 +68,7 @@ size_t StackFrameDepth::getUnderestimatedStackSize() {
|
||||
// FIXME: On Mac OSX and Linux, this method cannot estimate stack size
|
||||
// correctly for the main thread.
|
||||
|
||||
-#if defined(__GLIBC__) || OS(ANDROID) || OS(FREEBSD)
|
||||
+#if OS(LINUX) || OS(ANDROID) || OS(FREEBSD)
|
||||
// pthread_getattr_np() can fail if the thread is not invoked by
|
||||
// pthread_create() (e.g., the main thread of webkit_unit_tests).
|
||||
// If so, a conservative size estimate is returned.
|
||||
@@ -135,7 +135,7 @@ size_t StackFrameDepth::getUnderestimatedStackSize() {
|
||||
}
|
||||
|
||||
void* StackFrameDepth::getStackStart() {
|
||||
-#if defined(__GLIBC__) || OS(ANDROID) || OS(FREEBSD)
|
||||
+#if OS(LINUX) || OS(ANDROID) || OS(FREEBSD)
|
||||
pthread_attr_t attr;
|
||||
int error;
|
||||
#if OS(FREEBSD)
|
|
@ -0,0 +1,22 @@
|
|||
From f2e66acda4934e4c0f56a58ba107cc208f09b7ef 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/src/3rdparty/chromium/device/serial/serial_io_handler_posix.cc b/src/3rdparty/chromium/device/serial/serial_io_handler_posix.cc
|
||||
index a2ca2e2309..e139cdf9e9 100644
|
||||
--- a/src/3rdparty/chromium/device/serial/serial_io_handler_posix.cc
|
||||
+++ b/src/3rdparty/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"
|
|
@ -0,0 +1,23 @@
|
|||
From 2141914268b26507d52cc7541cf268478ddc0bdf 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>
|
||||
---
|
||||
chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h b/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
|
||||
index 91f77dd88d..bb84a0b305 100644
|
||||
--- a/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h
|
||||
+++ b/src/3rdparty/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));
|
62
main/qt5-qtwebengine/patches-musl/gn_bootstrap.patch
Normal file
62
main/qt5-qtwebengine/patches-musl/gn_bootstrap.patch
Normal file
|
@ -0,0 +1,62 @@
|
|||
diff --git a/src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py b/src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py
|
||||
index 43d252b..e74b23f 100755
|
||||
--- a/src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py
|
||||
+++ b/src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py
|
||||
@@ -20,6 +20,7 @@ import errno
|
||||
import logging
|
||||
import optparse
|
||||
import os
|
||||
+import platform
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -31,6 +32,7 @@ SRC_ROOT = os.path.dirname(os.path.dirname(GN_ROOT))
|
||||
|
||||
is_win = sys.platform.startswith('win')
|
||||
is_linux = sys.platform.startswith('linux')
|
||||
+is_gnu_linux = is_linux and platform.libc_ver()[0].startswith('glibc')
|
||||
is_mac = sys.platform.startswith('darwin')
|
||||
is_posix = is_linux or is_mac
|
||||
|
||||
@@ -168,7 +170,7 @@ def build_gn_with_ninja_manually(tempdir, options):
|
||||
mkdir_p(root_gen_dir)
|
||||
|
||||
write_buildflag_header_manually(root_gen_dir, 'base/allocator/features.h',
|
||||
- {'USE_EXPERIMENTAL_ALLOCATOR_SHIM': 'true' if is_linux else 'false'})
|
||||
+ {'USE_EXPERIMENTAL_ALLOCATOR_SHIM': 'true' if is_gnu_linux else 'false'})
|
||||
|
||||
write_buildflag_header_manually(root_gen_dir, 'base/debug/debugging_flags.h',
|
||||
{'ENABLE_PROFILING': 'false'})
|
||||
@@ -377,8 +379,6 @@ def write_gn_ninja(path, root_gen_dir, options):
|
||||
'base/third_party/superfasthash/superfasthash.c',
|
||||
])
|
||||
static_libraries['base']['sources'].extend([
|
||||
- 'base/allocator/allocator_check.cc',
|
||||
- 'base/allocator/allocator_extension.cc',
|
||||
'base/at_exit.cc',
|
||||
'base/base_paths.cc',
|
||||
'base/base_switches.cc',
|
||||
@@ -421,6 +421,7 @@ def write_gn_ninja(path, root_gen_dir, options):
|
||||
'base/metrics/histogram.cc',
|
||||
'base/metrics/histogram_base.cc',
|
||||
'base/metrics/histogram_samples.cc',
|
||||
+ 'base/metrics/histogram_snapshot_manager.cc',
|
||||
'base/metrics/metrics_hashes.cc',
|
||||
'base/metrics/persistent_histogram_allocator.cc',
|
||||
'base/metrics/persistent_memory_allocator.cc',
|
||||
@@ -584,9 +585,13 @@ def write_gn_ninja(path, root_gen_dir, options):
|
||||
],
|
||||
'tool': 'cxx',
|
||||
}
|
||||
+
|
||||
+ if is_gnu_linux:
|
||||
+ static_libraries['base']['sources'].extend([
|
||||
+ 'base/allocator/allocator_shim.cc',
|
||||
+ 'base/allocator/allocator_shim_default_dispatch_to_glibc.cc'
|
||||
+ ])
|
||||
static_libraries['base']['sources'].extend([
|
||||
- 'base/allocator/allocator_shim.cc',
|
||||
- 'base/allocator/allocator_shim_default_dispatch_to_glibc.cc',
|
||||
'base/memory/shared_memory_posix.cc',
|
||||
'base/nix/xdg_util.cc',
|
||||
'base/process/internal_linux.cc',
|
13
main/qt5-qtwebengine/patches-musl/no-pvalloc.patch
Normal file
13
main/qt5-qtwebengine/patches-musl/no-pvalloc.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
diff --git a/src/core/api/qtbug-61521.cpp b/src/core/api/qtbug-61521.cpp
|
||||
index 708fcde..13b80a2 100644
|
||||
--- a/src/core/api/qtbug-61521.cpp
|
||||
+++ b/src/core/api/qtbug-61521.cpp
|
||||
@@ -111,7 +111,7 @@ SHIM_HIDDEN void* ShimValloc(size_t size) {
|
||||
}
|
||||
|
||||
SHIM_HIDDEN void* ShimPvalloc(size_t size) {
|
||||
- return pvalloc(size);
|
||||
+ return malloc(size);
|
||||
}
|
||||
|
||||
SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) {
|
193
main/qt5-qtwebengine/patches-musl/no_execinfo.patch
Normal file
193
main/qt5-qtwebengine/patches-musl/no_execinfo.patch
Normal file
|
@ -0,0 +1,193 @@
|
|||
diff -Naur a/src/3rdparty/chromium/base/debug/leak_tracker.h b/src/3rdparty/chromium/base/debug/leak_tracker.h
|
||||
--- a/src/3rdparty/chromium/base/debug/leak_tracker.h 2016-12-04 17:37:29.096306764 -0800
|
||||
+++ b/src/3rdparty/chromium/base/debug/leak_tracker.h 2016-12-04 17:48:46.224517026 -0800
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "build/build_config.h"
|
||||
|
||||
// Only enable leak tracking in non-uClibc debug builds.
|
||||
-#if !defined(NDEBUG) && !defined(__UCLIBC__)
|
||||
+#if !defined(NDEBUG) && defined(HAVE_BACKTRACE)
|
||||
#define ENABLE_LEAK_TRACKER
|
||||
#endif
|
||||
|
||||
diff -Naur a/src/3rdparty/chromium/base/debug/stack_trace.cc b/src/3rdparty/chromium/base/debug/stack_trace.cc
|
||||
--- a/src/3rdparty/chromium/base/debug/stack_trace.cc 2016-12-04 17:37:29.096306764 -0800
|
||||
+++ b/src/3rdparty/chromium/base/debug/stack_trace.cc 2016-12-04 17:49:03.734703480 -0800
|
||||
@@ -199,7 +199,7 @@
|
||||
|
||||
std::string StackTrace::ToString() const {
|
||||
std::stringstream stream;
|
||||
-#if !defined(__UCLIBC__)
|
||||
+#if defined(HAVE_BACKTRACE)
|
||||
OutputToStream(&stream);
|
||||
#endif
|
||||
return stream.str();
|
||||
diff -Naur a/src/3rdparty/chromium/base/debug/stack_trace.h b/src/3rdparty/chromium/base/debug/stack_trace.h
|
||||
--- a/src/3rdparty/chromium/base/debug/stack_trace.h 2016-12-04 17:37:29.094306742 -0800
|
||||
+++ b/src/3rdparty/chromium/base/debug/stack_trace.h 2016-12-04 17:49:21.906896983 -0800
|
||||
@@ -76,7 +76,7 @@
|
||||
// Prints the stack trace to stderr.
|
||||
void Print() const;
|
||||
|
||||
-#if !defined(__UCLIBC__)
|
||||
+#if defined(HAVE_BACKTRACE)
|
||||
// Resolves backtrace to symbols and write to stream.
|
||||
void OutputToStream(std::ostream* os) const;
|
||||
#endif
|
||||
diff -Naur a/src/3rdparty/chromium/base/debug/stack_trace_posix.cc b/src/3rdparty/chromium/base/debug/stack_trace_posix.cc
|
||||
--- a/src/3rdparty/chromium/base/debug/stack_trace_posix.cc 2016-12-04 17:37:29.104306849 -0800
|
||||
+++ b/src/3rdparty/chromium/base/debug/stack_trace_posix.cc 2016-12-04 17:51:03.367977370 -0800
|
||||
@@ -25,7 +25,7 @@
|
||||
#if defined(__GLIBCXX__)
|
||||
#include <cxxabi.h>
|
||||
#endif
|
||||
-#if !defined(__UCLIBC__)
|
||||
+#if defined(HAVE_BACKTRACE)
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
// Note: code in this function is NOT async-signal safe (std::string uses
|
||||
// malloc internally).
|
||||
|
||||
-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
|
||||
+#if defined(__GLIBCXX__) && defined(HAVE_BACKTRACE)
|
||||
|
||||
std::string::size_type search_from = 0;
|
||||
while (search_from < text->size()) {
|
||||
@@ -113,7 +113,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
-#endif // defined(__GLIBCXX__) && !defined(__UCLIBC__)
|
||||
+#endif // defined(__GLIBCXX__) && defined(HAVE_BACKTRACE)
|
||||
}
|
||||
#endif // !defined(USE_SYMBOLIZE)
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
virtual ~BacktraceOutputHandler() {}
|
||||
};
|
||||
|
||||
-#if !defined(__UCLIBC__)
|
||||
+#if defined(HAVE_BACKTRACE)
|
||||
void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
|
||||
// This should be more than enough to store a 64-bit number in hex:
|
||||
// 16 hex digits + 1 for null-terminator.
|
||||
@@ -202,7 +202,7 @@
|
||||
}
|
||||
#endif // defined(USE_SYMBOLIZE)
|
||||
}
|
||||
-#endif // !defined(__UCLIBC__)
|
||||
+#endif // defined(HAVE_BACKTRACE)
|
||||
|
||||
void PrintToStderr(const char* output) {
|
||||
// NOTE: This code MUST be async-signal safe (it's used by in-process
|
||||
@@ -718,7 +718,7 @@
|
||||
// NOTE: This code MUST be async-signal safe (it's used by in-process
|
||||
// stack dumping signal handler). NO malloc or stdio is allowed here.
|
||||
|
||||
-#if !defined(__UCLIBC__)
|
||||
+#if defined(HAVE_BACKTRACE)
|
||||
// Though the backtrace API man page does not list any possible negative
|
||||
// return values, we take no chance.
|
||||
count_ = base::saturated_cast<size_t>(backtrace(trace_, arraysize(trace_)));
|
||||
@@ -731,13 +731,13 @@
|
||||
// NOTE: This code MUST be async-signal safe (it's used by in-process
|
||||
// stack dumping signal handler). NO malloc or stdio is allowed here.
|
||||
|
||||
-#if !defined(__UCLIBC__)
|
||||
+#if defined(HAVE_BACKTRACE)
|
||||
PrintBacktraceOutputHandler handler;
|
||||
ProcessBacktrace(trace_, count_, &handler);
|
||||
#endif
|
||||
}
|
||||
|
||||
-#if !defined(__UCLIBC__)
|
||||
+#if defined(HAVE_BACKTRACE)
|
||||
void StackTrace::OutputToStream(std::ostream* os) const {
|
||||
StreamBacktraceOutputHandler handler(os);
|
||||
ProcessBacktrace(trace_, count_, &handler);
|
||||
diff -Naur a/src/3rdparty/chromium/base/debug/stack_trace_unittest.cc b/src/3rdparty/chromium/base/debug/stack_trace_unittest.cc
|
||||
--- a/src/3rdparty/chromium/base/debug/stack_trace_unittest.cc 2016-12-04 17:37:29.098306785 -0800
|
||||
+++ b/src/3rdparty/chromium/base/debug/stack_trace_unittest.cc 2016-12-04 17:51:31.348275313 -0800
|
||||
@@ -38,7 +38,7 @@
|
||||
#else
|
||||
#define MAYBE_OutputToStream OutputToStream
|
||||
#endif
|
||||
-#if !defined(__UCLIBC__)
|
||||
+#if defined(HAVE_BACKTRACE)
|
||||
TEST_F(StackTraceTest, MAYBE_OutputToStream) {
|
||||
StackTrace trace;
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
TEST_F(StackTraceTest, DebugPrintBacktrace) {
|
||||
StackTrace().Print();
|
||||
}
|
||||
-#endif // !defined(__UCLIBC__)
|
||||
+#endif // defined(HAVE_BACKTRACE)
|
||||
|
||||
#if defined(OS_POSIX) && !defined(OS_ANDROID)
|
||||
#if !defined(OS_IOS)
|
||||
diff -Naur a/src/3rdparty/chromium/base/logging.cc b/src/3rdparty/chromium/base/logging.cc
|
||||
--- a/src/3rdparty/chromium/base/logging.cc 2016-12-04 17:37:29.167307520 -0800
|
||||
+++ b/src/3rdparty/chromium/base/logging.cc 2016-12-04 17:51:58.436563757 -0800
|
||||
@@ -526,7 +526,7 @@
|
||||
}
|
||||
|
||||
LogMessage::~LogMessage() {
|
||||
-#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__)
|
||||
+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(HAVE_BACKTRACE)
|
||||
if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
|
||||
// Include a stack trace on a fatal, unless a debugger is attached.
|
||||
base::debug::StackTrace trace;
|
||||
diff -Naur a/src/3rdparty/chromium/third_party/WebKit/Source/wtf/Assertions.cpp b/src/3rdparty/chromium/third_party/WebKit/Source/wtf/Assertions.cpp
|
||||
--- a/src/3rdparty/chromium/third_party/WebKit/Source/wtf/Assertions.cpp 2016-12-04 17:37:40.112424067 -0800
|
||||
+++ b/src/3rdparty/chromium/third_party/WebKit/Source/wtf/Assertions.cpp 2016-12-04 17:52:44.286051976 -0800
|
||||
@@ -60,7 +60,7 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
-#if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__))
|
||||
+#if OS(MACOSX) || (OS(LINUX) && defined(HAVE_BACKTRACE))
|
||||
#include <cxxabi.h>
|
||||
#include <dlfcn.h>
|
||||
#include <execinfo.h>
|
||||
@@ -164,7 +164,7 @@
|
||||
}
|
||||
|
||||
void WTFGetBacktrace(void** stack, int* size) {
|
||||
-#if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__))
|
||||
+#if OS(MACOSX) || (OS(LINUX) && defined(HAVE_BACKTRACE))
|
||||
*size = backtrace(stack, *size);
|
||||
#elif OS(WIN)
|
||||
// The CaptureStackBackTrace function is available in XP, but it is not
|
||||
@@ -215,7 +215,7 @@
|
||||
};
|
||||
|
||||
FrameToNameScope::FrameToNameScope(void* addr) : m_name(0), m_cxaDemangled(0) {
|
||||
-#if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__))
|
||||
+#if OS(MACOSX) || (OS(LINUX) && defined(HAVE_BACKTRACE))
|
||||
Dl_info info;
|
||||
if (!dladdr(addr, &info) || !info.dli_sname)
|
||||
return;
|
||||
diff -Naur a/src/3rdparty/chromium/third_party/webrtc/base/checks.cc b/src/3rdparty/chromium/third_party/webrtc/base/checks.cc
|
||||
--- a/src/3rdparty/chromium/third_party/webrtc/base/checks.cc 2016-12-04 17:38:06.144701266 -0800
|
||||
+++ b/src/3rdparty/chromium/third_party/webrtc/base/checks.cc 2016-12-04 17:53:19.007413116 -0800
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
|
||||
+#if defined(__GLIBCXX__) && defined(HAVE_BACKTRACE)
|
||||
#include <cxxabi.h>
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
@@ -60,7 +60,7 @@
|
||||
// to get usable symbols on Linux. This is copied from V8. Chromium has a more
|
||||
// advanced stace trace system; also more difficult to copy.
|
||||
void DumpBacktrace() {
|
||||
-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
|
||||
+#if defined(__GLIBCXX__) && defined(HAVE_BACKTRACE)
|
||||
void* trace[100];
|
||||
int size = backtrace(trace, sizeof(trace) / sizeof(*trace));
|
||||
char** symbols = backtrace_symbols(trace, size);
|
|
@ -0,0 +1,64 @@
|
|||
diff --git a/src/3rdparty/chromium/content/renderer/render_thread_impl.cc b/src/3rdparty/chromium/content/renderer/render_thread_impl.cc
|
||||
index 2934f94..05fee20 100644
|
||||
--- a/src/3rdparty/chromium/content/renderer/render_thread_impl.cc
|
||||
+++ b/src/3rdparty/chromium/content/renderer/render_thread_impl.cc
|
||||
@@ -1821,6 +1821,50 @@ static size_t GetMallocUsage() {
|
||||
return stats.size_in_use;
|
||||
}
|
||||
|
||||
+} // namespace
|
||||
+
|
||||
+#elif defined(OS_LINUX) && !defined(__GLIBC__)
|
||||
+namespace {
|
||||
+
|
||||
+static size_t GetMallocUsage() {
|
||||
+ char *line=NULL;
|
||||
+ size_t n,usage=0;
|
||||
+ FILE *f = fopen("/proc/self/maps", "r");
|
||||
+ char *path, *perm;
|
||||
+ if (f == NULL) {
|
||||
+ perror("/proc/self/maps");
|
||||
+ return 0;
|
||||
+ }
|
||||
+ path = (char *)malloc(PATH_MAX+16);
|
||||
+ if (path == NULL)
|
||||
+ goto out;
|
||||
+ perm = path + PATH_MAX;
|
||||
+
|
||||
+ while (getline(&line, &n, f) >=0) {
|
||||
+ size_t start,end,offset,inode;
|
||||
+ int devmaj, devmin, items;
|
||||
+
|
||||
+ items = sscanf(line, "%zx-%zx %s %zx %x:%x %zu %s",
|
||||
+ &start, &end, perm, &offset,
|
||||
+ &devmaj, &devmin, &inode, path);
|
||||
+
|
||||
+ if (items < 7)
|
||||
+ continue;
|
||||
+
|
||||
+ if (items < 8)
|
||||
+ path[0] = '\0';
|
||||
+
|
||||
+ if ((strcmp(perm, "rw-p") == 0 && devmaj+devmin == 0)
|
||||
+ && (path[0] == '\0' || strcmp(path, "[heap]") == 0))
|
||||
+ usage += end-start;
|
||||
+ }
|
||||
+ free(line);
|
||||
+ free(path);
|
||||
+out:
|
||||
+ fclose(f);
|
||||
+ return usage;
|
||||
+}
|
||||
+
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
@@ -1840,7 +1884,7 @@ void RenderThreadImpl::RecordPurgeAndSuspendMetrics() const {
|
||||
blink_stats.partitionAllocTotalAllocatedBytes / 1024);
|
||||
UMA_HISTOGRAM_MEMORY_KB("PurgeAndSuspend.Memory.BlinkGCKB",
|
||||
blink_stats.blinkGCTotalAllocatedBytes / 1024);
|
||||
-#if defined(OS_LINUX) || defined(OS_ANDROID)
|
||||
+#if (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
|
||||
struct mallinfo minfo = mallinfo();
|
||||
#if defined(USE_TCMALLOC)
|
||||
size_t malloc_usage = minfo.uordblks;
|
13
main/qt5-qtwebengine/patches-musl/yasm_intl.patch
Normal file
13
main/qt5-qtwebengine/patches-musl/yasm_intl.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
diff --git a/src/3rdparty/chromium/third_party/yasm/BUILD.gn b/qtwebengine-opensource-src-5.9.1-patched/src/3rdparty/chromium/third_party/yasm/BUILD.gn
|
||||
index 6f49a02..0703793 100644
|
||||
--- a/src/3rdparty/chromium/third_party/yasm/BUILD.gn
|
||||
+++ b/src/3rdparty/chromium/third_party/yasm/BUILD.gn
|
||||
@@ -317,7 +317,7 @@ if (current_toolchain == host_toolchain) {
|
||||
"-pedantic",
|
||||
]
|
||||
}
|
||||
-
|
||||
+ libs = [ "intl" ]
|
||||
# TODO(ajwong): This should take most of the generated output as
|
||||
# inputs.
|
||||
deps = [
|
Loading…
Add table
Add a link
Reference in a new issue