From 5465f3e79f961abcf911586ddd3a41c13e1906cb Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 13 Feb 2019 09:51:14 -0800 Subject: [PATCH] breakpad: Fix build with musl elf_core_dump.h:59:2: error: "Unsupported __WORDSIZE for ElfCoreDump." #error "Unsupported __WORDSIZE for ElfCoreDump." ^ Upstream-Status: Pending Signed-off-by: Khem Raj --- .../breakpad/src/client/linux/handler/exception_handler.cc | 6 +++++- .../breakpad/breakpad/src/common/linux/elf_core_dump.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc index 36de9be320..bdd31b5172 100644 --- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc +++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc @@ -488,8 +488,10 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) { // ExceptionHandler::HandleSignal(). siginfo.si_code = SI_USER; siginfo.si_pid = getpid(); - ucontext_t context; + ucontext_t context = {0}; +#if defined(__GLIBC__) getcontext(&context); +#endif return HandleSignal(sig, &siginfo, &context); } @@ -674,9 +676,11 @@ bool ExceptionHandler::WriteMinidump() { sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0); CrashContext context; +#if defined(__GLIBC__) int getcontext_result = getcontext(&context.context); if (getcontext_result) return false; +#endif #if defined(__i386__) // In CPUFillFromUContext in minidumpwriter.cc the stack pointer is retrieved diff --git a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h index 4f27179f47..343e950530 100644 --- a/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h +++ b/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h @@ -36,6 +36,7 @@ #include #include #include +#include #include "common/memory_range.h"