llvm.org GIT mirror llvm / 53347ed
Make backtraces work again with both the configure and cmake build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164817 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 6 years ago
3 changed file(s) with 9 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
114114 set(ENABLE_TIMESTAMPS 1)
115115 endif()
116116
117 option(LLVM_ENABLE_BACKTRACES "Enable embedding backtraces on crash." ON)
118 if(LLVM_ENABLE_BACKTRACES)
119 set(ENABLE_BACKTRACES 1)
120 endif()
121
117122 option(LLVM_ENABLE_FFI "Use libffi to call external functions from the interpreter" OFF)
118123 set(FFI_LIBRARY_DIR "" CACHE PATH "Additional directory, where CMake should search for libffi.so")
119124 set(FFI_INCLUDE_DIR "" CACHE PATH "Additional directory, where CMake should search for ffi.h or ffi/ffi.h")
1616 /* Default to all compiler invocations for --sysroot=. */
1717 #undef DEFAULT_SYSROOT
1818
19 /* Define if you want backtraces on crash */
20 #cmakedefine ENABLE_BACKTRACES
21
1922 /* Define if position independent code is enabled */
2023 #cmakedefine ENABLE_PIC
2124
242242 // On glibc systems we have the 'backtrace' function, which works nicely, but
243243 // doesn't demangle symbols.
244244 static void PrintStackTrace(void *) {
245 #if defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACE)
245 #if defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)
246246 static void* StackTrace[256];
247247 // Use backtrace() to output a backtrace on Linux systems with glibc.
248248 int depth = backtrace(StackTrace,