mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-24 08:41:40 -04:00
- Add optional libunwind support for better stack traces on ARM (glibc's backtrace() doesn't work well on ARM due to missing frame pointers) - Fix misleading signal info: si_pid/si_uid/si_status are only valid for SIGCHLD, not for SIGSEGV/SIGBUS - they were showing garbage values (the fault address misinterpreted as PID) - Add human-readable fault descriptions for SIGSEGV, SIGBUS, SIGFPE, and SIGILL signals - Use clearer terminology in error messages To enable libunwind on ARM: apt install libunwind-dev Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
37 lines
1.2 KiB
CMake
37 lines
1.2 KiB
CMake
# FindLibUnwind.cmake
|
|
# Find the libunwind library for better stack traces on ARM and other platforms
|
|
#
|
|
# Sets:
|
|
# LIBUNWIND_FOUND - True if libunwind was found
|
|
# LIBUNWIND_INCLUDE_DIR - Include directory for libunwind
|
|
# LIBUNWIND_LIBRARIES - Libraries to link against
|
|
|
|
find_path(LIBUNWIND_INCLUDE_DIR
|
|
NAMES libunwind.h
|
|
PATHS /usr/include /usr/local/include
|
|
)
|
|
|
|
find_library(LIBUNWIND_LIBRARY
|
|
NAMES unwind
|
|
PATHS /usr/lib /usr/local/lib /usr/lib/arm-linux-gnueabihf /usr/lib/aarch64-linux-gnu
|
|
)
|
|
|
|
# On some platforms, we also need libunwind-generic or platform-specific libs
|
|
find_library(LIBUNWIND_GENERIC_LIBRARY
|
|
NAMES unwind-generic unwind-arm unwind-aarch64 unwind-x86_64 unwind-x86
|
|
PATHS /usr/lib /usr/local/lib /usr/lib/arm-linux-gnueabihf /usr/lib/aarch64-linux-gnu
|
|
)
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
find_package_handle_standard_args(LibUnwind
|
|
REQUIRED_VARS LIBUNWIND_LIBRARY LIBUNWIND_INCLUDE_DIR
|
|
)
|
|
|
|
if(LIBUNWIND_FOUND)
|
|
set(LIBUNWIND_LIBRARIES ${LIBUNWIND_LIBRARY})
|
|
if(LIBUNWIND_GENERIC_LIBRARY)
|
|
list(APPEND LIBUNWIND_LIBRARIES ${LIBUNWIND_GENERIC_LIBRARY})
|
|
endif()
|
|
mark_as_advanced(LIBUNWIND_INCLUDE_DIR LIBUNWIND_LIBRARY LIBUNWIND_GENERIC_LIBRARY)
|
|
endif()
|