diff options
3 files changed, 88 insertions, 1 deletions
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad/mcontext.patch b/meta-oe/recipes-devtools/breakpad/breakpad/mcontext.patch new file mode 100644 index 0000000000..42e073b94d --- /dev/null +++ b/meta-oe/recipes-devtools/breakpad/breakpad/mcontext.patch | |||
| @@ -0,0 +1,77 @@ | |||
| 1 | map the mcontext_t structure for musl | ||
| 2 | |||
| 3 | Upstream-Status: Inappropriate[need to consider Android] | ||
| 4 | |||
| 5 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 6 | Index: git/src/client/linux/dump_writer_common/thread_info.cc | ||
| 7 | =================================================================== | ||
| 8 | --- git.orig/src/client/linux/dump_writer_common/thread_info.cc | ||
| 9 | +++ git/src/client/linux/dump_writer_common/thread_info.cc | ||
| 10 | @@ -229,7 +229,6 @@ void ThreadInfo::FillCPUContext(RawConte | ||
| 11 | } | ||
| 12 | |||
| 13 | #elif defined(__mips__) | ||
| 14 | - | ||
| 15 | uintptr_t ThreadInfo::GetInstructionPointer() const { | ||
| 16 | return mcontext.pc; | ||
| 17 | } | ||
| 18 | @@ -263,8 +262,11 @@ void ThreadInfo::FillCPUContext(RawConte | ||
| 19 | out->cause = 0; // Not stored in mcontext | ||
| 20 | |||
| 21 | for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i) | ||
| 22 | +#ifdef __GLIBC__ | ||
| 23 | out->float_save.regs[i] = mcontext.fpregs.fp_r.fp_fregs[i]._fp_fregs; | ||
| 24 | - | ||
| 25 | +#else | ||
| 26 | + out->float_save.regs[i] = mcontext.fpregs[i]; | ||
| 27 | +#endif | ||
| 28 | out->float_save.fpcsr = mcontext.fpc_csr; | ||
| 29 | #if _MIPS_SIM == _ABIO32 | ||
| 30 | out->float_save.fir = mcontext.fpc_eir; | ||
| 31 | Index: git/src/client/linux/dump_writer_common/ucontext_reader.cc | ||
| 32 | =================================================================== | ||
| 33 | --- git.orig/src/client/linux/dump_writer_common/ucontext_reader.cc | ||
| 34 | +++ git/src/client/linux/dump_writer_common/ucontext_reader.cc | ||
| 35 | @@ -247,8 +247,11 @@ void UContextReader::FillCPUContext(RawC | ||
| 36 | out->cause = 0; // Not reported in signal context. | ||
| 37 | |||
| 38 | for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i) | ||
| 39 | +#ifdef __GLIBC__ | ||
| 40 | out->float_save.regs[i] = uc->uc_mcontext.fpregs.fp_r.fp_dregs[i]; | ||
| 41 | - | ||
| 42 | +#else | ||
| 43 | + out->float_save.regs[i] = uc->uc_mcontext.fpregs[i]; | ||
| 44 | +#endif | ||
| 45 | out->float_save.fpcsr = uc->uc_mcontext.fpc_csr; | ||
| 46 | #if _MIPS_SIM == _ABIO32 | ||
| 47 | out->float_save.fir = uc->uc_mcontext.fpc_eir; // Unused. | ||
| 48 | Index: git/src/client/linux/minidump_writer/linux_core_dumper.cc | ||
| 49 | =================================================================== | ||
| 50 | --- git.orig/src/client/linux/minidump_writer/linux_core_dumper.cc | ||
| 51 | +++ git/src/client/linux/minidump_writer/linux_core_dumper.cc | ||
| 52 | @@ -196,7 +196,7 @@ bool LinuxCoreDumper::EnumerateThreads() | ||
| 53 | info.tgid = status->pr_pgrp; | ||
| 54 | info.ppid = status->pr_ppid; | ||
| 55 | #if defined(__mips__) | ||
| 56 | -#if defined(__ANDROID__) | ||
| 57 | +#if defined(__ANDROID__) || !defined(__GLIBC__) | ||
| 58 | for (int i = EF_R0; i <= EF_R31; i++) | ||
| 59 | info.mcontext.gregs[i - EF_R0] = status->pr_reg[i]; | ||
| 60 | #else // __ANDROID__ | ||
| 61 | Index: git/src/tools/linux/md2core/minidump-2-core.cc | ||
| 62 | =================================================================== | ||
| 63 | --- git.orig/src/tools/linux/md2core/minidump-2-core.cc | ||
| 64 | +++ git/src/tools/linux/md2core/minidump-2-core.cc | ||
| 65 | @@ -516,8 +516,12 @@ ParseThreadRegisters(CrashedProcess::Thr | ||
| 66 | thread->mcontext.lo3 = rawregs->lo[2]; | ||
| 67 | |||
| 68 | for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i) { | ||
| 69 | +#ifdef __GLIBC__ | ||
| 70 | thread->mcontext.fpregs.fp_r.fp_fregs[i]._fp_fregs = | ||
| 71 | rawregs->float_save.regs[i]; | ||
| 72 | +#else | ||
| 73 | + thread->mcontext.fpregs[i] = rawregs->float_save.regs[i]; | ||
| 74 | +#endif | ||
| 75 | } | ||
| 76 | |||
| 77 | thread->mcontext.fpc_csr = rawregs->float_save.fpcsr; | ||
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad/mips_asm_sgidefs.patch b/meta-oe/recipes-devtools/breakpad/breakpad/mips_asm_sgidefs.patch index 678f63d74a..19bb560445 100644 --- a/meta-oe/recipes-devtools/breakpad/breakpad/mips_asm_sgidefs.patch +++ b/meta-oe/recipes-devtools/breakpad/breakpad/mips_asm_sgidefs.patch | |||
| @@ -2,7 +2,7 @@ Index: lss/linux_syscall_support.h | |||
| 2 | =================================================================== | 2 | =================================================================== |
| 3 | --- lss.orig/linux_syscall_support.h | 3 | --- lss.orig/linux_syscall_support.h |
| 4 | +++ lss/linux_syscall_support.h | 4 | +++ lss/linux_syscall_support.h |
| 5 | @@ -118,15 +118,7 @@ extern "C" { | 5 | @@ -118,21 +118,13 @@ extern "C" { |
| 6 | #include <endian.h> | 6 | #include <endian.h> |
| 7 | 7 | ||
| 8 | #ifdef __mips__ | 8 | #ifdef __mips__ |
| @@ -18,3 +18,10 @@ Index: lss/linux_syscall_support.h | |||
| 18 | #endif | 18 | #endif |
| 19 | #endif | 19 | #endif |
| 20 | 20 | ||
| 21 | /* The Android NDK's <sys/stat.h> #defines these macros as aliases | ||
| 22 | * to their non-64 counterparts. To avoid naming conflict, remove them. */ | ||
| 23 | -#ifdef __ANDROID__ | ||
| 24 | +#if defined(__ANDROID__) || (defined(__linux__) && !defined(__glibc__)) | ||
| 25 | /* These are restored by the corresponding #pragma pop_macro near | ||
| 26 | * the end of this file. */ | ||
| 27 | # pragma push_macro("stat64") | ||
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad_git.bb b/meta-oe/recipes-devtools/breakpad/breakpad_git.bb index 1ddd6b5655..a17759eb42 100644 --- a/meta-oe/recipes-devtools/breakpad/breakpad_git.bb +++ b/meta-oe/recipes-devtools/breakpad/breakpad_git.bb | |||
| @@ -40,11 +40,14 @@ SRC_URI = "git://github.com/google/breakpad;name=breakpad \ | |||
| 40 | file://0004-elf_reader.cc-include-sys-reg.h-to-get-__WORDSIZE-on.patch \ | 40 | file://0004-elf_reader.cc-include-sys-reg.h-to-get-__WORDSIZE-on.patch \ |
| 41 | file://0005-md2core-Replace-basename.patch \ | 41 | file://0005-md2core-Replace-basename.patch \ |
| 42 | file://0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch \ | 42 | file://0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch \ |
| 43 | file://mcontext.patch \ | ||
| 43 | file://0001-lss-Match-syscalls-to-match-musl.patch;patchdir=src/third_party/lss \ | 44 | file://0001-lss-Match-syscalls-to-match-musl.patch;patchdir=src/third_party/lss \ |
| 44 | file://mips_asm_sgidefs.patch;patchdir=src/third_party/lss \ | 45 | file://mips_asm_sgidefs.patch;patchdir=src/third_party/lss \ |
| 45 | " | 46 | " |
| 46 | S = "${WORKDIR}/git" | 47 | S = "${WORKDIR}/git" |
| 47 | 48 | ||
| 49 | CXXFLAGS += "-D_GNU_SOURCE" | ||
| 50 | |||
| 48 | COMPATIBLE_MACHINE_powerpc = "(!.*ppc).*" | 51 | COMPATIBLE_MACHINE_powerpc = "(!.*ppc).*" |
| 49 | 52 | ||
| 50 | do_install_append() { | 53 | do_install_append() { |
