Skip to content

Commit bc555d5

Browse files
krajotavio
authored andcommitted
chromium: Forward port musl-only patches
Signed-off-by: Khem Raj <[email protected]>
1 parent 1309787 commit bc555d5

File tree

3 files changed

+22
-28
lines changed

3 files changed

+22
-28
lines changed

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ Signed-off-by: Khem Raj <[email protected]>
1414

1515
--- a/base/process/process_metrics_posix.cc
1616
+++ b/base/process/process_metrics_posix.cc
17-
@@ -119,7 +119,7 @@ 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_CHROMEOS) || defined(OS_ANDROID)
22-
+#elif defined(__GLIBC__) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
23-
struct mallinfo minfo = mallinfo();
24-
#if BUILDFLAG(USE_TCMALLOC)
25-
return minfo.uordblks;
17+
@@ -105,7 +105,7 @@ void IncreaseFdLimitTo(unsigned int max_
18+
19+
#endif // !defined(OS_FUCHSIA)
20+
21+
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
22+
+#if defined(__GLIBC__) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
23+
namespace {
24+
25+
size_t GetMallocUsageMallinfo() {
2626
--- a/base/trace_event/malloc_dump_provider.cc
2727
+++ b/base/trace_event/malloc_dump_provider.cc
28-
@@ -184,7 +184,7 @@ bool MallocDumpProvider::OnMemoryDump(co
29-
}
28+
@@ -203,7 +203,7 @@ bool MallocDumpProvider::OnMemoryDump(co
29+
&allocated_objects_count);
3030
#elif defined(OS_FUCHSIA)
3131
// TODO(fuchsia): Port, see https://crbug.com/706592.
3232
-#else

meta-chromium/recipes-browser/chromium/files/musl/0002-execinfo-implementation-is-glibc-specific.patch

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ Signed-off-by: Khem Raj <[email protected]>
1010
.../build/Linux/include/llvm/Config/config.h | 2 +-
1111
2 files changed, 7 insertions(+), 7 deletions(-)
1212

13-
diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
14-
index bf4b854298..da07416e38 100644
1513
--- a/base/debug/stack_trace_posix.cc
1614
+++ b/base/debug/stack_trace_posix.cc
1715
@@ -27,7 +27,7 @@
@@ -23,7 +21,7 @@ index bf4b854298..da07416e38 100644
2321
#include <execinfo.h>
2422
#endif
2523

26-
@@ -88,7 +88,7 @@ void DemangleSymbols(std::string* text) {
24+
@@ -89,7 +89,7 @@ void DemangleSymbols(std::string* text)
2725
// Note: code in this function is NOT async-signal safe (std::string uses
2826
// malloc internally).
2927

@@ -32,7 +30,7 @@ index bf4b854298..da07416e38 100644
3230
std::string::size_type search_from = 0;
3331
while (search_from < text->size()) {
3432
// Look for the start of a mangled symbol, from search_from.
35-
@@ -135,7 +135,7 @@ class BacktraceOutputHandler {
33+
@@ -136,7 +136,7 @@ class BacktraceOutputHandler {
3634
virtual ~BacktraceOutputHandler() = default;
3735
};
3836

@@ -41,16 +39,16 @@ index bf4b854298..da07416e38 100644
4139
void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
4240
// This should be more than enough to store a 64-bit number in hex:
4341
// 16 hex digits + 1 for null-terminator.
44-
@@ -827,7 +827,7 @@ size_t CollectStackTrace(void** trace, size_t count) {
45-
// NOTE: This code MUST be async-signal safe (it's used by in-process
46-
// stack dumping signal handler). NO malloc or stdio is allowed here.
47-
48-
-#if !defined(__UCLIBC__) && !defined(_AIX)
49-
+#if !defined(__UCLIBC__) && defined(__GLIBC__) && !defined(_AIX)
42+
@@ -839,7 +839,7 @@ size_t CollectStackTrace(void** trace, s
43+
// If we do not have unwind tables, then try tracing using frame pointers.
44+
return base::debug::TraceStackFramePointers(const_cast<const void**>(trace),
45+
count, 0);
46+
-#elif !defined(__UCLIBC__) && !defined(_AIX)
47+
+#elif !defined(__UCLIBC__) && defined(__GLIBC__) && !defined(_AIX)
5048
// Though the backtrace API man page does not list any possible negative
5149
// return values, we take no chance.
5250
return base::saturated_cast<size_t>(backtrace(trace, count));
53-
@@ -840,13 +840,13 @@ void StackTrace::PrintWithPrefix(const char* prefix_string) const {
51+
@@ -852,13 +852,13 @@ void StackTrace::PrintWithPrefix(const c
5452
// NOTE: This code MUST be async-signal safe (it's used by in-process
5553
// stack dumping signal handler). NO malloc or stdio is allowed here.
5654

@@ -66,8 +64,6 @@ index bf4b854298..da07416e38 100644
6664
void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
6765
const char* prefix_string) const {
6866
StreamBacktraceOutputHandler handler(os);
69-
diff --git a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
70-
index d99a22ad1b..c317645ce8 100644
7167
--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
7268
+++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
7369
@@ -55,7 +55,7 @@

meta-chromium/recipes-browser/chromium/files/musl/0012-debug-Fix-build-with-musl.patch

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ Signed-off-by: Khem Raj <[email protected]>
1717
base/debug/stack_trace.cc | 4 ++--
1818
1 file changed, 2 insertions(+), 2 deletions(-)
1919

20-
diff --git a/base/debug/stack_trace.cc b/base/debug/stack_trace.cc
21-
index f5e2dbba14..6691e32d01 100644
2220
--- a/base/debug/stack_trace.cc
2321
+++ b/base/debug/stack_trace.cc
24-
@@ -225,14 +225,14 @@ std::string StackTrace::ToString() const {
22+
@@ -259,14 +259,14 @@ std::string StackTrace::ToString() const
2523
}
2624
std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
2725
std::stringstream stream;
@@ -33,7 +31,7 @@ index f5e2dbba14..6691e32d01 100644
3331
}
3432

3533
std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
36-
-#if !defined(__UCLIBC__) & !defined(_AIX)
34+
-#if !defined(__UCLIBC__) && !defined(_AIX)
3735
+#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
3836
s.OutputToStream(&os);
3937
#else

0 commit comments

Comments
 (0)