From 11b2d6deffa973feb4ddd4f8c7b57c24e879fca3 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Sat, 1 Jul 2023 11:45:58 -0400 Subject: [PATCH] Add `sframe` to libbfd's dependencies list This is required when linking on a system without a dynamic library for libbfd. Note that `libsframe` is a recent addition to `libbfd`, so we test for the library existence before adding it to the dependency list. It allows us to remain compatible with older distributions. --- BackwardConfig.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BackwardConfig.cmake b/BackwardConfig.cmake index 4e0eb90..d1998e4 100644 --- a/BackwardConfig.cmake +++ b/BackwardConfig.cmake @@ -152,6 +152,11 @@ if (${STACK_DETAILS_AUTO_DETECT}) # If we attempt to link against static bfd, make sure to link its dependencies, too get_filename_component(bfd_lib_ext "${LIBBFD_LIBRARY}" EXT) if (bfd_lib_ext STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}") + find_library(LIBSFRAME_LIBRARY NAMES sframe) + if (LIBSFRAME_LIBRARY) + list(APPEND _BACKWARD_LIBRARIES ${LIBSFRAME_LIBRARY}) + endif() + list(APPEND _BACKWARD_LIBRARIES iberty z) endif()