mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-05-31 13:20:03 +00:00
breakpad: Fix build with musl/mips
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
@@ -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;
|
||||
@@ -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")
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user