From 1a0d2fb7ee7da66c5202922d901c702071fff340 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 26 Sep 2019 22:09:56 +0200 Subject: external/breakpad: glibc 2.30 declares tgkill ...so building against glibc-headers-2.30-4.fc31.x86_64 fails with > src/client/linux/handler/exception_handler.cc:109:12: error: static declaration of 'tgkill' follows non-static declaration > static int tgkill(pid_t tgid, pid_t tid, int sig) { > ^ > /usr/include/bits/signal_ext.h:29:12: note: previous declaration is here > extern int tgkill (__pid_t __tgid, __pid_t __tid, int __signal); > ^ > 1 error generated. Upstream commit "Fix double declaration of tgkill when using Android NDK Headers" looks like the perfect fit. Reviewed-on: https://gerrit.libreoffice.org/79661 Tested-by: Jenkins Reviewed-by: Stephan Bergmann Conflicts: external/breakpad/UnpackedTarball_breakpad.mk Change-Id: I1b4805886fb7c770cf9733f34a31296e6b859d92 --- ...claration-of-tgkill-when-using-Android-.patch.1 | 49 ++++++++++++++++++++++ external/breakpad/UnpackedTarball_breakpad.mk | 1 + 2 files changed, 50 insertions(+) create mode 100644 external/breakpad/0001-Fix-double-declaration-of-tgkill-when-using-Android-.patch.1 diff --git a/external/breakpad/0001-Fix-double-declaration-of-tgkill-when-using-Android-.patch.1 b/external/breakpad/0001-Fix-double-declaration-of-tgkill-when-using-Android-.patch.1 new file mode 100644 index 000000000000..7c8a68c2451a --- /dev/null +++ b/external/breakpad/0001-Fix-double-declaration-of-tgkill-when-using-Android-.patch.1 @@ -0,0 +1,49 @@ +From 7e3c165000d44fa153a3270870ed500bc8bbb461 Mon Sep 17 00:00:00 2001 +From: Nicholas Baldwin +Date: Fri, 27 Oct 2017 11:44:36 -0700 +Subject: [PATCH] Fix double declaration of tgkill when using Android NDK + Headers. + +As of Android API level 16 tgkill is declared in the NDK version of +signal.h, which conflicts with the static definition found in +src/client/linux/handler/exception_handler.cc. This change removes +the static tgkill definition and replaces its use with sys_tgkill +from the linux syscall support library. + +Bug: +Change-Id: Ic70addd8a064cfa36345d86b7e36409e2089e909 +Reviewed-on: https://chromium-review.googlesource.com/738912 +Reviewed-by: Mike Frysinger +--- + src/client/linux/handler/exception_handler.cc | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc +index 95005209..cd94e3b5 100644 +--- a/src/client/linux/handler/exception_handler.cc ++++ b/src/client/linux/handler/exception_handler.cc +@@ -105,12 +105,6 @@ + #define PR_SET_PTRACER 0x59616d61 + #endif + +-// A wrapper for the tgkill syscall: send a signal to a specific thread. +-static int tgkill(pid_t tgid, pid_t tid, int sig) { +- return syscall(__NR_tgkill, tgid, tid, sig); +- return 0; +-} +- + namespace google_breakpad { + + namespace { +@@ -400,7 +394,7 @@ void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) { + // In order to retrigger it, we have to queue a new signal by calling + // kill() ourselves. The special case (si_pid == 0 && sig == SIGABRT) is + // due to the kernel sending a SIGABRT from a user request via SysRQ. +- if (tgkill(getpid(), syscall(__NR_gettid), sig) < 0) { ++ if (sys_tgkill(getpid(), syscall(__NR_gettid), sig) < 0) { + // If we failed to kill ourselves (e.g. because a sandbox disallows us + // to do so), we instead resort to terminating our process. This will + // result in an incorrect exit code. +-- +2.23.0 + diff --git a/external/breakpad/UnpackedTarball_breakpad.mk b/external/breakpad/UnpackedTarball_breakpad.mk index e970bd5ad3f3..b4e778482c12 100644 --- a/external/breakpad/UnpackedTarball_breakpad.mk +++ b/external/breakpad/UnpackedTarball_breakpad.mk @@ -19,6 +19,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,breakpad,\ external/breakpad/breakpad-wshadow2.patch.1 \ external/breakpad/breakpad-stackwalk.patch.1 \ external/breakpad/ucontext.patch \ + external/breakpad/0001-Fix-double-declaration-of-tgkill-when-using-Android-.patch.1 \ )) ifeq ($(COM_IS_CLANG),TRUE) -- cgit v1.2.3