added my Recipes
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
From 5c63eb5d56abd4e5232add4727247965a863d851 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sun, 15 Dec 2019 14:02:45 -0800
|
||||
Subject: [PATCH] Do not add stack pointer to clobber list
|
||||
|
||||
It was being ignored until now when gcc 9.0 became capable
|
||||
of flagging these silent ignore via [1].
|
||||
|
||||
We weren't actually clobbering the stack pointers here
|
||||
so it should not cause change in behavior.
|
||||
|
||||
[1] https://gcc.gnu.org/PR52813
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
linux_syscall_support.h | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/linux_syscall_support.h b/linux_syscall_support.h
|
||||
index 9276f56..6e73309 100644
|
||||
--- a/linux_syscall_support.h
|
||||
+++ b/linux_syscall_support.h
|
||||
@@ -1955,7 +1955,7 @@ struct kernel_statfs {
|
||||
LSS_ENTRYPOINT \
|
||||
"pop %%ebx" \
|
||||
args \
|
||||
- : "esp", "memory"); \
|
||||
+ : "memory"); \
|
||||
LSS_RETURN(type,__res)
|
||||
#undef _syscall0
|
||||
#define _syscall0(type,name) \
|
||||
@@ -2012,7 +2012,7 @@ struct kernel_statfs {
|
||||
: "i" (__NR_##name), "ri" ((long)(arg1)), \
|
||||
"c" ((long)(arg2)), "d" ((long)(arg3)), \
|
||||
"S" ((long)(arg4)), "D" ((long)(arg5)) \
|
||||
- : "esp", "memory"); \
|
||||
+ : "memory"); \
|
||||
LSS_RETURN(type,__res); \
|
||||
}
|
||||
#undef _syscall6
|
||||
@@ -2034,7 +2034,7 @@ struct kernel_statfs {
|
||||
: "i" (__NR_##name), "0" ((long)(&__s)), \
|
||||
"c" ((long)(arg2)), "d" ((long)(arg3)), \
|
||||
"S" ((long)(arg4)), "D" ((long)(arg5)) \
|
||||
- : "esp", "memory"); \
|
||||
+ : "memory"); \
|
||||
LSS_RETURN(type,__res); \
|
||||
}
|
||||
LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
|
||||
@@ -2120,7 +2120,7 @@ struct kernel_statfs {
|
||||
: "0"(-EINVAL), "i"(__NR_clone),
|
||||
"m"(fn), "m"(child_stack), "m"(flags), "m"(arg),
|
||||
"m"(parent_tidptr), "m"(newtls), "m"(child_tidptr)
|
||||
- : "esp", "memory", "ecx", "edx", "esi", "edi");
|
||||
+ : "memory", "ecx", "edx", "esi", "edi");
|
||||
LSS_RETURN(int, __res);
|
||||
}
|
||||
|
||||
--
|
||||
2.24.1
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
From 70441611d4e8200d9d16dfed493873b8c1bb57c5 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Mon, 15 Mar 2021 11:33:38 -0700
|
||||
Subject: [PATCH] Remove HAVE_GETCONTEXT check to add local implementation
|
||||
|
||||
On musl getcontext/setcontext APIs are implemented in libucontext which
|
||||
can be used
|
||||
|
||||
Upstream-Status: Inappropriate [Musl Specific]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Makefile.am | 12 ------------
|
||||
1 file changed, 12 deletions(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index ee7454e4..69700192 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -187,10 +187,6 @@ src_client_linux_libbreakpad_client_a_SOURCES = \
|
||||
src/common/linux/linux_libc_support.cc \
|
||||
src/common/linux/memory_mapped_file.cc \
|
||||
src/common/linux/safe_readlink.cc
|
||||
-if !HAVE_GETCONTEXT
|
||||
-src_client_linux_libbreakpad_client_a_SOURCES += \
|
||||
- src/common/linux/breakpad_getcontext.S
|
||||
-endif
|
||||
endif LINUX_HOST
|
||||
|
||||
if !DISABLE_PROCESSOR
|
||||
@@ -508,10 +504,6 @@ src_client_linux_linux_client_unittest_shlib_SOURCES = \
|
||||
src/processor/minidump.cc \
|
||||
src/processor/pathname_stripper.cc \
|
||||
src/processor/proc_maps_linux.cc
|
||||
-if !HAVE_GETCONTEXT
|
||||
-src_client_linux_linux_client_unittest_shlib_SOURCES += \
|
||||
- src/common/linux/breakpad_getcontext.S
|
||||
-endif
|
||||
|
||||
src_client_linux_linux_client_unittest_shlib_CPPFLAGS = \
|
||||
$(AM_CPPFLAGS) $(TEST_CFLAGS)
|
||||
@@ -541,10 +533,6 @@ src_client_linux_linux_client_unittest_shlib_LDADD = \
|
||||
src/common/string_conversion.o \
|
||||
$(TEST_LIBS) \
|
||||
$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
|
||||
-if !HAVE_GETCONTEXT
|
||||
-src_client_linux_linux_client_unittest_shlib_SOURCES += \
|
||||
- src/common/linux/breakpad_getcontext_unittest.cc
|
||||
-endif
|
||||
if ANDROID_HOST
|
||||
src_client_linux_linux_client_unittest_shlib_LDFLAGS += \
|
||||
-llog -lm
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From ab8dcad25d0ac1f3a88814e78794e5d450de15ac Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Thu, 14 Sep 2017 23:12:51 -0700
|
||||
Subject: [PATCH 1/5] Turn off sign-compare for musl-libc
|
||||
|
||||
Fix
|
||||
|
||||
../../../../../../../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)) { ^~~~~~~~~~~~~~~~~~~~~~
|
||||
/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.
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/client/linux/crash_generation/crash_generation_server.cc | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
--- a/src/client/linux/crash_generation/crash_generation_server.cc
|
||||
+++ b/src/client/linux/crash_generation/crash_generation_server.cc
|
||||
@@ -230,8 +230,18 @@ CrashGenerationServer::ClientEvent(short
|
||||
// Walk the control payload and extract the file descriptor and validated pid.
|
||||
pid_t crashing_pid = -1;
|
||||
int signal_fd = -1;
|
||||
+#ifndef __GLIBC__
|
||||
+ // In musl-libc, CMSG_NXTHDR typecasts char* to cmsghdr* which causes
|
||||
+ // clang to throw sign-compare warning. This is to suppress the warning
|
||||
+ // inline.
|
||||
+ #pragma clang diagnostic push
|
||||
+ #pragma clang diagnostic ignored "-Wsign-compare"
|
||||
+#endif
|
||||
for (struct cmsghdr* hdr = CMSG_FIRSTHDR(&msg); hdr;
|
||||
hdr = CMSG_NXTHDR(&msg, hdr)) {
|
||||
+#ifndef __GLIBC__
|
||||
+ #pragma clang diagnostic pop
|
||||
+#endif
|
||||
if (hdr->cmsg_level != SOL_SOCKET)
|
||||
continue;
|
||||
if (hdr->cmsg_type == SCM_RIGHTS) {
|
||||
@@ -0,0 +1,34 @@
|
||||
From 66a2b6e4ba8e2b49115043127ce4aa0fcd71ad1e Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Tue, 11 May 2021 11:12:35 -0700
|
||||
Subject: [PATCH] exception_handler.cc: Match the types for SIGSTKSZ
|
||||
|
||||
In glibc 2.34, SIGSTKSZ is a syscall which returns a long int, therefore
|
||||
current check fails
|
||||
|
||||
| ../git/src/client/linux/handler/exception_handler.cc:141:49: error: no matching function for call to 'max(int, long int)'
|
||||
| 141 | static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
|
||||
| | ~~~~~~~~^~~~~~~~~~~~~~~~~
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/client/linux/handler/exception_handler.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc
|
||||
index ca353c40..dc0fc4a9 100644
|
||||
--- a/src/client/linux/handler/exception_handler.cc
|
||||
+++ b/src/client/linux/handler/exception_handler.cc
|
||||
@@ -138,7 +138,7 @@ void InstallAlternateStackLocked() {
|
||||
// SIGSTKSZ may be too small to prevent the signal handlers from overrunning
|
||||
// the alternative stack. Ensure that the size of the alternative stack is
|
||||
// large enough.
|
||||
- static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
|
||||
+ static const unsigned kSigStackSize = std::max(16384u, (unsigned)SIGSTKSZ);
|
||||
|
||||
// Only set an alternative stack if there isn't already one, or if the current
|
||||
// one is too small.
|
||||
--
|
||||
2.31.1
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From 68580cb62f77117be3164c52abae68f75e8e59a1 Mon Sep 17 00:00:00 2001
|
||||
From: Felix Janda <felix.janda@posteo.de>
|
||||
Date: Sun, 1 Feb 2015 14:26:52 +0100
|
||||
Subject: [PATCH 1/3] include <sys/reg.h> to get __WORDSIZE on musl libc
|
||||
|
||||
---
|
||||
src/common/linux/elf_core_dump.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/src/common/linux/elf_core_dump.h
|
||||
+++ b/src/common/linux/elf_core_dump.h
|
||||
@@ -33,10 +33,14 @@
|
||||
#ifndef COMMON_LINUX_ELF_CORE_DUMP_H_
|
||||
#define COMMON_LINUX_ELF_CORE_DUMP_H_
|
||||
|
||||
+#include <config.h>
|
||||
#include <elf.h>
|
||||
#include <limits.h>
|
||||
#include <link.h>
|
||||
#include <stddef.h>
|
||||
+#ifdef HAVE_SYS_REG_H
|
||||
+#include <sys/reg.h>
|
||||
+#endif
|
||||
|
||||
#include "common/memory_range.h"
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
From 5f7333e4f7b7485598bd71aa80967e1a16a7f901 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Thu, 14 Sep 2017 22:57:52 -0700
|
||||
Subject: [PATCH] lss: Match syscalls to match musl
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
linux_syscall_support.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
--- a/linux_syscall_support.h
|
||||
+++ b/linux_syscall_support.h
|
||||
@@ -816,6 +816,9 @@ struct kernel_statfs {
|
||||
#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
|
||||
#endif
|
||||
|
||||
+#ifndef __NR_fstatat
|
||||
+#define __NR_fstatat __NR_fstatat64
|
||||
+#endif
|
||||
|
||||
#if defined(__x86_64__)
|
||||
#ifndef ARCH_SET_GS
|
||||
@@ -947,6 +950,7 @@ struct kernel_statfs {
|
||||
#ifndef __NR_fallocate
|
||||
#define __NR_fallocate 324
|
||||
#endif
|
||||
+
|
||||
/* End of i386 definitions */
|
||||
#elif defined(__ARM_ARCH_3__) || defined(__ARM_EABI__)
|
||||
#ifndef __NR_setresuid
|
||||
@@ -1239,6 +1243,12 @@ struct kernel_statfs {
|
||||
#ifndef __NR_fallocate
|
||||
#define __NR_fallocate 285
|
||||
#endif
|
||||
+#ifndef __NR_pread
|
||||
+#define __NR_pread __NR_pread64
|
||||
+#endif
|
||||
+#ifndef __NR_pwrite
|
||||
+#define __NR_pwrite __NR_pwrite64
|
||||
+#endif
|
||||
/* End of x86-64 definitions */
|
||||
#elif defined(__mips__)
|
||||
#if _MIPS_SIM == _MIPS_SIM_ABI32
|
||||
@@ -1418,6 +1428,12 @@ struct kernel_statfs {
|
||||
#ifndef __NR_ioprio_get
|
||||
#define __NR_ioprio_get (__NR_Linux + 274)
|
||||
#endif
|
||||
+
|
||||
+#undef __NR_pread
|
||||
+#define __NR_pread __NR_pread64
|
||||
+#undef __NR_pwrite
|
||||
+#define __NR_pwrite __NR_pwrite64
|
||||
+
|
||||
/* End of MIPS (64bit API) definitions */
|
||||
#else
|
||||
#ifndef __NR_setresuid
|
||||
@@ -0,0 +1,30 @@
|
||||
From 7ea7ded187b4d739239f3ab7082fcd5a2ccc1eaa Mon Sep 17 00:00:00 2001
|
||||
From: mingtaoxt xt <mingtaoxt@gmail.com>
|
||||
Date: Wed, 19 Oct 2022 19:36:13 +0800
|
||||
Subject: [PATCH] mainline version gcc-13 cannot use "uintptr_t" via "#include <string>"
|
||||
|
||||
Change-Id: I0049bb92658b4226e32783ad4d8271787deef5f3
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3964166
|
||||
Reviewed-by: Mike Frysinger <vapier@chromium.org>
|
||||
|
||||
Upstream-Status: Backport [https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3964166]
|
||||
Signed-of-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/client/linux/handler/minidump_descriptor.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/client/linux/handler/minidump_descriptor.h b/src/client/linux/handler/minidump_descriptor.h
|
||||
index 4349b88f..d822c9d9 100644
|
||||
--- a/src/client/linux/handler/minidump_descriptor.h
|
||||
+++ b/src/client/linux/handler/minidump_descriptor.h
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <assert.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
+#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#include "client/linux/handler/microdump_extra_info.h"
|
||||
--
|
||||
2.39.1
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From 569af712da94637091080943f6a0d69ccb35864e Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Thu, 14 Sep 2017 23:24:08 -0700
|
||||
Subject: [PATCH 3/5] Dont include stab.h
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/common/stabs_reader.cc | 1 -
|
||||
src/common/stabs_reader.h | 12 +++++++++++-
|
||||
src/common/stabs_reader_unittest.cc | 1 -
|
||||
3 files changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/src/common/stabs_reader.cc
|
||||
+++ b/src/common/stabs_reader.cc
|
||||
@@ -34,7 +34,9 @@
|
||||
#include "common/stabs_reader.h"
|
||||
|
||||
#include <assert.h>
|
||||
+#ifdef HAVE_STAB_H
|
||||
#include <stab.h>
|
||||
+#endif
|
||||
#include <string.h>
|
||||
|
||||
#include <string>
|
||||
--- a/src/common/stabs_reader.h
|
||||
+++ b/src/common/stabs_reader.h
|
||||
@@ -58,6 +58,30 @@
|
||||
#elif defined(HAVE_A_OUT_H)
|
||||
#include <a.out.h>
|
||||
#endif
|
||||
+// Definitions from <stab.h> and <a.out.h> for systems which
|
||||
+// do not have them
|
||||
+#ifndef HAVE_A_OUT_H
|
||||
+#undef N_UNDF
|
||||
+#define N_UNDF 0x0
|
||||
+#ifndef N_FUN
|
||||
+#define N_FUN 0x24
|
||||
+#endif
|
||||
+#ifndef N_SLINE
|
||||
+#define N_SLINE 0x44
|
||||
+#endif
|
||||
+#ifndef N_SO
|
||||
+#define N_SO 0x64
|
||||
+#endif
|
||||
+#ifndef N_LSYM
|
||||
+#define N_LSYM 0x80
|
||||
+#endif
|
||||
+#ifndef N_BINCL
|
||||
+#define N_BINCL 0x82
|
||||
+#endif
|
||||
+#ifndef N_SOL
|
||||
+#define N_SOL 0x84
|
||||
+#endif
|
||||
+#endif
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
--- a/src/common/stabs_reader_unittest.cc
|
||||
+++ b/src/common/stabs_reader_unittest.cc
|
||||
@@ -33,7 +33,9 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
+#ifdef HAVE_STAB_H
|
||||
#include <stab.h>
|
||||
+#endif
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -72,7 +72,7 @@ AC_ARG_ENABLE(m32,
|
||||
AC_HEADER_STDC
|
||||
AC_SYS_LARGEFILE
|
||||
AX_PTHREAD
|
||||
-AC_CHECK_HEADERS([a.out.h sys/mman.h sys/random.h])
|
||||
+AC_CHECK_HEADERS([a.out.h stab.h sys/mman.h sys/random.h])
|
||||
AC_CHECK_FUNCS([arc4random getcontext getrandom memfd_create])
|
||||
AM_CONDITIONAL([HAVE_GETCONTEXT], [test "x$ac_cv_func_getcontext" = xyes])
|
||||
AM_CONDITIONAL([HAVE_MEMFD_CREATE], [test "x$ac_cv_func_memfd_create" = xyes])
|
||||
@@ -0,0 +1,35 @@
|
||||
From 7aa266545dabf9934ccd44d4fc836040497159be Mon Sep 17 00:00:00 2001
|
||||
From: Felix Janda <felix.janda@posteo.de>
|
||||
Date: Sun, 1 Feb 2015 13:41:08 +0100
|
||||
Subject: [PATCH 3/3] Fix conflict between musl libc <dirent.h> and lss
|
||||
|
||||
Include <dirent.h> late to avoid the macro getdents64 in musl
|
||||
libc's <dirent.h> to conflict with linux_sycall_support.h.
|
||||
---
|
||||
src/client/linux/crash_generation/crash_generation_server.cc | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/client/linux/crash_generation/crash_generation_server.cc b/src/client/linux/crash_generation/crash_generation_server.cc
|
||||
index 26c50a5c..2596afde 100644
|
||||
--- a/src/client/linux/crash_generation/crash_generation_server.cc
|
||||
+++ b/src/client/linux/crash_generation/crash_generation_server.cc
|
||||
@@ -28,7 +28,6 @@
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <assert.h>
|
||||
-#include <dirent.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <poll.h>
|
||||
@@ -49,6 +48,8 @@
|
||||
#include "common/linux/guid_creator.h"
|
||||
#include "common/linux/safe_readlink.h"
|
||||
|
||||
+#include <dirent.h>
|
||||
+
|
||||
static const char kCommandQuit = 'x';
|
||||
|
||||
namespace google_breakpad {
|
||||
--
|
||||
2.14.1
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
From 680f9590d19a6e35c7c5587e3f4d8194aab0fcd2 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Thu, 14 Sep 2017 23:28:36 -0700
|
||||
Subject: [PATCH 4/5] elf_reader.cc: include <sys/reg.h> to get __WORDSIZE on
|
||||
musl libc
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/common/dwarf/elf_reader.cc | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/src/common/dwarf/elf_reader.cc
|
||||
+++ b/src/common/dwarf/elf_reader.cc
|
||||
@@ -30,12 +30,16 @@
|
||||
#define _GNU_SOURCE // needed for pread()
|
||||
#endif
|
||||
|
||||
+#include <config.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
+#ifdef HAVE_SYS_REG_H
|
||||
+#include <sys/reg.h>
|
||||
+#endif
|
||||
#include <unistd.h>
|
||||
|
||||
#include <algorithm>
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -72,7 +72,7 @@ AC_ARG_ENABLE(m32,
|
||||
AC_HEADER_STDC
|
||||
AC_SYS_LARGEFILE
|
||||
AX_PTHREAD
|
||||
-AC_CHECK_HEADERS([a.out.h stab.h sys/mman.h sys/random.h])
|
||||
+AC_CHECK_HEADERS([a.out.h stab.h sys/mman.h sys/random.h sys/reg.h])
|
||||
AC_CHECK_FUNCS([arc4random getcontext getrandom memfd_create])
|
||||
AM_CONDITIONAL([HAVE_GETCONTEXT], [test "x$ac_cv_func_getcontext" = xyes])
|
||||
AM_CONDITIONAL([HAVE_MEMFD_CREATE], [test "x$ac_cv_func_memfd_create" = xyes])
|
||||
@@ -0,0 +1,18 @@
|
||||
map the mcontext_t structure for musl
|
||||
|
||||
Upstream-Status: Inappropriate [need to consider Android]
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Index: git/src/client/linux/minidump_writer/linux_core_dumper.cc
|
||||
===================================================================
|
||||
--- git.orig/src/client/linux/minidump_writer/linux_core_dumper.cc
|
||||
+++ git/src/client/linux/minidump_writer/linux_core_dumper.cc
|
||||
@@ -196,7 +196,7 @@ bool LinuxCoreDumper::EnumerateThreads()
|
||||
info.tgid = status->pr_pgrp;
|
||||
info.ppid = status->pr_ppid;
|
||||
#if defined(__mips__)
|
||||
-#if defined(__ANDROID__)
|
||||
+#if defined(__ANDROID__) || !defined(__GLIBC__)
|
||||
for (int i = EF_R0; i <= EF_R31; i++)
|
||||
info.mcontext.gregs[i - EF_R0] = status->pr_reg[i];
|
||||
#else // __ANDROID__
|
||||
@@ -0,0 +1,17 @@
|
||||
--- a/linux_syscall_support.h
|
||||
+++ b/linux_syscall_support.h
|
||||
@@ -119,14 +119,7 @@ extern "C" {
|
||||
|
||||
#ifdef __mips__
|
||||
/* Include definitions of the ABI currently in use. */
|
||||
-#ifdef __ANDROID__
|
||||
-/* Android doesn't have sgidefs.h, but does have asm/sgidefs.h,
|
||||
- * which has the definitions we need.
|
||||
- */
|
||||
#include <asm/sgidefs.h>
|
||||
-#else
|
||||
-#include <sgidefs.h>
|
||||
-#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
# Released under the MIT license (see COPYING.MIT for the terms)
|
||||
|
||||
# Applications using this library needs to add link against libbreakpad_client.a.
|
||||
|
||||
SUMMARY = "An open-source multi-platform crash reporting system"
|
||||
DESCRIPTION = "Breakpad is a library and tool suite that allows you to distribute an application to users with compiler-provided debugging information removed, record crashes in compact \"minidump\" files, send them back to your server, and produce C and C++ stack traces from these minidumps. "
|
||||
HOMEPAGE = "https://code.google.com/p/google-breakpad/"
|
||||
LICENSE = "BSD-3-Clause"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=8bb274ebd1901085fd71a8d8afe8831b"
|
||||
SECTION = "libs"
|
||||
|
||||
inherit autotools
|
||||
|
||||
DEPENDS:append:libc-musl = " libucontext"
|
||||
|
||||
BBCLASSEXTEND = "native"
|
||||
|
||||
PE = "2"
|
||||
|
||||
PV = "1.0"
|
||||
|
||||
SRCREV_FORMAT = "breakpad_gtest_protobuf_lss_gyp"
|
||||
|
||||
SRCREV_breakpad = "8b22babdf894e5aa98b2dbbe103f7e3856a71944"
|
||||
#v1.10.0
|
||||
SRCREV_gtest = "4fe018038f87675c083d0cfb6a6b57c274fb1753"
|
||||
SRCREV_protobuf = "cb6dd4ef5f82e41e06179dcd57d3b1d9246ad6ac"
|
||||
SRCREV_lss = "fd00dbbd0c06a309c657d89e9430143b179ff6db"
|
||||
SRCREV_gyp = "324dd166b7c0b39d513026fa52d6280ac6d56770"
|
||||
|
||||
SRC_URI = "git://github.com/google/breakpad;name=breakpad;branch=main;protocol=https \
|
||||
git://github.com/google/googletest.git;destsuffix=git/src/testing/gtest;name=gtest;branch=main;protocol=https \
|
||||
git://github.com/protocolbuffers/protobuf.git;destsuffix=git/src/third_party/protobuf/protobuf;name=protobuf;branch=master;protocol=https \
|
||||
git://chromium.googlesource.com/linux-syscall-support;protocol=https;branch=main;destsuffix=git/src/third_party/lss;name=lss \
|
||||
git://chromium.googlesource.com/external/gyp;protocol=https;destsuffix=git/src/tools/gyp;name=gyp;branch=master \
|
||||
file://0001-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch \
|
||||
file://0003-Fix-conflict-between-musl-libc-dirent.h-and-lss.patch \
|
||||
file://0001-Turn-off-sign-compare-for-musl-libc.patch \
|
||||
file://0003-Dont-include-stab.h.patch \
|
||||
file://0004-elf_reader.cc-include-sys-reg.h-to-get-__WORDSIZE-on.patch \
|
||||
file://mcontext.patch \
|
||||
file://0001-Remove-HAVE_GETCONTEXT-check-to-add-local-implementa.patch \
|
||||
file://0001-exception_handler.cc-Match-the-types-for-SIGSTKSZ.patch \
|
||||
file://0001-mainline-version-gcc-13-cannot-use-uintptr_t-via-inc.patch \
|
||||
file://0001-lss-Match-syscalls-to-match-musl.patch;patchdir=src/third_party/lss \
|
||||
file://mips_asm_sgidefs.patch;patchdir=src/third_party/lss \
|
||||
file://0001-Do-not-add-stack-pointer-to-clobber-list.patch;patchdir=src/third_party/lss \
|
||||
"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
CXXFLAGS += "-D_GNU_SOURCE"
|
||||
LDFLAGS:append:libc-musl = " -lucontext"
|
||||
|
||||
COMPATIBLE_HOST:powerpc = "null"
|
||||
COMPATIBLE_HOST:powerpc64 = "null"
|
||||
COMPATIBLE_HOST:powerpc64le = "null"
|
||||
COMPATIBLE_HOST:riscv64 = "null"
|
||||
COMPATIBLE_HOST:riscv32 = "null"
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}${includedir}
|
||||
install -d ${D}${includedir}/breakpad
|
||||
|
||||
install -d ${D}${includedir}/breakpad/client/linux/crash_generation
|
||||
install -m 0644 ${S}/src/client/linux/crash_generation/crash_generation_client.h ${D}${includedir}/breakpad/client/linux/crash_generation/crash_generation_client.h
|
||||
|
||||
install -d ${D}${includedir}/breakpad/client/linux/handler/
|
||||
install -m 0644 ${S}/src/client/linux/handler/exception_handler.h ${D}${includedir}/breakpad/client/linux/handler/exception_handler.h
|
||||
install -m 0644 ${S}/src/client/linux/handler/minidump_descriptor.h ${D}${includedir}/breakpad/client/linux/handler/minidump_descriptor.h
|
||||
|
||||
install -d ${D}${includedir}/breakpad/client/linux/dump_writer_common
|
||||
install -m 0644 ${S}/src/client/linux/dump_writer_common/mapping_info.h ${D}${includedir}/breakpad/client/linux/dump_writer_common/mapping_info.h
|
||||
install -m 0644 ${S}/src/client/linux/dump_writer_common/thread_info.h ${D}${includedir}/breakpad/client/linux/dump_writer_common/thread_info.h
|
||||
install -m 0644 ${S}/src/client/linux/dump_writer_common/raw_context_cpu.h ${D}${includedir}/breakpad/client/linux/dump_writer_common/raw_context_cpu.h
|
||||
|
||||
install -d ${D}${includedir}/breakpad/client/linux/minidump_writer
|
||||
install -m 0644 ${S}/src/client/linux/minidump_writer/linux_dumper.h ${D}${includedir}/breakpad/client/linux/minidump_writer/linux_dumper.h
|
||||
install -m 0644 ${S}/src/client/linux/minidump_writer/minidump_writer.h ${D}${includedir}/breakpad/client/linux/minidump_writer/minidump_writer.h
|
||||
|
||||
install -d ${D}${includedir}/breakpad/common
|
||||
install -m 0644 ${S}/src/common/memory_allocator.h ${D}${includedir}/breakpad/common/memory_allocator.h
|
||||
install -m 0644 ${S}/src/common/scoped_ptr.h ${D}${includedir}/breakpad/common/scoped_ptr.h
|
||||
install -m 0644 ${S}/src/common/using_std_string.h ${D}${includedir}/breakpad/common/using_std_string.h
|
||||
|
||||
install -d ${D}${includedir}/breakpad/google_breakpad/common
|
||||
install -m 0644 ${S}/src/google_breakpad/common/breakpad_types.h ${D}${includedir}/breakpad/google_breakpad/common/breakpad_types.h
|
||||
install -m 0644 ${S}/src/google_breakpad/common/minidump_format.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_format.h
|
||||
install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_amd64.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_amd64.h
|
||||
install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_arm.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_arm.h
|
||||
install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_arm64.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_arm64.h
|
||||
install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_mips.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_mips.h
|
||||
install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_ppc64.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_ppc64.h
|
||||
install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_ppc.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_ppc.h
|
||||
install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_sparc.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_sparc.h
|
||||
install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_x86.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_x86.h
|
||||
install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_linux.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_linux.h
|
||||
install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_mac.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_mac.h
|
||||
install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_ps3.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_ps3.h
|
||||
install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_solaris.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_solaris.h
|
||||
install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_win32.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_win32.h
|
||||
|
||||
install -d ${D}${includedir}/breakpad/third_party/lss
|
||||
install -m 0644 ${S}/src/third_party/lss/linux_syscall_support.h ${D}${includedir}/breakpad/third_party/lss/linux_syscall_support.h
|
||||
}
|
||||
|
||||
PACKAGES =+ "${PN}-minidump-upload ${PN}-sym-upload"
|
||||
|
||||
FILES:${PN}-minidump-upload = "${bindir}/minidump_upload"
|
||||
FILES:${PN}-sym-upload = "${bindir}/sym_upload"
|
||||
|
||||
|
||||
SYSROOT_PREPROCESS_FUNCS += "breakpad_populate_sysroot"
|
||||
breakpad_populate_sysroot() {
|
||||
sysroot_stage_dir ${D}/usr/include ${SYSROOT_DESTDIR}/usr/include
|
||||
sysroot_stage_dir ${D}/usr/lib ${SYSROOT_DESTDIR}/usr/lib
|
||||
sysroot_stage_dir ${D}/usr/lib ${SYSROOT_DESTDIR}/usr/lib
|
||||
}
|
||||
|
||||
# Fails to build with thumb-1 (qemuarm)
|
||||
#| {standard input}: Assembler messages:
|
||||
#| {standard input}:2178: Error: selected processor does not support Thumb mode `it ne'
|
||||
#| {standard input}:2179: Error: Thumb does not support conditional execution
|
||||
#| {standard input}:2180: Error: selected processor does not support Thumb mode `it eq'
|
||||
#| {standard input}:2181: Error: Thumb does not support conditional execution
|
||||
#| {standard input}:2183: Error: lo register required -- `str ip,[r1,#-4]!'
|
||||
#| {standard input}:2184: Error: Thumb does not support this addressing mode -- `str r6,[r1,#-4]!'
|
||||
#| {standard input}:2191: Error: lo register required -- `ldr pc,[sp]'
|
||||
#| make: *** [src/client/linux/handler/exception_handler.o] Error 1
|
||||
ARM_INSTRUCTION_SET:armv5 = "arm"
|
||||
ARM_INSTRUCTION_SET:armv4 = "arm"
|
||||
|
||||
TOOLCHAIN = "gcc"
|
||||
Reference in New Issue
Block a user