Skip to content

Commit 3c831e5

Browse files
committed
Merge remote-tracking branch 'prime/master' into allow-editing-of-env-paths
2 parents 343b654 + 5ffb2c8 commit 3c831e5

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

BackwardConfig.cmake

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,21 @@ if (${STACK_DETAILS_AUTO_DETECT})
8989
# find libdw
9090
find_path(LIBDW_INCLUDE_DIR NAMES "elfutils/libdw.h" "elfutils/libdwfl.h")
9191
find_library(LIBDW_LIBRARY dw)
92+
# in case it's statically linked, look for all the possible dependencies
93+
find_library(LIBELF_LIBRARY elf)
94+
find_library(LIBPTHREAD_LIBRARY pthread)
95+
find_library(LIBZ_LIBRARY z)
96+
find_library(LIBBZ2_LIBRARY bz2)
97+
find_library(LIBLZMA_LIBRARY lzma)
98+
find_library(LIBZSTD_LIBRARY zstd)
9299
set(LIBDW_INCLUDE_DIRS ${LIBDW_INCLUDE_DIR} )
93-
set(LIBDW_LIBRARIES ${LIBDW_LIBRARY} )
100+
set(LIBDW_LIBRARIES ${LIBDW_LIBRARY}
101+
$<$<BOOL:${LIBELF_LIBRARY}>:${LIBELF_LIBRARY}>
102+
$<$<BOOL:${LIBPTHREAD_LIBRARY}>:${LIBPTHREAD_LIBRARY}>
103+
$<$<BOOL:${LIBZ_LIBRARY}>:${LIBZ_LIBRARY}>
104+
$<$<BOOL:${LIBBZ2_LIBRARY}>:${LIBBZ2_LIBRARY}>
105+
$<$<BOOL:${LIBLZMA_LIBRARY}>:${LIBLZMA_LIBRARY}>
106+
$<$<BOOL:${LIBZSTD_LIBRARY}>:${LIBZSTD_LIBRARY}>)
94107
find_package_handle_standard_args(libdw ${_name_mismatched_arg}
95108
REQUIRED_VARS LIBDW_LIBRARY LIBDW_INCLUDE_DIR)
96109
mark_as_advanced(LIBDW_INCLUDE_DIR LIBDW_LIBRARY)

backward.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,12 @@
211211
#else
212212
#include <link.h>
213213
#endif
214+
#if defined(__ppc__) || defined(__powerpc) || defined(__powerpc__) || \
215+
defined(__POWERPC__)
216+
// Linux kernel header required for the struct pt_regs definition
217+
// to access the NIP (Next Instruction Pointer) register value
218+
#include <asm/ptrace.h>
219+
#endif
214220
#include <signal.h>
215221
#include <sys/stat.h>
216222
#include <syscall.h>

0 commit comments

Comments
 (0)