diff --git a/srcpkgs/chromium/files/musl-patches/musl-hacks.patch b/srcpkgs/chromium/files/musl-patches/musl-hacks.patch new file mode 100644 index 00000000000..d1f580a81d0 --- /dev/null +++ b/srcpkgs/chromium/files/musl-patches/musl-hacks.patch @@ -0,0 +1,22 @@ +--- ./third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_userspace.c.orig ++++ ./third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_userspace.c +@@ -72,7 +72,7 @@ + pthread_setname_np(name); + #endif + #if defined(__Userspace_os_Linux) +- pthread_setname_np(pthread_self(), name); ++ //pthread_setname_np(pthread_self(), name); + #endif + #if defined(__Userspace_os_FreeBSD) + pthread_set_name_np(pthread_self(), name); +--- ./base/debug/stack_trace.cc.orig ++++ ./base/debug/stack_trace.cc +@@ -33,7 +33,7 @@ + + std::string StackTrace::ToString() const { + std::stringstream stream; +-#if !defined(__UCLIBC__) ++#if defined(__GLIBC__) + OutputToStream(&stream); + #endif + return stream.str(); diff --git a/srcpkgs/chromium/files/musl-patches/resolver.patch b/srcpkgs/chromium/files/musl-patches/resolver.patch index fe1141ecbe5..7e2a0a4723c 100644 --- a/srcpkgs/chromium/files/musl-patches/resolver.patch +++ b/srcpkgs/chromium/files/musl-patches/resolver.patch @@ -22,3 +22,15 @@ DnsReloaderMaybeReload(); #endif int err = getaddrinfo(host.c_str(), NULL, &hints, &ai); +--- ./net/dns/dns_reloader.cc.orig ++++ ./net/dns/dns_reloader.cc +@@ -4,8 +4,7 @@ + + #include "net/dns/dns_reloader.h" + +-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \ +- !defined(OS_ANDROID) ++#if defined(__GLIBC__) + + #include + diff --git a/srcpkgs/chromium/patches/no-mallinfo.patch b/srcpkgs/chromium/patches/no-mallinfo.patch index 865db77dcbc..e9e82805884 100644 --- a/srcpkgs/chromium/patches/no-mallinfo.patch +++ b/srcpkgs/chromium/patches/no-mallinfo.patch @@ -1,6 +1,33 @@ ---- ./content/child/content_child_helpers.cc.orig +--- ./base/trace_event/malloc_dump_provider.cc.orig ++++ ./base/trace_event/malloc_dump_provider.cc +@@ -61,7 +61,7 @@ + // fixed quantum, so the excess region will not be resident. + // See crrev.com/1531463004 for detailed explanation. + resident_size = stats.max_size_in_use; +-#else ++#elif defined(__GLIBC__) + struct mallinfo info = mallinfo(); + DCHECK_GE(info.arena + info.hblkhd, info.uordblks); + +@@ -73,6 +73,7 @@ + allocated_objects_size = info.uordblks; + #endif + ++#if defined(USE_TCMALLOC) || defined(__GLIBC__) || defined(OS_MACOSX) || defined(OS_IOS) + MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc"); + outer_dump->AddScalar("virtual_size", MemoryAllocatorDump::kUnitsBytes, + total_virtual_size); +@@ -95,6 +96,7 @@ + MemoryAllocatorDump::kUnitsBytes, + resident_size - allocated_objects_size); + } ++#endif + + return true; + } +--- ./content/child/content_child_helpers.cc +++ ./content/child/content_child_helpers.cc -@@ -15,7 +15,7 @@ +@@ -18,7 +18,7 @@ namespace content { diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template index c7d5b94edde..6de97a5ff65 100644 --- a/srcpkgs/chromium/template +++ b/srcpkgs/chromium/template @@ -144,8 +144,8 @@ do_configure() { # TODO: use the file at run time instead of effectively compiling it in. conf+=" -Dusb_ids_path=/usr/share/hwdata/usb.ids" - # Never use bundled binutils/gold binary. Disable gold linker flags for now. - conf+=" -Dlinux_use_bundled_binutils=0 -Dlinux_use_gold_binary=0 -Dlinux_use_gold_flags=0" + # Never use bundled binutils/gold binary. + conf+=" -Dlinux_use_bundled_binutils=0 -Dlinux_use_bundled_gold=0 -Dlinux_use_gold_flags=1" # Always support proprietary codecs. conf+=" -Dproprietary_codecs=1"