Skip to content

Commit 786ebc8

Browse files
krajMaxIhlenfeldt
authored andcommitted
chromium: Fix build with musl
Several patches are not needed anymore as latest chromium has either accepted variants of them or are not needed with new musl. Signed-off-by: Khem Raj <raj.khem@gmail.com> Fixed some whitespace errors. Signed-off-by: Narpat Mali <narpat.mali@windriver.com>
1 parent 08da921 commit 786ebc8

11 files changed

+79
-373
lines changed

meta-chromium/recipes-browser/chromium/chromium-gn.inc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,25 @@ SRC_URI += " \
2727
file://0018-Revert-Fix-std-span-autodetection-7805.patch \
2828
file://0019-Backport-Fix-deps-for-feed_response.proto.patch \
2929
file://0020-Only-default-operator-on-declaration.patch \
30+
file://fix-libc-version-include.patch \
3031
"
3132

3233
SRC_URI:append:libc-musl = "\
3334
file://musl/0001-mallinfo-implementation-is-glibc-specific.patch \
34-
file://musl/0002-execinfo-implementation-is-glibc-specific.patch \
3535
file://musl/0003-Define-TEMP_FAILURE_RETRY-and-__si_fields.patch \
36-
file://musl/0004-blink-Fix-build-with-musl.patch \
3736
file://musl/0005-breakpad-Fix-build-with-musl.patch \
3837
file://musl/0006-fontconfig-Musl-does-not-have-rand_r-API.patch \
3938
file://musl/0007-__libc_malloc-is-internal-to-glibc.patch \
40-
file://musl/0008-gnu_libc_version-API-is-glibc-specific.patch \
41-
file://musl/0009-provide-res_ninit-and-nclose-APIs-on-non-glibc-linux.patch \
42-
file://musl/0011-crashpad-Fix-build-with-musl.patch \
4339
file://musl/0012-debug-Fix-build-with-musl.patch \
4440
file://musl/0015-mallopt-is-glibc-specific-API.patch \
4541
file://musl/0018--Use-monotonic-clock-for-pthread_cond_timedwait-with-.patch \
4642
file://musl/0020-Fix-tab-crashes-on-musl.patch \
4743
file://musl/0021-pthread_getname_np.patch \
4844
file://musl/0022-sys-stat.patch \
4945
file://musl/scoped-file.patch \
50-
file://musl/fix-narrowing-cast.patch \
5146
file://musl/credentials-header.patch \
5247
file://musl/fstatat64.patch \
48+
file://musl/no-res-ninit-nclose.patch \
5349
"
5450

5551
ANY_OF_DISTRO_FEATURES = "opengl vulkan"
@@ -89,6 +85,9 @@ DEPENDS += " \
8985
virtual/libgl \
9086
"
9187
DEPEND:append:runtime-llvm = " compiler-rt-native libcxx-native"
88+
DEPENDS:append:libc-musl = " libexecinfo"
89+
90+
LDFLAGS:append:libc-musl = " -lexecinfo"
9291

9392
# The wrapper script we use from upstream requires bash.
9493
RDEPENDS:${PN} = "bash"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
gnu/libc-version.h is only in glibc therefore guard it with __GLIBC__
2+
rest of the code should be working with musl too.
3+
4+
Upstream-Status: Pending
5+
Signed-off-by: Khem Raj <raj.khem@gmail.com>
6+
--- a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
7+
+++ b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
8+
@@ -61,9 +61,10 @@
9+
10+
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
11+
// of lacros-chrome is complete.
12+
-#if defined(__GLIBC__) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
13+
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
14+
+#if defined(__GLIBC__)
15+
#include <gnu/libc-version.h>
16+
-
17+
+#endif
18+
#include "base/linux_util.h"
19+
#include "base/strings/string_split.h"
20+
#include "base/strings/string_util.h"

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

Lines changed: 0 additions & 82 deletions
This file was deleted.

meta-chromium/recipes-browser/chromium/files/musl/0003-Define-TEMP_FAILURE_RETRY-and-__si_fields.patch

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
1414
sandbox/linux/suid/sandbox.c | 9 +++++++++
1515
2 files changed, 14 insertions(+)
1616

17-
diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc
18-
index 0ef42807ae..7494bba8e3 100644
1917
--- a/sandbox/linux/seccomp-bpf/trap.cc
2018
+++ b/sandbox/linux/seccomp-bpf/trap.cc
2119
@@ -27,6 +27,11 @@
@@ -30,8 +28,6 @@ index 0ef42807ae..7494bba8e3 100644
3028
namespace {
3129

3230
struct arch_sigsys {
33-
diff --git a/sandbox/linux/suid/sandbox.c b/sandbox/linux/suid/sandbox.c
34-
index 2180b9d137..14be27b53d 100644
3531
--- a/sandbox/linux/suid/sandbox.c
3632
+++ b/sandbox/linux/suid/sandbox.c
3733
@@ -44,6 +44,15 @@
@@ -40,13 +36,13 @@ index 2180b9d137..14be27b53d 100644
4036

4137
+#ifndef TEMP_FAILURE_RETRY
4238
+#define TEMP_FAILURE_RETRY(expression) \
43-
+ (__extension__ \
44-
+ ({ long int __result; \
45-
+ do __result = (long int) (expression); \
46-
+ while (__result == -1L && errno == EINTR); \
39+
+ (__extension__ \
40+
+ ({ long int __result; \
41+
+ do __result = (long int) (expression); \
42+
+ while (__result == -1L && errno == EINTR); \
4743
+ __result; }))
4844
+#endif
4945
+
50-
#define HANDLE_EINTR(x) TEMP_FAILURE_RETRY(x)
51-
52-
static void FatalError(const char* msg, ...)
46+
#define HANDLE_EINTR(x) ({ \
47+
long eintr_wrapper_result; \
48+
do { \

meta-chromium/recipes-browser/chromium/files/musl/0004-blink-Fix-build-with-musl.patch

Lines changed: 0 additions & 37 deletions
This file was deleted.

meta-chromium/recipes-browser/chromium/files/musl/0008-gnu_libc_version-API-is-glibc-specific.patch

Lines changed: 0 additions & 68 deletions
This file was deleted.

meta-chromium/recipes-browser/chromium/files/musl/0009-provide-res_ninit-and-nclose-APIs-on-non-glibc-linux.patch

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)