Skip to content

Commit 3bb49f7

Browse files
committed
chromium: Foward port musl patches
Latest update created some conflicts in musl patches. Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 parent bf168be commit 3bb49f7

File tree

3 files changed

+41
-30
lines changed

3 files changed

+41
-30
lines changed

meta-chromium/recipes-browser/chromium/files/musl/0001-mallinfo-implementation-is-glibc-specific.patch

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,22 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
5050
#endif
5151
--- a/base/trace_event/malloc_dump_provider.cc
5252
+++ b/base/trace_event/malloc_dump_provider.cc
53-
@@ -203,7 +203,7 @@ bool MallocDumpProvider::OnMemoryDump(co
54-
&allocated_objects_count);
55-
#elif defined(OS_FUCHSIA)
56-
// TODO(fuchsia): Port, see https://crbug.com/706592.
57-
-#else
58-
+#elif defined(__GLIBC__)
53+
@@ -218,7 +218,6 @@ bool MallocDumpProvider::OnMemoryDump(co
54+
#define MALLINFO2_FOUND_IN_LIBC
55+
struct mallinfo2 info = mallinfo2();
56+
#endif
57+
-#endif // defined(__GLIBC__) && defined(__GLIBC_PREREQ)
58+
#if !defined(MALLINFO2_FOUND_IN_LIBC)
5959
struct mallinfo info = mallinfo();
60-
// In case of Android's jemalloc |arena| is 0 and the outer pages size is
61-
// reported by |hblkhd|. In case of dlmalloc the total is given by
60+
#endif
61+
@@ -231,6 +230,7 @@ bool MallocDumpProvider::OnMemoryDump(co
62+
63+
// Total allocated space is given by |uordblks|.
64+
allocated_objects_size = info.uordblks;
65+
+#endif // defined(__GLIBC__) && defined(__GLIBC_PREREQ)
66+
#endif
67+
68+
MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc");
6269
--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
6370
+++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
6471
@@ -130,7 +130,7 @@

meta-chromium/recipes-browser/chromium/files/musl/0019-adjust-thread-stack-sizes.patch

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
1313
chrome/app/shutdown_signal_handlers_posix.cc | 8 ++++++++
1414
2 files changed, 10 insertions(+), 1 deletion(-)
1515

16-
diff --git a/base/threading/platform_thread_linux.cc b/base/threading/platform_thread_linux.cc
17-
index de2e0c169..53cb90def 100644
1816
--- a/base/threading/platform_thread_linux.cc
1917
+++ b/base/threading/platform_thread_linux.cc
20-
@@ -437,7 +437,8 @@ void TerminateOnThread() {}
18+
@@ -439,7 +439,8 @@ void TerminateOnThread() {}
2119

2220
size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
2321
#if !defined(THREAD_SANITIZER)
@@ -27,10 +25,19 @@ index de2e0c169..53cb90def 100644
2725
#else
2826
// ThreadSanitizer bloats the stack heavily. Evidence has been that the
2927
// default stack size isn't enough for some browser tests.
30-
diff --git a/chrome/app/shutdown_signal_handlers_posix.cc b/chrome/app/shutdown_signal_handlers_posix.cc
31-
index 621d441e8..472a3a878 100644
32-
--- a/chrome/app/shutdown_signal_handlers_posix.cc
33-
+++ b/chrome/app/shutdown_signal_handlers_posix.cc
28+
--- a/base/threading/platform_thread_unittest.cc
29+
+++ b/base/threading/platform_thread_unittest.cc
30+
@@ -408,7 +408,7 @@ TEST(PlatformThreadTest, GetDefaultThrea
31+
((defined(OS_LINUX) || defined(OS_CHROMEOS)) && \
32+
!defined(THREAD_SANITIZER)) || \
33+
(defined(OS_ANDROID) && !defined(ADDRESS_SANITIZER))
34+
- EXPECT_EQ(0u, stack_size);
35+
+ EXPECT_EQ(1u << 23, stack_size);
36+
#else
37+
EXPECT_GT(stack_size, 0u);
38+
EXPECT_LT(stack_size, 20u * (1 << 20));
39+
--- a/chrome/browser/shutdown_signal_handlers_posix.cc
40+
+++ b/chrome/browser/shutdown_signal_handlers_posix.cc
3441
@@ -187,11 +187,19 @@ void InstallShutdownSignalHandlers(
3542
g_shutdown_pipe_read_fd = pipefd[0];
3643
g_shutdown_pipe_write_fd = pipefd[1];
@@ -51,6 +58,3 @@ index 621d441e8..472a3a878 100644
5158
#endif
5259
ShutdownDetector* detector = new ShutdownDetector(
5360
g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
54-
--
55-
2.31.0
56-

meta-chromium/recipes-browser/chromium/files/musl/0020-Fix-tab-crashes-on-musl.patch

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
1919

2020
--- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
2121
+++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
22-
@@ -130,21 +130,11 @@ namespace sandbox {
22+
@@ -138,21 +138,11 @@ namespace sandbox {
2323
// present (as in newer versions of posix_spawn).
2424
ResultExpr RestrictCloneToThreadsAndEPERMFork() {
2525
const Arg<unsigned long> flags(0);
@@ -46,7 +46,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
4646

4747
// The following two flags are the two important flags in any vfork-emulating
4848
// clone call. EPERM any clone call that contains both of them.
49-
@@ -154,7 +144,7 @@ ResultExpr RestrictCloneToThreadsAndEPER
49+
@@ -162,7 +152,7 @@ ResultExpr RestrictCloneToThreadsAndEPER
5050
AnyOf((flags & (CLONE_VM | CLONE_THREAD)) == 0,
5151
(flags & kImportantCloneVforkFlags) == kImportantCloneVforkFlags);
5252

@@ -92,8 +92,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
9292
case __NR_readahead:
9393
--- a/sandbox/linux/system_headers/arm64_linux_syscalls.h
9494
+++ b/sandbox/linux/system_headers/arm64_linux_syscalls.h
95-
@@ -1119,4 +1119,8 @@
96-
#define __NR_rseq 293
95+
@@ -1215,4 +1215,8 @@
96+
#define __NR_landlock_restrict_self 446
9797
#endif
9898

9999
+#if !defined(__NR_membarrier)
@@ -103,8 +103,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
103103
#endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
104104
--- a/sandbox/linux/system_headers/arm_linux_syscalls.h
105105
+++ b/sandbox/linux/system_headers/arm_linux_syscalls.h
106-
@@ -1605,6 +1605,10 @@
107-
#define __NR_mount_setattr (__NR_SYSCALL_BASE + 442)
106+
@@ -1617,6 +1617,10 @@
107+
#define __NR_landlock_restrict_self (__NR_SYSCALL_BASE + 446)
108108
#endif
109109

110110
+#if !defined(__NR_membarrier)
@@ -126,8 +126,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
126126
#include "sandbox/linux/system_headers/x86_64_linux_syscalls.h"
127127
--- a/sandbox/linux/system_headers/mips64_linux_syscalls.h
128128
+++ b/sandbox/linux/system_headers/mips64_linux_syscalls.h
129-
@@ -1271,4 +1271,8 @@
130-
#define __NR_memfd_create (__NR_Linux + 314)
129+
@@ -1415,4 +1415,8 @@
130+
#define __NR_landlock_restrict_self (__NR_Linux + 446)
131131
#endif
132132

133133
+#if !defined(__NR_membarrier)
@@ -137,8 +137,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
137137
#endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_SYSCALLS_H_
138138
--- a/sandbox/linux/system_headers/mips_linux_syscalls.h
139139
+++ b/sandbox/linux/system_headers/mips_linux_syscalls.h
140-
@@ -1685,4 +1685,8 @@
141-
#define __NR_mount_setattr (__NR_Linux + 442)
140+
@@ -1697,4 +1697,8 @@
141+
#define __NR_landlock_restrict_self (__NR_Linux + 446)
142142
#endif
143143

144144
+#if !defined(__NR_membarrier)
@@ -148,8 +148,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
148148
#endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_
149149
--- a/sandbox/linux/system_headers/x86_64_linux_syscalls.h
150150
+++ b/sandbox/linux/system_headers/x86_64_linux_syscalls.h
151-
@@ -1350,5 +1350,9 @@
152-
#define __NR_rseq 334
151+
@@ -1438,5 +1438,9 @@
152+
#define __NR_landlock_restrict_self 446
153153
#endif
154154

155155
+#if !defined(__NR_membarrier)

0 commit comments

Comments
 (0)