Skip to content
Permalink
Browse files
MDEV-27686 Moving libexecinfo out of FreeBSD / OpenBSD specific CMake…
… code

On all Unix platforms, link libexecinfo as system library,
if it contains backtrace_symbols_fd function, and libc does not contain
this function

Also remove cmake/os/OpenBSD.cmake, as after the fix it serves no purpose.
  • Loading branch information
vaintroub committed Jul 17, 2022
1 parent 92a3280 commit b3f0acf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 27 deletions.
@@ -28,8 +28,3 @@ SET(EXECINFO_ROOT /usr/local CACHE INTERNAL "Where to find execinfo library and
INCLUDE_DIRECTORIES(${EXECINFO_ROOT}/include)
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${EXECINFO_ROOT}/include)
SET(ENV{LIB} "$ENV{LIB}:${EXECINFO_ROOT}/lib")
FIND_LIBRARY(EXECINFO NAMES execinfo)
IF(EXECINFO)
SET(LIBEXECINFO ${EXECINFO})
ENDIF()

This file was deleted.

@@ -134,6 +134,8 @@ IF(UNIX)
IF(NOT LIBRT)
MY_SEARCH_LIBS(clock_gettime rt LIBRT)
ENDIF()
MY_SEARCH_LIBS(backtrace_symbols_fd execinfo LIBEXECINFO)

set(THREADS_PREFER_PTHREAD_FLAG ON)
FIND_PACKAGE(Threads)

1 comment on commit b3f0acf

@brad0
Copy link
Contributor

@brad0 brad0 commented on b3f0acf Jul 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, FreeBSD.cmake can be removed all together. Many years ago libexecinfo was migrated to the base OS and the port was removed.

Please sign in to comment.