diff options
| author | Khem Raj <raj.khem@gmail.com> | 2017-06-28 21:52:52 -0700 |
|---|---|---|
| committer | Martin Jansa <Martin.Jansa@gmail.com> | 2017-07-01 09:59:27 +0200 |
| commit | 52919077a3e47bf96a41e4d8471e7b7bb7311031 (patch) | |
| tree | 23169a9510b79c8c07906924ff95f2ed1d9268fa | |
| parent | 905cdd0eac7f513d14746aafbda6b4c3b35ef8d1 (diff) | |
| download | meta-openembedded-52919077a3e47bf96a41e4d8471e7b7bb7311031.tar.gz | |
breakpad: Upgrade to latest and fix use of ucontext_t
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/0001-Replace-use-of-struct-ucontext-with-ucontext_t.patch | 242 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/breakpad/breakpad_git.bb | 11 |
2 files changed, 248 insertions, 5 deletions
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad/0001-Replace-use-of-struct-ucontext-with-ucontext_t.patch b/meta-oe/recipes-devtools/breakpad/breakpad/0001-Replace-use-of-struct-ucontext-with-ucontext_t.patch new file mode 100644 index 0000000000..07cb8a366e --- /dev/null +++ b/meta-oe/recipes-devtools/breakpad/breakpad/0001-Replace-use-of-struct-ucontext-with-ucontext_t.patch | |||
| @@ -0,0 +1,242 @@ | |||
| 1 | From b90c8f3b60bfe5dbed2823620242e9d30b9eb28f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 28 Jun 2017 19:01:18 -0700 | ||
| 4 | Subject: [PATCH] Replace use of struct ucontext with ucontext_t | ||
| 5 | |||
| 6 | glibc 2.26 would not expose struct ucontext anymore | ||
| 7 | |||
| 8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 9 | --- | ||
| 10 | Upstream-Status: Pending | ||
| 11 | |||
| 12 | .../linux/dump_writer_common/ucontext_reader.cc | 32 +++++++++++----------- | ||
| 13 | .../linux/dump_writer_common/ucontext_reader.h | 14 +++++----- | ||
| 14 | src/client/linux/handler/exception_handler.cc | 10 +++---- | ||
| 15 | src/client/linux/handler/exception_handler.h | 4 +-- | ||
| 16 | .../linux/microdump_writer/microdump_writer.cc | 2 +- | ||
| 17 | .../linux/minidump_writer/minidump_writer.cc | 2 +- | ||
| 18 | 6 files changed, 32 insertions(+), 32 deletions(-) | ||
| 19 | |||
| 20 | diff --git a/src/client/linux/dump_writer_common/ucontext_reader.cc b/src/client/linux/dump_writer_common/ucontext_reader.cc | ||
| 21 | index c80724dd..052ce37c 100644 | ||
| 22 | --- a/src/client/linux/dump_writer_common/ucontext_reader.cc | ||
| 23 | +++ b/src/client/linux/dump_writer_common/ucontext_reader.cc | ||
| 24 | @@ -36,19 +36,19 @@ namespace google_breakpad { | ||
| 25 | |||
| 26 | // Minidump defines register structures which are different from the raw | ||
| 27 | // structures which we get from the kernel. These are platform specific | ||
| 28 | -// functions to juggle the ucontext and user structures into minidump format. | ||
| 29 | +// functions to juggle the ucontext_t and user structures into minidump format. | ||
| 30 | |||
| 31 | #if defined(__i386__) | ||
| 32 | |||
| 33 | -uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { | ||
| 34 | +uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { | ||
| 35 | return uc->uc_mcontext.gregs[REG_ESP]; | ||
| 36 | } | ||
| 37 | |||
| 38 | -uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { | ||
| 39 | +uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { | ||
| 40 | return uc->uc_mcontext.gregs[REG_EIP]; | ||
| 41 | } | ||
| 42 | |||
| 43 | -void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, | ||
| 44 | +void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, | ||
| 45 | const struct _libc_fpstate* fp) { | ||
| 46 | const greg_t* regs = uc->uc_mcontext.gregs; | ||
| 47 | |||
| 48 | @@ -88,15 +88,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, | ||
| 49 | |||
| 50 | #elif defined(__x86_64) | ||
| 51 | |||
| 52 | -uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { | ||
| 53 | +uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { | ||
| 54 | return uc->uc_mcontext.gregs[REG_RSP]; | ||
| 55 | } | ||
| 56 | |||
| 57 | -uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { | ||
| 58 | +uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { | ||
| 59 | return uc->uc_mcontext.gregs[REG_RIP]; | ||
| 60 | } | ||
| 61 | |||
| 62 | -void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, | ||
| 63 | +void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, | ||
| 64 | const struct _libc_fpstate* fpregs) { | ||
| 65 | const greg_t* regs = uc->uc_mcontext.gregs; | ||
| 66 | |||
| 67 | @@ -145,15 +145,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, | ||
| 68 | |||
| 69 | #elif defined(__ARM_EABI__) | ||
| 70 | |||
| 71 | -uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { | ||
| 72 | +uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { | ||
| 73 | return uc->uc_mcontext.arm_sp; | ||
| 74 | } | ||
| 75 | |||
| 76 | -uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { | ||
| 77 | +uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { | ||
| 78 | return uc->uc_mcontext.arm_pc; | ||
| 79 | } | ||
| 80 | |||
| 81 | -void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) { | ||
| 82 | +void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) { | ||
| 83 | out->context_flags = MD_CONTEXT_ARM_FULL; | ||
| 84 | |||
| 85 | out->iregs[0] = uc->uc_mcontext.arm_r0; | ||
| 86 | @@ -184,15 +184,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) { | ||
| 87 | |||
| 88 | #elif defined(__aarch64__) | ||
| 89 | |||
| 90 | -uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { | ||
| 91 | +uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { | ||
| 92 | return uc->uc_mcontext.sp; | ||
| 93 | } | ||
| 94 | |||
| 95 | -uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { | ||
| 96 | +uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { | ||
| 97 | return uc->uc_mcontext.pc; | ||
| 98 | } | ||
| 99 | |||
| 100 | -void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, | ||
| 101 | +void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, | ||
| 102 | const struct fpsimd_context* fpregs) { | ||
| 103 | out->context_flags = MD_CONTEXT_ARM64_FULL; | ||
| 104 | |||
| 105 | @@ -210,15 +210,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, | ||
| 106 | |||
| 107 | #elif defined(__mips__) | ||
| 108 | |||
| 109 | -uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { | ||
| 110 | +uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { | ||
| 111 | return uc->uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]; | ||
| 112 | } | ||
| 113 | |||
| 114 | -uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { | ||
| 115 | +uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { | ||
| 116 | return uc->uc_mcontext.pc; | ||
| 117 | } | ||
| 118 | |||
| 119 | -void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) { | ||
| 120 | +void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) { | ||
| 121 | #if _MIPS_SIM == _ABI64 | ||
| 122 | out->context_flags = MD_CONTEXT_MIPS64_FULL; | ||
| 123 | #elif _MIPS_SIM == _ABIO32 | ||
| 124 | diff --git a/src/client/linux/dump_writer_common/ucontext_reader.h b/src/client/linux/dump_writer_common/ucontext_reader.h | ||
| 125 | index b6e77b4b..2de80b70 100644 | ||
| 126 | --- a/src/client/linux/dump_writer_common/ucontext_reader.h | ||
| 127 | +++ b/src/client/linux/dump_writer_common/ucontext_reader.h | ||
| 128 | @@ -39,23 +39,23 @@ | ||
| 129 | |||
| 130 | namespace google_breakpad { | ||
| 131 | |||
| 132 | -// Wraps platform-dependent implementations of accessors to ucontext structs. | ||
| 133 | +// Wraps platform-dependent implementations of accessors to ucontext_t structs. | ||
| 134 | struct UContextReader { | ||
| 135 | - static uintptr_t GetStackPointer(const struct ucontext* uc); | ||
| 136 | + static uintptr_t GetStackPointer(const ucontext_t* uc); | ||
| 137 | |||
| 138 | - static uintptr_t GetInstructionPointer(const struct ucontext* uc); | ||
| 139 | + static uintptr_t GetInstructionPointer(const ucontext_t* uc); | ||
| 140 | |||
| 141 | - // Juggle a arch-specific ucontext into a minidump format | ||
| 142 | + // Juggle a arch-specific ucontext_t into a minidump format | ||
| 143 | // out: the minidump structure | ||
| 144 | // info: the collection of register structures. | ||
| 145 | #if defined(__i386__) || defined(__x86_64) | ||
| 146 | - static void FillCPUContext(RawContextCPU *out, const ucontext *uc, | ||
| 147 | + static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc, | ||
| 148 | const struct _libc_fpstate* fp); | ||
| 149 | #elif defined(__aarch64__) | ||
| 150 | - static void FillCPUContext(RawContextCPU *out, const ucontext *uc, | ||
| 151 | + static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc, | ||
| 152 | const struct fpsimd_context* fpregs); | ||
| 153 | #else | ||
| 154 | - static void FillCPUContext(RawContextCPU *out, const ucontext *uc); | ||
| 155 | + static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc); | ||
| 156 | #endif | ||
| 157 | }; | ||
| 158 | |||
| 159 | diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc | ||
| 160 | index 586d84e9..05936d28 100644 | ||
| 161 | --- a/src/client/linux/handler/exception_handler.cc | ||
| 162 | +++ b/src/client/linux/handler/exception_handler.cc | ||
| 163 | @@ -457,9 +457,9 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) { | ||
| 164 | // Fill in all the holes in the struct to make Valgrind happy. | ||
| 165 | memset(&g_crash_context_, 0, sizeof(g_crash_context_)); | ||
| 166 | memcpy(&g_crash_context_.siginfo, info, sizeof(siginfo_t)); | ||
| 167 | - memcpy(&g_crash_context_.context, uc, sizeof(struct ucontext)); | ||
| 168 | + memcpy(&g_crash_context_.context, uc, sizeof(ucontext_t)); | ||
| 169 | #if defined(__aarch64__) | ||
| 170 | - struct ucontext* uc_ptr = (struct ucontext*)uc; | ||
| 171 | + ucontext_t* uc_ptr = (ucontext_t*)uc; | ||
| 172 | struct fpsimd_context* fp_ptr = | ||
| 173 | (struct fpsimd_context*)&uc_ptr->uc_mcontext.__reserved; | ||
| 174 | if (fp_ptr->head.magic == FPSIMD_MAGIC) { | ||
| 175 | @@ -468,9 +468,9 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) { | ||
| 176 | } | ||
| 177 | #elif !defined(__ARM_EABI__) && !defined(__mips__) | ||
| 178 | // FP state is not part of user ABI on ARM Linux. | ||
| 179 | - // In case of MIPS Linux FP state is already part of struct ucontext | ||
| 180 | + // In case of MIPS Linux FP state is already part of ucontext_t | ||
| 181 | // and 'float_state' is not a member of CrashContext. | ||
| 182 | - struct ucontext* uc_ptr = (struct ucontext*)uc; | ||
| 183 | + ucontext_t* uc_ptr = (ucontext_t*)uc; | ||
| 184 | if (uc_ptr->uc_mcontext.fpregs) { | ||
| 185 | memcpy(&g_crash_context_.float_state, uc_ptr->uc_mcontext.fpregs, | ||
| 186 | sizeof(g_crash_context_.float_state)); | ||
| 187 | @@ -494,7 +494,7 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) { | ||
| 188 | // ExceptionHandler::HandleSignal(). | ||
| 189 | siginfo.si_code = SI_USER; | ||
| 190 | siginfo.si_pid = getpid(); | ||
| 191 | - struct ucontext context; | ||
| 192 | + ucontext_t context; | ||
| 193 | getcontext(&context); | ||
| 194 | return HandleSignal(sig, &siginfo, &context); | ||
| 195 | } | ||
| 196 | diff --git a/src/client/linux/handler/exception_handler.h b/src/client/linux/handler/exception_handler.h | ||
| 197 | index daba57e0..25598a29 100644 | ||
| 198 | --- a/src/client/linux/handler/exception_handler.h | ||
| 199 | +++ b/src/client/linux/handler/exception_handler.h | ||
| 200 | @@ -191,11 +191,11 @@ class ExceptionHandler { | ||
| 201 | struct CrashContext { | ||
| 202 | siginfo_t siginfo; | ||
| 203 | pid_t tid; // the crashing thread. | ||
| 204 | - struct ucontext context; | ||
| 205 | + ucontext_t context; | ||
| 206 | #if !defined(__ARM_EABI__) && !defined(__mips__) | ||
| 207 | // #ifdef this out because FP state is not part of user ABI for Linux ARM. | ||
| 208 | // In case of MIPS Linux FP state is already part of struct | ||
| 209 | - // ucontext so 'float_state' is not required. | ||
| 210 | + // ucontext_t so 'float_state' is not required. | ||
| 211 | fpstate_t float_state; | ||
| 212 | #endif | ||
| 213 | }; | ||
| 214 | diff --git a/src/client/linux/microdump_writer/microdump_writer.cc b/src/client/linux/microdump_writer/microdump_writer.cc | ||
| 215 | index 3764eec2..80ad5c46 100644 | ||
| 216 | --- a/src/client/linux/microdump_writer/microdump_writer.cc | ||
| 217 | +++ b/src/client/linux/microdump_writer/microdump_writer.cc | ||
| 218 | @@ -593,7 +593,7 @@ class MicrodumpWriter { | ||
| 219 | |||
| 220 | void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); } | ||
| 221 | |||
| 222 | - const struct ucontext* const ucontext_; | ||
| 223 | + const ucontext_t* const ucontext_; | ||
| 224 | #if !defined(__ARM_EABI__) && !defined(__mips__) | ||
| 225 | const google_breakpad::fpstate_t* const float_state_; | ||
| 226 | #endif | ||
| 227 | diff --git a/src/client/linux/minidump_writer/minidump_writer.cc b/src/client/linux/minidump_writer/minidump_writer.cc | ||
| 228 | index d11ba6e5..c7161434 100644 | ||
| 229 | --- a/src/client/linux/minidump_writer/minidump_writer.cc | ||
| 230 | +++ b/src/client/linux/minidump_writer/minidump_writer.cc | ||
| 231 | @@ -1323,7 +1323,7 @@ class MinidumpWriter { | ||
| 232 | const int fd_; // File descriptor where the minidum should be written. | ||
| 233 | const char* path_; // Path to the file where the minidum should be written. | ||
| 234 | |||
| 235 | - const struct ucontext* const ucontext_; // also from the signal handler | ||
| 236 | + const ucontext_t* const ucontext_; // also from the signal handler | ||
| 237 | #if !defined(__ARM_EABI__) && !defined(__mips__) | ||
| 238 | const google_breakpad::fpstate_t* const float_state_; // ditto | ||
| 239 | #endif | ||
| 240 | -- | ||
| 241 | 2.13.2 | ||
| 242 | |||
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad_git.bb b/meta-oe/recipes-devtools/breakpad/breakpad_git.bb index 36c2b63496..a4f1491432 100644 --- a/meta-oe/recipes-devtools/breakpad/breakpad_git.bb +++ b/meta-oe/recipes-devtools/breakpad/breakpad_git.bb | |||
| @@ -17,21 +17,22 @@ PE = "1" | |||
| 17 | 17 | ||
| 18 | PV = "1.0+git${SRCPV}" | 18 | PV = "1.0+git${SRCPV}" |
| 19 | 19 | ||
| 20 | SRCREV_FORMAT = "breakpad_glog_gmock_gtest_protobuf_lss" | 20 | SRCREV_FORMAT = "breakpad_glog_gtest_protobuf_lss_gyp" |
| 21 | 21 | ||
| 22 | SRCREV_breakpad = "2f6cb866d615d6240a18c7535c994c6bb93b1ba5" | 22 | SRCREV_breakpad = "66856d617b6658ce09ef2bc1b15d457ab7b152b0" |
| 23 | SRCREV_glog = "d8cb47f77d1c31779f3ff890e1a5748483778d6a" | 23 | SRCREV_glog = "d8cb47f77d1c31779f3ff890e1a5748483778d6a" |
| 24 | SRCREV_gmock = "f7d03d2734759ee12b57d2dbcb695607d89e8e05" | ||
| 25 | SRCREV_gtest = "ec44c6c1675c25b9827aacd08c02433cccde7780" | 24 | SRCREV_gtest = "ec44c6c1675c25b9827aacd08c02433cccde7780" |
| 26 | SRCREV_protobuf = "cb6dd4ef5f82e41e06179dcd57d3b1d9246ad6ac" | 25 | SRCREV_protobuf = "cb6dd4ef5f82e41e06179dcd57d3b1d9246ad6ac" |
| 27 | SRCREV_lss = "1549d20f6d3e7d66bb4e687c0ab9da42c2bff2ac" | 26 | SRCREV_lss = "a91633d172407f6c83dd69af11510b37afebb7f9" |
| 27 | SRCREV_gyp = "e8ab0833a42691cd2184bd4c45d779e43821d3e0" | ||
| 28 | 28 | ||
| 29 | SRC_URI = "git://github.com/google/breakpad;name=breakpad \ | 29 | SRC_URI = "git://github.com/google/breakpad;name=breakpad \ |
| 30 | git://github.com/google/glog.git;destsuffix=git/src/third_party/glog;name=glog \ | 30 | git://github.com/google/glog.git;destsuffix=git/src/third_party/glog;name=glog \ |
| 31 | git://github.com/google/googlemock.git;destsuffix=git/src/testing;name=gmock \ | ||
| 32 | git://github.com/google/googletest.git;destsuffix=git/src/testing/gtest;name=gtest \ | 31 | git://github.com/google/googletest.git;destsuffix=git/src/testing/gtest;name=gtest \ |
| 33 | git://github.com/google/protobuf.git;destsuffix=git/src/third_party/protobuf/protobuf;name=protobuf \ | 32 | git://github.com/google/protobuf.git;destsuffix=git/src/third_party/protobuf/protobuf;name=protobuf \ |
| 34 | git://chromium.googlesource.com/linux-syscall-support;protocol=https;destsuffix=git/src/third_party/lss;name=lss \ | 33 | git://chromium.googlesource.com/linux-syscall-support;protocol=https;destsuffix=git/src/third_party/lss;name=lss \ |
| 34 | git://chromium.googlesource.com/external/gyp;protocol=https;destsuffix=git/src/tools/gyp;name=gyp \ | ||
| 35 | file://0001-Replace-use-of-struct-ucontext-with-ucontext_t.patch \ | ||
| 35 | " | 36 | " |
| 36 | S = "${WORKDIR}/git" | 37 | S = "${WORKDIR}/git" |
| 37 | 38 | ||
