Only enable backtrace on GLIBC linux systems
This commit is contained in:
parent
268c566006
commit
c6a7c8edef
2 changed files with 6 additions and 2 deletions
|
@ -175,6 +175,11 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
check_include_file_cxx(execinfo HAVE_EXECINFO)
|
||||
if (HAVE_EXECINFO)
|
||||
add_compile_definitions(GLIBC_BACKTRACE_SUPPORTED)
|
||||
endif()
|
||||
|
||||
#
|
||||
# build the library
|
||||
#
|
||||
|
@ -207,7 +212,6 @@ set(GGML_PUBLIC_HEADERS
|
|||
include/ggml-alloc.h
|
||||
include/ggml-backend.h
|
||||
include/ggml-blas.h
|
||||
include/ggml-cann.h
|
||||
include/ggml-cuda.h
|
||||
include/ggml.h
|
||||
include/ggml-kompute.h
|
||||
|
|
|
@ -185,7 +185,7 @@ static void ggml_print_backtrace_symbols(void) {
|
|||
fprintf(stderr, "%d: %p %s\n", idx, addr, symbol);
|
||||
}
|
||||
}
|
||||
#elif defined(__linux__)
|
||||
#elif defined(__linux__) && defined(GLIBC_BACKTRACE_SUPPORTED)
|
||||
#include <execinfo.h>
|
||||
static void ggml_print_backtrace_symbols(void) {
|
||||
void * trace[100];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue