aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-09-21 20:23:16 -0700
committerMartin Jansa <Martin.Jansa@gmail.com>2017-10-02 12:34:40 +0000
commit4b6a4e91d05f2d295b60f763c21f6608d1a414be (patch)
treec5fd358c3f1349a0e77bb6095eb15abe86bd83b2
parent6d231956fbfb0d85aa5dc72a52b086699befd210 (diff)
downloadmeta-openembedded-contrib-4b6a4e91d05f2d295b60f763c21f6608d1a414be.tar.gz
meta-openembedded-contrib-4b6a4e91d05f2d295b60f763c21f6608d1a414be.tar.bz2
meta-openembedded-contrib-4b6a4e91d05f2d295b60f763c21f6608d1a414be.zip
breakpad: Fix build with musl/mips
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta-oe/recipes-devtools/breakpad/breakpad/mcontext.patch77
-rw-r--r--meta-oe/recipes-devtools/breakpad/breakpad/mips_asm_sgidefs.patch9
-rw-r--r--meta-oe/recipes-devtools/breakpad/breakpad_git.bb3
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 @@
+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/dump_writer_common/thread_info.cc
+===================================================================
+--- git.orig/src/client/linux/dump_writer_common/thread_info.cc
++++ git/src/client/linux/dump_writer_common/thread_info.cc
+@@ -229,7 +229,6 @@ void ThreadInfo::FillCPUContext(RawConte
+ }
+
+ #elif defined(__mips__)
+-
+ uintptr_t ThreadInfo::GetInstructionPointer() const {
+ return mcontext.pc;
+ }
+@@ -263,8 +262,11 @@ void ThreadInfo::FillCPUContext(RawConte
+ out->cause = 0; // Not stored in mcontext
+
+ for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i)
++#ifdef __GLIBC__
+ out->float_save.regs[i] = mcontext.fpregs.fp_r.fp_fregs[i]._fp_fregs;
+-
++#else
++ out->float_save.regs[i] = mcontext.fpregs[i];
++#endif
+ out->float_save.fpcsr = mcontext.fpc_csr;
+ #if _MIPS_SIM == _ABIO32
+ out->float_save.fir = mcontext.fpc_eir;
+Index: git/src/client/linux/dump_writer_common/ucontext_reader.cc
+===================================================================
+--- git.orig/src/client/linux/dump_writer_common/ucontext_reader.cc
++++ git/src/client/linux/dump_writer_common/ucontext_reader.cc
+@@ -247,8 +247,11 @@ void UContextReader::FillCPUContext(RawC
+ out->cause = 0; // Not reported in signal context.
+
+ for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i)
++#ifdef __GLIBC__
+ out->float_save.regs[i] = uc->uc_mcontext.fpregs.fp_r.fp_dregs[i];
+-
++#else
++ out->float_save.regs[i] = uc->uc_mcontext.fpregs[i];
++#endif
+ out->float_save.fpcsr = uc->uc_mcontext.fpc_csr;
+ #if _MIPS_SIM == _ABIO32
+ out->float_save.fir = uc->uc_mcontext.fpc_eir; // Unused.
+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__
+Index: git/src/tools/linux/md2core/minidump-2-core.cc
+===================================================================
+--- git.orig/src/tools/linux/md2core/minidump-2-core.cc
++++ git/src/tools/linux/md2core/minidump-2-core.cc
+@@ -516,8 +516,12 @@ ParseThreadRegisters(CrashedProcess::Thr
+ thread->mcontext.lo3 = rawregs->lo[2];
+
+ for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i) {
++#ifdef __GLIBC__
+ thread->mcontext.fpregs.fp_r.fp_fregs[i]._fp_fregs =
+ rawregs->float_save.regs[i];
++#else
++ thread->mcontext.fpregs[i] = rawregs->float_save.regs[i];
++#endif
+ }
+
+ 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
===================================================================
--- lss.orig/linux_syscall_support.h
+++ lss/linux_syscall_support.h
-@@ -118,15 +118,7 @@ extern "C" {
+@@ -118,21 +118,13 @@ extern "C" {
#include <endian.h>
#ifdef __mips__
@@ -18,3 +18,10 @@ Index: lss/linux_syscall_support.h
#endif
#endif
+ /* The Android NDK's <sys/stat.h> #defines these macros as aliases
+ * to their non-64 counterparts. To avoid naming conflict, remove them. */
+-#ifdef __ANDROID__
++#if defined(__ANDROID__) || (defined(__linux__) && !defined(__glibc__))
+ /* These are restored by the corresponding #pragma pop_macro near
+ * the end of this file. */
+ # 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 \
file://0004-elf_reader.cc-include-sys-reg.h-to-get-__WORDSIZE-on.patch \
file://0005-md2core-Replace-basename.patch \
file://0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch \
+ file://mcontext.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 \
"
S = "${WORKDIR}/git"
+CXXFLAGS += "-D_GNU_SOURCE"
+
COMPATIBLE_MACHINE_powerpc = "(!.*ppc).*"
do_install_append() {