summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/breakpad
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-09-18 10:29:30 -0700
committerMartin Jansa <Martin.Jansa@gmail.com>2017-09-22 22:50:41 +0000
commitcfa3f070885482dc2f0c3e13fe70f20fad46e35e (patch)
tree6b3f576317466ef790ac62fd4cfc973fe477d808 /meta-oe/recipes-devtools/breakpad
parentcddeb4fbc4e7d9573ef9be77cafefdc5ff77e4fd (diff)
downloadmeta-openembedded-cfa3f070885482dc2f0c3e13fe70f20fad46e35e.tar.gz
breakpad: Upgrade to latest master
Fix build with musl while here Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools/breakpad')
-rw-r--r--meta-oe/recipes-devtools/breakpad/breakpad/0001-Turn-off-sign-compare-for-musl-libc.patch41
-rw-r--r--meta-oe/recipes-devtools/breakpad/breakpad/0001-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch28
-rw-r--r--meta-oe/recipes-devtools/breakpad/breakpad/0001-lss-Match-syscalls-to-match-musl.patch45
-rw-r--r--meta-oe/recipes-devtools/breakpad/breakpad/0002-Avoid-using-basename.patch29
-rw-r--r--meta-oe/recipes-devtools/breakpad/breakpad/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch60
-rw-r--r--meta-oe/recipes-devtools/breakpad/breakpad/0002-sys-signal.h-is-a-nonportable-alias-for-signal.h.patch26
-rw-r--r--meta-oe/recipes-devtools/breakpad/breakpad/0003-Dont-include-stab.h.patch88
-rw-r--r--meta-oe/recipes-devtools/breakpad/breakpad/0003-Fix-conflict-between-musl-libc-dirent.h-and-lss.patch35
-rw-r--r--meta-oe/recipes-devtools/breakpad/breakpad/0004-elf_reader.cc-include-sys-reg.h-to-get-__WORDSIZE-on.patch43
-rw-r--r--meta-oe/recipes-devtools/breakpad/breakpad/0005-Import-necessary-definitions-from-stab.h.patch199
-rw-r--r--meta-oe/recipes-devtools/breakpad/breakpad/0005-md2core-Replace-basename.patch38
-rw-r--r--meta-oe/recipes-devtools/breakpad/breakpad_git.bb18
12 files changed, 645 insertions, 5 deletions
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad/0001-Turn-off-sign-compare-for-musl-libc.patch b/meta-oe/recipes-devtools/breakpad/breakpad/0001-Turn-off-sign-compare-for-musl-libc.patch
new file mode 100644
index 000000000..33bae1a37
--- /dev/null
+++ b/meta-oe/recipes-devtools/breakpad/breakpad/0001-Turn-off-sign-compare-for-musl-libc.patch
@@ -0,0 +1,41 @@
1From ab8dcad25d0ac1f3a88814e78794e5d450de15ac Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 14 Sep 2017 23:12:51 -0700
4Subject: [PATCH 1/5] Turn off sign-compare for musl-libc
5
6Fix
7
8../../../../../../../workspace/sources/breakpad/src/client/linux/crash_generation/crash_generation_server.cc:234:14: error: comparison of integers of different signs: 'unsigned long' and 'int' [-Werror,-Wsign-compare] hdr = CMSG_NXTHDR(&msg, hdr)) { ^~~~~~~~~~~~~~~~~~~~~~
9/mnt/a/oe/build/tmp/work/cortexa7hf-neon-vfpv4-bec-linux-musleabi/breakpad/1_1.0+git999-r0/recipe-sysroot/usr/include/sys/socket.h:288:44: note: expanded from macro 'CMSG_NXTHDR' __CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated.
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 src/client/linux/crash_generation/crash_generation_server.cc | 10 ++++++++++
14 1 file changed, 10 insertions(+)
15
16diff --git a/src/client/linux/crash_generation/crash_generation_server.cc b/src/client/linux/crash_generation/crash_generation_server.cc
17index 2596afde..2faeb9e5 100644
18--- a/src/client/linux/crash_generation/crash_generation_server.cc
19+++ b/src/client/linux/crash_generation/crash_generation_server.cc
20@@ -230,8 +230,18 @@ CrashGenerationServer::ClientEvent(short revents)
21 // Walk the control payload and extract the file descriptor and validated pid.
22 pid_t crashing_pid = -1;
23 int signal_fd = -1;
24+#ifndef __GLIBC__
25+ // In musl-libc, CMSG_NXTHDR typecasts char* to cmsghdr* which causes
26+ // clang to throw sign-compare warning. This is to suppress the warning
27+ // inline.
28+ #pragma clang diagnostic push
29+ #pragma clang diagnostic ignored "-Wsign-compare"
30+#endif
31 for (struct cmsghdr *hdr = CMSG_FIRSTHDR(&msg); hdr;
32 hdr = CMSG_NXTHDR(&msg, hdr)) {
33+#ifndef __GLIBC__
34+ #pragma clang diagnostic pop
35+#endif
36 if (hdr->cmsg_level != SOL_SOCKET)
37 continue;
38 if (hdr->cmsg_type == SCM_RIGHTS) {
39--
402.14.1
41
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad/0001-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch b/meta-oe/recipes-devtools/breakpad/breakpad/0001-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
new file mode 100644
index 000000000..4583d601a
--- /dev/null
+++ b/meta-oe/recipes-devtools/breakpad/breakpad/0001-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
@@ -0,0 +1,28 @@
1From 68580cb62f77117be3164c52abae68f75e8e59a1 Mon Sep 17 00:00:00 2001
2From: Felix Janda <felix.janda@posteo.de>
3Date: Sun, 1 Feb 2015 14:26:52 +0100
4Subject: [PATCH 1/3] include <sys/reg.h> to get __WORDSIZE on musl libc
5
6---
7 src/common/linux/elf_core_dump.h | 1 +
8 1 file changed, 1 insertion(+)
9
10Index: git/src/common/linux/elf_core_dump.h
11===================================================================
12--- git.orig/src/common/linux/elf_core_dump.h
13+++ git/src/common/linux/elf_core_dump.h
14@@ -33,10 +33,13 @@
15 #ifndef COMMON_LINUX_ELF_CORE_DUMP_H_
16 #define COMMON_LINUX_ELF_CORE_DUMP_H_
17
18+#include <config.h>
19 #include <elf.h>
20 #include <link.h>
21 #include <stddef.h>
22-
23+#ifdef HAVE_SYS_REG_H
24+#include <sys/reg.h>
25+#endif
26 #include "common/memory_range.h"
27
28 namespace google_breakpad {
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad/0001-lss-Match-syscalls-to-match-musl.patch b/meta-oe/recipes-devtools/breakpad/breakpad/0001-lss-Match-syscalls-to-match-musl.patch
new file mode 100644
index 000000000..2b892ad64
--- /dev/null
+++ b/meta-oe/recipes-devtools/breakpad/breakpad/0001-lss-Match-syscalls-to-match-musl.patch
@@ -0,0 +1,45 @@
1From 5f7333e4f7b7485598bd71aa80967e1a16a7f901 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 14 Sep 2017 22:57:52 -0700
4Subject: [PATCH] lss: Match syscalls to match musl
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 linux_syscall_support.h | 3 +++
9 1 file changed, 3 insertions(+)
10
11Index: lss/linux_syscall_support.h
12===================================================================
13--- lss.orig/linux_syscall_support.h
14+++ lss/linux_syscall_support.h
15@@ -793,6 +793,9 @@ struct kernel_statfs {
16 #define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
17 #endif
18
19+#ifndef __NR_fstatat
20+#define __NR_fstatat __NR_fstatat64
21+#endif
22
23 #if defined(__x86_64__)
24 #ifndef ARCH_SET_GS
25@@ -924,6 +927,7 @@ struct kernel_statfs {
26 #ifndef __NR_fallocate
27 #define __NR_fallocate 324
28 #endif
29+
30 /* End of i386 definitions */
31 #elif defined(__ARM_ARCH_3__) || defined(__ARM_EABI__)
32 #ifndef __NR_setresuid
33@@ -1211,6 +1215,12 @@ struct kernel_statfs {
34 #ifndef __NR_fallocate
35 #define __NR_fallocate 285
36 #endif
37+#ifndef __NR_pread
38+#define __NR_pread __NR_pread64
39+#endif
40+#ifndef __NR_pwrite
41+#define __NR_pwrite __NR_pwrite64
42+#endif
43 /* End of x86-64 definitions */
44 #elif defined(__mips__)
45 #if _MIPS_SIM == _MIPS_SIM_ABI32
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad/0002-Avoid-using-basename.patch b/meta-oe/recipes-devtools/breakpad/breakpad/0002-Avoid-using-basename.patch
new file mode 100644
index 000000000..bc6282981
--- /dev/null
+++ b/meta-oe/recipes-devtools/breakpad/breakpad/0002-Avoid-using-basename.patch
@@ -0,0 +1,29 @@
1From 806964f852773e427fea82a7716d44ce3be4498c Mon Sep 17 00:00:00 2001
2From: Felix Janda <felix.janda@posteo.de>
3Date: Sun, 1 Feb 2015 14:27:32 +0100
4Subject: [PATCH 2/3] Avoid using basename
5
6---
7 src/common/linux/dump_symbols.cc | 6 +++---
8 1 file changed, 3 insertions(+), 3 deletions(-)
9
10diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc
11index d029ca14..6ac4a17b 100644
12--- a/src/common/linux/dump_symbols.cc
13+++ b/src/common/linux/dump_symbols.cc
14@@ -881,9 +881,9 @@ const char* ElfArchitecture(const typename ElfClass::Ehdr* elf_header) {
15 // last slash, or the whole filename if there are no slashes.
16 string BaseFileName(const string &filename) {
17 // Lots of copies! basename's behavior is less than ideal.
18- char* c_filename = strdup(filename.c_str());
19- string base = basename(c_filename);
20- free(c_filename);
21+ const char *c_filename = filename.c_str();
22+ const char *p = strrchr(c_filename, '/');
23+ string base = p ? p+1 : c_filename;
24 return base;
25 }
26
27--
282.14.1
29
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch b/meta-oe/recipes-devtools/breakpad/breakpad/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
new file mode 100644
index 000000000..6c097cd22
--- /dev/null
+++ b/meta-oe/recipes-devtools/breakpad/breakpad/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
@@ -0,0 +1,60 @@
1From 0ba1b3e35e7c743b670bedc3e90001dfb868df10 Mon Sep 17 00:00:00 2001
2From: Felix Janda <felix.janda@posteo.de>
3Date: Sun, 1 Feb 2015 13:45:51 +0100
4Subject: [PATCH 2/6] Use _fpstate instead of _libc_fpstate on linux
5
6glibc defines both. musl libc only the former.
7---
8 src/client/linux/dump_writer_common/ucontext_reader.cc | 4 ++--
9 src/client/linux/dump_writer_common/ucontext_reader.h | 2 +-
10 src/client/linux/minidump_writer/minidump_writer.h | 2 +-
11 3 files changed, 4 insertions(+), 4 deletions(-)
12
13Index: git/src/client/linux/dump_writer_common/ucontext_reader.cc
14===================================================================
15--- git.orig/src/client/linux/dump_writer_common/ucontext_reader.cc
16+++ git/src/client/linux/dump_writer_common/ucontext_reader.cc
17@@ -49,7 +49,7 @@ uintptr_t UContextReader::GetInstruction
18 }
19
20 void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
21- const struct _libc_fpstate* fp) {
22+ const struct _fpstate* fp) {
23 const greg_t* regs = uc->uc_mcontext.gregs;
24
25 out->context_flags = MD_CONTEXT_X86_FULL |
26@@ -97,7 +97,7 @@ uintptr_t UContextReader::GetInstruction
27 }
28
29 void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
30- const struct _libc_fpstate* fpregs) {
31+ const struct _fpstate* fpregs) {
32 const greg_t* regs = uc->uc_mcontext.gregs;
33
34 out->context_flags = MD_CONTEXT_AMD64_FULL;
35Index: git/src/client/linux/dump_writer_common/ucontext_reader.h
36===================================================================
37--- git.orig/src/client/linux/dump_writer_common/ucontext_reader.h
38+++ git/src/client/linux/dump_writer_common/ucontext_reader.h
39@@ -50,7 +50,7 @@ struct UContextReader {
40 // info: the collection of register structures.
41 #if defined(__i386__) || defined(__x86_64)
42 static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
43- const struct _libc_fpstate* fp);
44+ const struct _fpstate* fp);
45 #elif defined(__aarch64__)
46 static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
47 const struct fpsimd_context* fpregs);
48Index: git/src/client/linux/minidump_writer/minidump_writer.h
49===================================================================
50--- git.orig/src/client/linux/minidump_writer/minidump_writer.h
51+++ git/src/client/linux/minidump_writer/minidump_writer.h
52@@ -48,7 +48,7 @@ class ExceptionHandler;
53 #if defined(__aarch64__)
54 typedef struct fpsimd_context fpstate_t;
55 #elif !defined(__ARM_EABI__) && !defined(__mips__)
56-typedef struct _libc_fpstate fpstate_t;
57+typedef struct _fpstate fpstate_t;
58 #endif
59
60 // These entries store a list of memory regions that the client wants included
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad/0002-sys-signal.h-is-a-nonportable-alias-for-signal.h.patch b/meta-oe/recipes-devtools/breakpad/breakpad/0002-sys-signal.h-is-a-nonportable-alias-for-signal.h.patch
new file mode 100644
index 000000000..cfd9a9b34
--- /dev/null
+++ b/meta-oe/recipes-devtools/breakpad/breakpad/0002-sys-signal.h-is-a-nonportable-alias-for-signal.h.patch
@@ -0,0 +1,26 @@
1From 15582e19c2545d5ffe8ff07f957d0ed602aeca74 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 14 Sep 2017 23:15:09 -0700
4Subject: [PATCH 2/5] <sys/signal.h> is a nonportable alias for <signal.h>
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 src/client/linux/handler/exception_handler.cc | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc
12index 05936d28..cca023fd 100644
13--- a/src/client/linux/handler/exception_handler.cc
14+++ b/src/client/linux/handler/exception_handler.cc
15@@ -78,7 +78,7 @@
16 #include <sys/wait.h>
17 #include <unistd.h>
18
19-#include <sys/signal.h>
20+#include <signal.h>
21 #include <sys/ucontext.h>
22 #include <sys/user.h>
23 #include <ucontext.h>
24--
252.14.1
26
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad/0003-Dont-include-stab.h.patch b/meta-oe/recipes-devtools/breakpad/breakpad/0003-Dont-include-stab.h.patch
new file mode 100644
index 000000000..2593ea93e
--- /dev/null
+++ b/meta-oe/recipes-devtools/breakpad/breakpad/0003-Dont-include-stab.h.patch
@@ -0,0 +1,88 @@
1From 569af712da94637091080943f6a0d69ccb35864e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 14 Sep 2017 23:24:08 -0700
4Subject: [PATCH 3/5] Dont include stab.h
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 src/common/stabs_reader.cc | 1 -
9 src/common/stabs_reader.h | 12 +++++++++++-
10 src/common/stabs_reader_unittest.cc | 1 -
11 3 files changed, 11 insertions(+), 3 deletions(-)
12
13Index: git/src/common/stabs_reader.cc
14===================================================================
15--- git.orig/src/common/stabs_reader.cc
16+++ git/src/common/stabs_reader.cc
17@@ -34,7 +34,9 @@
18 #include "common/stabs_reader.h"
19
20 #include <assert.h>
21+#ifdef HAVE_STAB_H
22 #include <stab.h>
23+#endif
24 #include <string.h>
25
26 #include <string>
27Index: git/src/common/stabs_reader.h
28===================================================================
29--- git.orig/src/common/stabs_reader.h
30+++ git/src/common/stabs_reader.h
31@@ -58,6 +58,30 @@
32 #elif defined(HAVE_A_OUT_H)
33 #include <a.out.h>
34 #endif
35+// Definitions from <stab.h> and <a.out.h> for systems which
36+// do not have them
37+#ifndef HAVE_A_OUT_H
38+#undef N_UNDF
39+#define N_UNDF 0x0
40+#ifndef N_FUN
41+#define N_FUN 0x24
42+#endif
43+#ifndef N_SLINE
44+#define N_SLINE 0x44
45+#endif
46+#ifndef N_SO
47+#define N_SO 0x64
48+#endif
49+#ifndef N_LSYM
50+#define N_LSYM 0x80
51+#endif
52+#ifndef N_BINCL
53+#define N_BINCL 0x82
54+#endif
55+#ifndef N_SOL
56+#define N_SOL 0x84
57+#endif
58+#endif
59
60 #include <string>
61 #include <vector>
62Index: git/src/common/stabs_reader_unittest.cc
63===================================================================
64--- git.orig/src/common/stabs_reader_unittest.cc
65+++ git/src/common/stabs_reader_unittest.cc
66@@ -33,7 +33,9 @@
67
68 #include <assert.h>
69 #include <errno.h>
70+#ifdef HAVE_STAB_H
71 #include <stab.h>
72+#endif
73 #include <stdarg.h>
74 #include <stdlib.h>
75 #include <string.h>
76Index: git/configure.ac
77===================================================================
78--- git.orig/configure.ac
79+++ git/configure.ac
80@@ -72,7 +72,7 @@ AC_ARG_ENABLE(m32,
81 AC_HEADER_STDC
82 AC_SYS_LARGEFILE
83 AX_PTHREAD
84-AC_CHECK_HEADERS([a.out.h sys/random.h])
85+AC_CHECK_HEADERS([a.out.h stab.h sys/random.h])
86 AC_CHECK_FUNCS([arc4random getrandom])
87
88 AX_CXX_COMPILE_STDCXX(11, noext, mandatory)
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad/0003-Fix-conflict-between-musl-libc-dirent.h-and-lss.patch b/meta-oe/recipes-devtools/breakpad/breakpad/0003-Fix-conflict-between-musl-libc-dirent.h-and-lss.patch
new file mode 100644
index 000000000..851004704
--- /dev/null
+++ b/meta-oe/recipes-devtools/breakpad/breakpad/0003-Fix-conflict-between-musl-libc-dirent.h-and-lss.patch
@@ -0,0 +1,35 @@
1From 7aa266545dabf9934ccd44d4fc836040497159be Mon Sep 17 00:00:00 2001
2From: Felix Janda <felix.janda@posteo.de>
3Date: Sun, 1 Feb 2015 13:41:08 +0100
4Subject: [PATCH 3/3] Fix conflict between musl libc <dirent.h> and lss
5
6Include <dirent.h> late to avoid the macro getdents64 in musl
7libc's <dirent.h> to conflict with linux_sycall_support.h.
8---
9 src/client/linux/crash_generation/crash_generation_server.cc | 3 ++-
10 1 file changed, 2 insertions(+), 1 deletion(-)
11
12diff --git a/src/client/linux/crash_generation/crash_generation_server.cc b/src/client/linux/crash_generation/crash_generation_server.cc
13index 26c50a5c..2596afde 100644
14--- a/src/client/linux/crash_generation/crash_generation_server.cc
15+++ b/src/client/linux/crash_generation/crash_generation_server.cc
16@@ -28,7 +28,6 @@
17 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18
19 #include <assert.h>
20-#include <dirent.h>
21 #include <fcntl.h>
22 #include <limits.h>
23 #include <poll.h>
24@@ -49,6 +48,8 @@
25 #include "common/linux/guid_creator.h"
26 #include "common/linux/safe_readlink.h"
27
28+#include <dirent.h>
29+
30 static const char kCommandQuit = 'x';
31
32 namespace google_breakpad {
33--
342.14.1
35
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad/0004-elf_reader.cc-include-sys-reg.h-to-get-__WORDSIZE-on.patch b/meta-oe/recipes-devtools/breakpad/breakpad/0004-elf_reader.cc-include-sys-reg.h-to-get-__WORDSIZE-on.patch
new file mode 100644
index 000000000..525a1555b
--- /dev/null
+++ b/meta-oe/recipes-devtools/breakpad/breakpad/0004-elf_reader.cc-include-sys-reg.h-to-get-__WORDSIZE-on.patch
@@ -0,0 +1,43 @@
1From 680f9590d19a6e35c7c5587e3f4d8194aab0fcd2 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 14 Sep 2017 23:28:36 -0700
4Subject: [PATCH 4/5] elf_reader.cc: include <sys/reg.h> to get __WORDSIZE on
5 musl libc
6
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8---
9 src/common/dwarf/elf_reader.cc | 1 +
10 1 file changed, 1 insertion(+)
11
12Index: git/src/common/dwarf/elf_reader.cc
13===================================================================
14--- git.orig/src/common/dwarf/elf_reader.cc
15+++ git/src/common/dwarf/elf_reader.cc
16@@ -29,10 +29,13 @@
17 #ifndef _GNU_SOURCE
18 #define _GNU_SOURCE // needed for pread()
19 #endif
20-
21+#include <config.h>
22 #include <sys/types.h>
23 #include <sys/stat.h>
24 #include <sys/mman.h>
25+#ifdef HAVE_SYS_REG_H
26+#include <sys/reg.h>
27+#endif
28 #include <unistd.h>
29 #include <fcntl.h>
30 #include <string.h>
31Index: git/configure.ac
32===================================================================
33--- git.orig/configure.ac
34+++ git/configure.ac
35@@ -72,7 +72,7 @@ AC_ARG_ENABLE(m32,
36 AC_HEADER_STDC
37 AC_SYS_LARGEFILE
38 AX_PTHREAD
39-AC_CHECK_HEADERS([a.out.h stab.h sys/random.h])
40+AC_CHECK_HEADERS([a.out.h stab.h sys/random.h sys/reg.h])
41 AC_CHECK_FUNCS([arc4random getrandom])
42
43 AX_CXX_COMPILE_STDCXX(11, noext, mandatory)
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad/0005-Import-necessary-definitions-from-stab.h.patch b/meta-oe/recipes-devtools/breakpad/breakpad/0005-Import-necessary-definitions-from-stab.h.patch
new file mode 100644
index 000000000..80de8c684
--- /dev/null
+++ b/meta-oe/recipes-devtools/breakpad/breakpad/0005-Import-necessary-definitions-from-stab.h.patch
@@ -0,0 +1,199 @@
1From fa7a3b7312307acad0045549d5f306e7fd117804 Mon Sep 17 00:00:00 2001
2From: Felix Janda <felix.janda@posteo.de>
3Date: Sun, 1 Feb 2015 14:34:44 +0100
4Subject: [PATCH 5/6] Import necessary definitions from stab.h
5
6---
7 configure.ac | 1 -
8 src/common/android/include/stab.h | 100 ------------------------------------
9 src/common/common.gyp | 1 -
10 src/common/stabs_reader.cc | 1 -
11 src/common/stabs_reader.h | 13 +++--
12 src/common/stabs_reader_unittest.cc | 1 -
13 6 files changed, 10 insertions(+), 107 deletions(-)
14 delete mode 100644 src/common/android/include/stab.h
15
16diff --git a/configure.ac b/configure.ac
17index 2223920..0e55cd9 100644
18--- a/configure.ac
19+++ b/configure.ac
20@@ -73,7 +73,6 @@ AC_HEADER_STDC
21 AC_SYS_LARGEFILE
22 m4_include(m4/ax_pthread.m4)
23 AX_PTHREAD
24-AC_CHECK_HEADERS([a.out.h])
25
26 # Only build Linux client libs when compiling for Linux
27 case $host in
28diff --git a/src/common/android/include/stab.h b/src/common/android/include/stab.h
29deleted file mode 100644
30index cd92902..0000000
31--- a/src/common/android/include/stab.h
32+++ /dev/null
33@@ -1,100 +0,0 @@
34-// Copyright (c) 2012, Google Inc.
35-// All rights reserved.
36-//
37-// Redistribution and use in source and binary forms, with or without
38-// modification, are permitted provided that the following conditions are
39-// met:
40-//
41-// * Redistributions of source code must retain the above copyright
42-// notice, this list of conditions and the following disclaimer.
43-// * Redistributions in binary form must reproduce the above
44-// copyright notice, this list of conditions and the following disclaimer
45-// in the documentation and/or other materials provided with the
46-// distribution.
47-// * Neither the name of Google Inc. nor the names of its
48-// contributors may be used to endorse or promote products derived from
49-// this software without specific prior written permission.
50-//
51-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
52-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
53-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
54-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
55-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
56-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
57-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
58-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
59-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
60-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
61-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62-
63-#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_STAB_H
64-#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_STAB_H
65-
66-#include <sys/cdefs.h>
67-
68-#ifdef __BIONIC_HAVE_STAB_H
69-#include <stab.h>
70-#else
71-
72-#ifdef __cplusplus
73-extern "C" {
74-#endif // __cplusplus
75-
76-#define _STAB_CODE_LIST \
77- _STAB_CODE_DEF(UNDF,0x00) \
78- _STAB_CODE_DEF(GSYM,0x20) \
79- _STAB_CODE_DEF(FNAME,0x22) \
80- _STAB_CODE_DEF(FUN,0x24) \
81- _STAB_CODE_DEF(STSYM,0x26) \
82- _STAB_CODE_DEF(LCSYM,0x28) \
83- _STAB_CODE_DEF(MAIN,0x2a) \
84- _STAB_CODE_DEF(PC,0x30) \
85- _STAB_CODE_DEF(NSYMS,0x32) \
86- _STAB_CODE_DEF(NOMAP,0x34) \
87- _STAB_CODE_DEF(OBJ,0x38) \
88- _STAB_CODE_DEF(OPT,0x3c) \
89- _STAB_CODE_DEF(RSYM,0x40) \
90- _STAB_CODE_DEF(M2C,0x42) \
91- _STAB_CODE_DEF(SLINE,0x44) \
92- _STAB_CODE_DEF(DSLINE,0x46) \
93- _STAB_CODE_DEF(BSLINE,0x48) \
94- _STAB_CODE_DEF(BROWS,0x48) \
95- _STAB_CODE_DEF(DEFD,0x4a) \
96- _STAB_CODE_DEF(EHDECL,0x50) \
97- _STAB_CODE_DEF(MOD2,0x50) \
98- _STAB_CODE_DEF(CATCH,0x54) \
99- _STAB_CODE_DEF(SSYM,0x60) \
100- _STAB_CODE_DEF(SO,0x64) \
101- _STAB_CODE_DEF(LSYM,0x80) \
102- _STAB_CODE_DEF(BINCL,0x82) \
103- _STAB_CODE_DEF(SOL,0x84) \
104- _STAB_CODE_DEF(PSYM,0xa0) \
105- _STAB_CODE_DEF(EINCL,0xa2) \
106- _STAB_CODE_DEF(ENTRY,0xa4) \
107- _STAB_CODE_DEF(LBRAC,0xc0) \
108- _STAB_CODE_DEF(EXCL,0xc2) \
109- _STAB_CODE_DEF(SCOPE,0xc4) \
110- _STAB_CODE_DEF(RBRAC,0xe0) \
111- _STAB_CODE_DEF(BCOMM,0xe2) \
112- _STAB_CODE_DEF(ECOMM,0xe4) \
113- _STAB_CODE_DEF(ECOML,0xe8) \
114- _STAB_CODE_DEF(NBTEXT,0xf0) \
115- _STAB_CODE_DEF(NBDATA,0xf2) \
116- _STAB_CODE_DEF(NBBSS,0xf4) \
117- _STAB_CODE_DEF(NBSTS,0xf6) \
118- _STAB_CODE_DEF(NBLCS,0xf8) \
119- _STAB_CODE_DEF(LENG,0xfe)
120-
121-enum __stab_debug_code {
122-#define _STAB_CODE_DEF(x,y) N_##x = y,
123-_STAB_CODE_LIST
124-#undef _STAB_CODE_DEF
125-};
126-
127-#ifdef __cplusplus
128-} // extern "C"
129-#endif // __cplusplus
130-
131-#endif // __BIONIC_HAVE_STAB_H
132-
133-#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_STAB_H
134diff --git a/src/common/common.gyp b/src/common/common.gyp
135index f01ede5..c49ff85 100644
136--- a/src/common/common.gyp
137+++ b/src/common/common.gyp
138@@ -46,7 +46,6 @@
139 'android/include/elf.h',
140 'android/include/link.h',
141 'android/include/sgidefs.h',
142- 'android/include/stab.h',
143 'android/include/sys/procfs.h',
144 'android/include/sys/signal.h',
145 'android/include/sys/user.h',
146diff --git a/src/common/stabs_reader.cc b/src/common/stabs_reader.cc
147index 6019fc7..9562caa 100644
148--- a/src/common/stabs_reader.cc
149+++ b/src/common/stabs_reader.cc
150@@ -34,7 +34,6 @@
151 #include "common/stabs_reader.h"
152
153 #include <assert.h>
154-#include <stab.h>
155 #include <string.h>
156
157 #include <string>
158diff --git a/src/common/stabs_reader.h b/src/common/stabs_reader.h
159index d89afc0..591f007 100644
160--- a/src/common/stabs_reader.h
161+++ b/src/common/stabs_reader.h
162@@ -53,12 +53,19 @@
163 #include <config.h>
164 #endif
165
166-#ifdef HAVE_A_OUT_H
167-#include <a.out.h>
168-#endif
169 #ifdef HAVE_MACH_O_NLIST_H
170 #include <mach-o/nlist.h>
171 #endif
172+// Definitions from <stab.h> and <a.out.h> for systems which
173+// do not have them
174+#undef N_UNDF
175+#define N_UNDF 0x0
176+#define N_FUN 0x24
177+#define N_SLINE 0x44
178+#define N_SO 0x64
179+#define N_LSYM 0x80
180+#define N_BINCL 0x82
181+#define N_SOL 0x84
182
183 #include <string>
184 #include <vector>
185diff --git a/src/common/stabs_reader_unittest.cc b/src/common/stabs_reader_unittest.cc
186index a84da1c..854ac42 100644
187--- a/src/common/stabs_reader_unittest.cc
188+++ b/src/common/stabs_reader_unittest.cc
189@@ -33,7 +33,6 @@
190
191 #include <assert.h>
192 #include <errno.h>
193-#include <stab.h>
194 #include <stdarg.h>
195 #include <stdlib.h>
196 #include <string.h>
197--
1982.0.5
199
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad/0005-md2core-Replace-basename.patch b/meta-oe/recipes-devtools/breakpad/breakpad/0005-md2core-Replace-basename.patch
new file mode 100644
index 000000000..852c1ed2c
--- /dev/null
+++ b/meta-oe/recipes-devtools/breakpad/breakpad/0005-md2core-Replace-basename.patch
@@ -0,0 +1,38 @@
1From bbf2b5ed5d93b227df8aea5726727b48e29f6790 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 14 Sep 2017 23:35:40 -0700
4Subject: [PATCH 5/5] md2core: Replace basename()
5
6musl does not provide it
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 src/tools/linux/md2core/minidump-2-core.cc | 5 ++++-
11 1 file changed, 4 insertions(+), 1 deletion(-)
12
13diff --git a/src/tools/linux/md2core/minidump-2-core.cc b/src/tools/linux/md2core/minidump-2-core.cc
14index 6a9e28eb..52b81c22 100644
15--- a/src/tools/linux/md2core/minidump-2-core.cc
16+++ b/src/tools/linux/md2core/minidump-2-core.cc
17@@ -107,6 +107,9 @@ struct Options {
18
19 static void
20 Usage(int argc, const char* argv[]) {
21+ const char *c_filename = argv[0];;
22+ const char *p = strrchr(c_filename, '/');
23+ const char *base = p ? p+1 : c_filename;
24 fprintf(stderr,
25 "Usage: %s [options] <minidump file>\n"
26 "\n"
27@@ -133,7 +136,7 @@ Usage(int argc, const char* argv[]) {
28 " lookups to be done in this directory rather than the filesystem\n"
29 " layout as it exists in the crashing image. This path should end\n"
30 " with a slash if it's a directory. e.g. /var/lib/breakpad/\n"
31- "", basename(argv[0]));
32+ "", base);
33 }
34
35 static void
36--
372.14.1
38
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad_git.bb b/meta-oe/recipes-devtools/breakpad/breakpad_git.bb
index a4f149143..9a1255594 100644
--- a/meta-oe/recipes-devtools/breakpad/breakpad_git.bb
+++ b/meta-oe/recipes-devtools/breakpad/breakpad_git.bb
@@ -17,22 +17,30 @@ PE = "1"
17 17
18PV = "1.0+git${SRCPV}" 18PV = "1.0+git${SRCPV}"
19 19
20SRCREV_FORMAT = "breakpad_glog_gtest_protobuf_lss_gyp" 20SRCREV_FORMAT = "breakpad_gtest_protobuf_lss_gyp"
21 21
22SRCREV_breakpad = "66856d617b6658ce09ef2bc1b15d457ab7b152b0" 22SRCREV_breakpad = "dea867e76f24e4a68395684b9d1cf24bcef82f20"
23SRCREV_glog = "d8cb47f77d1c31779f3ff890e1a5748483778d6a"
24SRCREV_gtest = "ec44c6c1675c25b9827aacd08c02433cccde7780" 23SRCREV_gtest = "ec44c6c1675c25b9827aacd08c02433cccde7780"
25SRCREV_protobuf = "cb6dd4ef5f82e41e06179dcd57d3b1d9246ad6ac" 24SRCREV_protobuf = "cb6dd4ef5f82e41e06179dcd57d3b1d9246ad6ac"
26SRCREV_lss = "a91633d172407f6c83dd69af11510b37afebb7f9" 25SRCREV_lss = "a91633d172407f6c83dd69af11510b37afebb7f9"
27SRCREV_gyp = "e8ab0833a42691cd2184bd4c45d779e43821d3e0" 26SRCREV_gyp = "324dd166b7c0b39d513026fa52d6280ac6d56770"
28 27
29SRC_URI = "git://github.com/google/breakpad;name=breakpad \ 28SRC_URI = "git://github.com/google/breakpad;name=breakpad \
30 git://github.com/google/glog.git;destsuffix=git/src/third_party/glog;name=glog \
31 git://github.com/google/googletest.git;destsuffix=git/src/testing/gtest;name=gtest \ 29 git://github.com/google/googletest.git;destsuffix=git/src/testing/gtest;name=gtest \
32 git://github.com/google/protobuf.git;destsuffix=git/src/third_party/protobuf/protobuf;name=protobuf \ 30 git://github.com/google/protobuf.git;destsuffix=git/src/third_party/protobuf/protobuf;name=protobuf \
33 git://chromium.googlesource.com/linux-syscall-support;protocol=https;destsuffix=git/src/third_party/lss;name=lss \ 31 git://chromium.googlesource.com/linux-syscall-support;protocol=https;destsuffix=git/src/third_party/lss;name=lss \
34 git://chromium.googlesource.com/external/gyp;protocol=https;destsuffix=git/src/tools/gyp;name=gyp \ 32 git://chromium.googlesource.com/external/gyp;protocol=https;destsuffix=git/src/tools/gyp;name=gyp \
35 file://0001-Replace-use-of-struct-ucontext-with-ucontext_t.patch \ 33 file://0001-Replace-use-of-struct-ucontext-with-ucontext_t.patch \
34 file://0001-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch \
35 file://0002-Avoid-using-basename.patch \
36 file://0003-Fix-conflict-between-musl-libc-dirent.h-and-lss.patch \
37 file://0001-Turn-off-sign-compare-for-musl-libc.patch \
38 file://0002-sys-signal.h-is-a-nonportable-alias-for-signal.h.patch \
39 file://0003-Dont-include-stab.h.patch \
40 file://0004-elf_reader.cc-include-sys-reg.h-to-get-__WORDSIZE-on.patch \
41 file://0005-md2core-Replace-basename.patch \
42 file://0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch \
43 file://0001-lss-Match-syscalls-to-match-musl.patch;patchdir=src/third_party/lss \
36" 44"
37S = "${WORKDIR}/git" 45S = "${WORKDIR}/git"
38 46