Skip to content

Commit

Permalink
Merge pull request #22215 from charris/backport-22152
Browse files Browse the repository at this point in the history
BUG: Support using libunwind for backtrack
  • Loading branch information
charris committed Sep 6, 2022
2 parents cb715c7 + 32c67e7 commit d0f4e87
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion numpy/core/setup_common.py
Expand Up @@ -141,7 +141,9 @@ def set_sig(sig):
"immintrin.h", # AVX
"features.h", # for glibc version linux
"xlocale.h", # see GH#8367
"dlfcn.h", # dladdr
"dlfcn.h", # dladdr
"execinfo.h", # backtrace
"libunwind.h", # backtrace for LLVM/Clang using libunwind
"sys/mman.h", #madvise
]

Expand Down
5 changes: 5 additions & 0 deletions numpy/core/src/multiarray/temp_elide.c
Expand Up @@ -82,7 +82,12 @@
#define NPY_MIN_ELIDE_BYTES (32)
#endif
#include <dlfcn.h>

#if defined HAVE_EXECINFO_H
#include <execinfo.h>
#elif defined HAVE_LIBUNWIND_H
#include <libunwind.h>
#endif

/*
* linear search pointer in table
Expand Down
4 changes: 4 additions & 0 deletions numpy/linalg/umath_linalg.cpp
Expand Up @@ -50,7 +50,11 @@ using dispatch_scalar = typename std::conditional<std::is_scalar<typ>::value, sc
} while (0)

#if 0
#if defined HAVE_EXECINFO_H
#include <execinfo.h>
#elif defined HAVE_LIBUNWIND_H
#include <libunwind.h>
#endif
void
dbg_stack_trace()
{
Expand Down

0 comments on commit d0f4e87

Please sign in to comment.