]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] backport fix for dlfcn.h from backward-cpp 4639/head
authorDuncan Bellamy <dunk@denkimushi.com>
Thu, 12 Oct 2023 10:06:52 +0000 (10:06 +0000)
committerDuncan Bellamy <dunk@denkimushi.com>
Thu, 12 Oct 2023 10:15:41 +0000 (10:15 +0000)
https://github.com/bombela/backward-cpp/commit/65fc89e210655aaa707337bc21d19f45805ac8a2

backport fix for powerpc as well
https://github.com/bombela/backward-cpp/commit/4bec538c996e155d487db9aef0fc2f1996202f8e

contrib/backward-cpp/backward.hpp

index ac7ad51738f8d13f07a6162d421b191696c9f84a..b853f8308a7b6c5a96350c9742d545704b55acbd 100644 (file)
 #else
 #include <link.h>
 #endif
+#if defined(__ppc__) || defined(__powerpc) || defined(__powerpc__) ||        \
+    defined(__POWERPC__)
+// Linux kernel header required for the struct pt_regs definition
+// to access the NIP (Next Instruction Pointer) register value
+#include <asm/ptrace.h>
+#endif
 #include <signal.h>
 #include <sys/stat.h>
 #include <syscall.h>
 #include <unistd.h>
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#include <dlfcn.h>
+#undef _GNU_SOURCE
+#else
+#include <dlfcn.h>
+#endif
 
 #if BACKWARD_HAS_BFD == 1
 //              NOTE: defining PACKAGE{,_VERSION} is required before including
 #define PACKAGE_VERSION
 #endif
 #include <bfd.h>
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#include <dlfcn.h>
-#undef _GNU_SOURCE
-#else
-#include <dlfcn.h>
-#endif
 #endif
 
 #if BACKWARD_HAS_DW == 1
 #include <libdwarf.h>
 #include <libelf.h>
 #include <map>
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#include <dlfcn.h>
-#undef _GNU_SOURCE
-#else
-#include <dlfcn.h>
-#endif
 #endif
 
 #if (BACKWARD_HAS_BACKTRACE == 1) || (BACKWARD_HAS_BACKTRACE_SYMBOL == 1)