vppinfra: add option to use libexecinfo 89/30789/4
authorNathan Moos <nmoos@cisco.com>
Fri, 15 Jan 2021 23:50:59 +0000 (15:50 -0800)
committerDamjan Marion <dmarion@me.com>
Wed, 20 Jan 2021 15:23:06 +0000 (15:23 +0000)
Type: feature

The musl libc does not provide <execinfo.h> or an implementation of the
functions provided. This patch enables the use of libexecinfo as an
alternative, which can be used on systems with musl.

Change-Id: I76b5744ddf731b66e16144025a6fdedf72925260
Signed-off-by: Nathan Moos <nmoos@cisco.com>
src/vppinfra/CMakeLists.txt

index 07fc109..8ec843a 100644 (file)
@@ -200,9 +200,13 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
    )
 endif()
 
+option(VPP_USE_EXTERNAL_LIBEXECINFO "Use external libexecinfo (useful for non-glibc targets)." OFF)
+if(VPP_USE_EXTERNAL_LIBEXECINFO)
+  set(EXECINFO_LIB execinfo)
+endif()
 add_vpp_library(vppinfra
   SOURCES ${VPPINFRA_SRCS}
-  LINK_LIBRARIES m
+  LINK_LIBRARIES m ${EXECINFO_LIB}
   INSTALL_HEADERS ${VPPINFRA_HEADERS}
   COMPONENT libvppinfra
   LTO