diff options
| -rw-r--r-- | meta-oe/recipes-devtools/breakpad/breakpad/0001-disable-calls-to-getcontext-with-musl.patch | 52 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/breakpad/breakpad_git.bb | 1 |
2 files changed, 53 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad/0001-disable-calls-to-getcontext-with-musl.patch b/meta-oe/recipes-devtools/breakpad/breakpad/0001-disable-calls-to-getcontext-with-musl.patch new file mode 100644 index 0000000000..c762754ad1 --- /dev/null +++ b/meta-oe/recipes-devtools/breakpad/breakpad/0001-disable-calls-to-getcontext-with-musl.patch | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | From 57ecf7205feedd23f901e1bb9d193787e559e433 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Andre McCurdy <armccurdy@gmail.com> | ||
| 3 | Date: Tue, 23 Jan 2018 15:13:26 -0800 | ||
| 4 | Subject: [PATCH] disable calls to getcontext() with musl | ||
| 5 | |||
| 6 | Signed-off-by: Andre McCurdy <armccurdy@gmail.com> | ||
| 7 | --- | ||
| 8 | src/client/linux/handler/exception_handler.cc | 17 +++++++++++++++++ | ||
| 9 | 1 file changed, 17 insertions(+) | ||
| 10 | |||
| 11 | diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc | ||
| 12 | index cca023f..f3e460c 100644 | ||
| 13 | --- a/src/client/linux/handler/exception_handler.cc | ||
| 14 | +++ b/src/client/linux/handler/exception_handler.cc | ||
| 15 | @@ -495,7 +495,19 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) { | ||
| 16 | siginfo.si_code = SI_USER; | ||
| 17 | siginfo.si_pid = getpid(); | ||
| 18 | ucontext_t context; | ||
| 19 | +#if defined(__GLIBC__) | ||
| 20 | getcontext(&context); | ||
| 21 | +#else | ||
| 22 | + // Extreme hack: Allow musl builds to compile - but don't expect them to work. | ||
| 23 | + // Although musl provides a definition for getcontext() in ucontext.h (which | ||
| 24 | + // enough to build libbreakpad_client) musl does not provide a corresponding | ||
| 25 | + // getcontext() function, so builds will fail when attempting to link anything | ||
| 26 | + // with libbreakpad_client. Disabling calls to getcontext() is a temporary | ||
| 27 | + // hack. The real fix is probably to enable Breakpad's own implementation of | ||
| 28 | + // getcontext() when building for musl (it's currently only enabled when | ||
| 29 | + // building for Android). | ||
| 30 | + memset (&context, 0, sizeof(context)); | ||
| 31 | +#endif | ||
| 32 | return HandleSignal(sig, &siginfo, &context); | ||
| 33 | } | ||
| 34 | |||
| 35 | @@ -680,9 +692,14 @@ bool ExceptionHandler::WriteMinidump() { | ||
| 36 | sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0); | ||
| 37 | |||
| 38 | CrashContext context; | ||
| 39 | +#if defined(__GLIBC__) | ||
| 40 | int getcontext_result = getcontext(&context.context); | ||
| 41 | if (getcontext_result) | ||
| 42 | return false; | ||
| 43 | +#else | ||
| 44 | + // Extreme hack - see comments above. | ||
| 45 | + memset (&context.context, 0, sizeof(&context.context)); | ||
| 46 | +#endif | ||
| 47 | |||
| 48 | #if defined(__i386__) | ||
| 49 | // In CPUFillFromUContext in minidumpwriter.cc the stack pointer is retrieved | ||
| 50 | -- | ||
| 51 | 1.9.1 | ||
| 52 | |||
diff --git a/meta-oe/recipes-devtools/breakpad/breakpad_git.bb b/meta-oe/recipes-devtools/breakpad/breakpad_git.bb index 5f6d82c945..d9773c9a6e 100644 --- a/meta-oe/recipes-devtools/breakpad/breakpad_git.bb +++ b/meta-oe/recipes-devtools/breakpad/breakpad_git.bb | |||
| @@ -41,6 +41,7 @@ SRC_URI = "git://github.com/google/breakpad;name=breakpad \ | |||
| 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://mcontext.patch \ |
| 44 | file://0001-disable-calls-to-getcontext-with-musl.patch \ | ||
| 44 | file://0001-lss-Match-syscalls-to-match-musl.patch;patchdir=src/third_party/lss \ | 45 | file://0001-lss-Match-syscalls-to-match-musl.patch;patchdir=src/third_party/lss \ |
| 45 | file://mips_asm_sgidefs.patch;patchdir=src/third_party/lss \ | 46 | file://mips_asm_sgidefs.patch;patchdir=src/third_party/lss \ |
| 46 | " | 47 | " |
