From 1c022c95875e1604cd1a73ea03dd72a7d797f8e2 Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Sun, 6 Oct 2019 16:51:48 -0700 Subject: [PATCH] Get our copy of breakpad, such as it is, building against NDK R15C - Likely we should "soon" upgrade breakpad/crashpad and the NDK to a mutually agreed-upon version --- external/breakpad/android/google_breakpad/Android.mk | 2 +- .../breakpad/src/client/linux/handler/exception_handler.cc | 5 +++++ external/breakpad/src/common/android/include/link.h | 2 ++ external/breakpad/src/common/android/include/sys/user.h | 4 ++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/external/breakpad/android/google_breakpad/Android.mk b/external/breakpad/android/google_breakpad/Android.mk index 9a105349..b45a5906 100644 --- a/external/breakpad/android/google_breakpad/Android.mk +++ b/external/breakpad/android/google_breakpad/Android.mk @@ -96,7 +96,7 @@ LOCAL_SRC_FILES := \ # Embedded stackwalker sources (to be able to process crashes in-situ on Android device) ifeq ($(EMBEDDED_STACKWALKER),1) -LOCAL_CPPFLAGS += -DEMBEDDED_STACKWALKER=1 -frtti +LOCAL_CPPFLAGS += -DAPPLE2IX -DEMBEDDED_STACKWALKER=1 -frtti LOCAL_SRC_FILES += \ src/processor/basic_code_modules.cc \ src/processor/basic_source_line_resolver.cc \ diff --git a/external/breakpad/src/client/linux/handler/exception_handler.cc b/external/breakpad/src/client/linux/handler/exception_handler.cc index b63f973b..da204b6d 100644 --- a/external/breakpad/src/client/linux/handler/exception_handler.cc +++ b/external/breakpad/src/client/linux/handler/exception_handler.cc @@ -106,7 +106,12 @@ #endif // A wrapper for the tgkill syscall: send a signal to a specific thread. +#if APPLE2IX +#define tgkill _tgkill +static int _tgkill(pid_t tgid, pid_t tid, int sig) { +#else static int tgkill(pid_t tgid, pid_t tid, int sig) { +#endif return syscall(__NR_tgkill, tgid, tid, sig); return 0; } diff --git a/external/breakpad/src/common/android/include/link.h b/external/breakpad/src/common/android/include/link.h index e7ff8e2d..f0cdccfc 100644 --- a/external/breakpad/src/common/android/include/link.h +++ b/external/breakpad/src/common/android/include/link.h @@ -43,6 +43,7 @@ extern "C" { #endif // __cplusplus +#if !APPLE2IX struct r_debug { int r_version; struct link_map* r_map; @@ -61,6 +62,7 @@ struct link_map { struct link_map* l_next; struct link_map* l_prev; }; +#endif // !APPLE2IX #ifdef __cplusplus } // extern "C" diff --git a/external/breakpad/src/common/android/include/sys/user.h b/external/breakpad/src/common/android/include/sys/user.h index 5f036047..b9000c01 100644 --- a/external/breakpad/src/common/android/include/sys/user.h +++ b/external/breakpad/src/common/android/include/sys/user.h @@ -46,7 +46,9 @@ #ifdef __cplusplus extern "C" { #endif // __cplusplus +#if !APPLE2IX typedef struct user_fxsr_struct user_fpxregs_struct; +#endif // !APPLE2IX #ifdef __cplusplus } // extern "C" #endif // __cplusplus @@ -56,6 +58,7 @@ typedef struct user_fxsr_struct user_fpxregs_struct; #ifdef __cplusplus extern "C" { #endif // __cplusplus +#if !APPLE2IX struct user_regs_struct { __u64 regs[31]; __u64 sp; @@ -67,6 +70,7 @@ struct user_fpsimd_struct { __u32 fpsr; __u32 fpcr; }; +#endif // !APPLE2IX #ifdef __cplusplus } // extern "C" #endif // __cplusplus