Skip to content

Commit 6a36f47

Browse files
committed
Fix musl chromium build
Fixes OSSystems#578
1 parent 550fb5e commit 6a36f47

File tree

2 files changed

+101
-0
lines changed

2 files changed

+101
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
From 70a8d057c6318ab73cd031d874661c533d7e3b2e Mon Sep 17 00:00:00 2001
2+
From: "Issam E. Maghni" <[email protected]>
3+
Date: Sat, 30 Oct 2021 19:14:07 -0400
4+
Subject: [PATCH] Fix non-existent compat. headers
5+
6+
musl have neither `sys/cdefs.h` nor `sys/queue.h` [1].
7+
8+
[1] https://wiki.musl-libc.org/faq.html
9+
10+
Signed-off-by: Issam E. Maghni <[email protected]>
11+
---
12+
base/third_party/libevent/BUILD.gn | 2 +-
13+
third_party/crashpad/crashpad/compat/linux/sys/ptrace.h | 2 --
14+
third_party/libsync/src/include/sync/sync.h | 9 ++++++---
15+
3 files changed, 7 insertions(+), 6 deletions(-)
16+
17+
diff --git a/base/third_party/libevent/BUILD.gn b/base/third_party/libevent/BUILD.gn
18+
index abd3901d..ae2f020f 100644
19+
--- a/base/third_party/libevent/BUILD.gn
20+
+++ b/base/third_party/libevent/BUILD.gn
21+
@@ -49,7 +49,7 @@ static_library("libevent") {
22+
"linux/config.h",
23+
"linux/event-config.h",
24+
]
25+
- include_dirs = [ "linux" ]
26+
+ include_dirs = [ "linux", "compat" ]
27+
} else if (is_android) {
28+
sources += [
29+
"android/config.h",
30+
diff --git a/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h b/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
31+
index f8be372c..c07e4c88 100644
32+
--- a/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
33+
+++ b/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
34+
@@ -17,8 +17,6 @@
35+
36+
#include_next <sys/ptrace.h>
37+
38+
-#include <sys/cdefs.h>
39+
-
40+
// https://sourceware.org/bugzilla/show_bug.cgi?id=22433
41+
#if !defined(PTRACE_GET_THREAD_AREA) && !defined(PT_GET_THREAD_AREA) && \
42+
defined(__GLIBC__)
43+
diff --git a/third_party/libsync/src/include/sync/sync.h b/third_party/libsync/src/include/sync/sync.h
44+
index 50ed0ac5..014ea72d 100644
45+
--- a/third_party/libsync/src/include/sync/sync.h
46+
+++ b/third_party/libsync/src/include/sync/sync.h
47+
@@ -19,12 +19,13 @@
48+
#ifndef __SYS_CORE_SYNC_H
49+
#define __SYS_CORE_SYNC_H
50+
51+
-#include <sys/cdefs.h>
52+
#include <stdint.h>
53+
54+
#include <linux/types.h>
55+
56+
-__BEGIN_DECLS
57+
+#ifdef __cplusplus
58+
+extern "C" {
59+
+#endif
60+
61+
struct sync_legacy_merge_data {
62+
int32_t fd2;
63+
@@ -158,6 +159,8 @@ struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info,
64+
struct sync_pt_info *itr);
65+
void sync_fence_info_free(struct sync_fence_info_data *info);
66+
67+
-__END_DECLS
68+
+#ifdef __cplusplus
69+
+}
70+
+#endif
71+
72+
#endif /* __SYS_CORE_SYNC_H */
73+
--
74+
2.31.1
75+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From ad9541cd3c88b39efa47912af2dd939e955b1841 Mon Sep 17 00:00:00 2001
2+
From: "Issam E. Maghni" <[email protected]>
3+
Date: Sat, 30 Oct 2021 19:19:44 -0400
4+
Subject: [PATCH] No canonicalize_file_name in musl
5+
6+
Signed-off-by: Issam E. Maghni <[email protected]>
7+
---
8+
third_party/nasm/config/config-linux.h | 2 +-
9+
1 file changed, 1 insertion(+), 1 deletion(-)
10+
11+
diff --git a/third_party/nasm/config/config-linux.h b/third_party/nasm/config/config-linux.h
12+
index 9e59df4f..b96673ac 100644
13+
--- a/third_party/nasm/config/config-linux.h
14+
+++ b/third_party/nasm/config/config-linux.h
15+
@@ -139,7 +139,7 @@
16+
#define HAVE_ACCESS 1
17+
18+
/* Define to 1 if you have the `canonicalize_file_name' function. */
19+
-#define HAVE_CANONICALIZE_FILE_NAME 1
20+
+/* #undef HAVE_CANONICALIZE_FILE_NAME */
21+
22+
/* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
23+
/* #undef HAVE_CPU_TO_LE16 */
24+
--
25+
2.31.1
26+

0 commit comments

Comments
 (0)