From b0dc412984fd32bfa043e7bbf6f50a6dae44f000 Mon Sep 17 00:00:00 2001 From: Paul Dodzweit Date: Thu, 25 May 2023 02:46:39 -0400 Subject: [PATCH] isolate boost (#451) --- CMakeLists.txt | 4 ++++ implementation/plugin/src/plugin_manager_impl.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b0004136..45a6d1f73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,6 +301,10 @@ target_include_directories(${VSOMEIP_NAME} INTERFACE # the build. target_link_libraries(${VSOMEIP_NAME} PRIVATE ${Boost_LIBRARIES} ${USE_RT} ${DL_LIBRARY} ${DLT_LIBRARIES} ${SystemD_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) +if(NOT WIN32) + target_link_options(${VSOMEIP_NAME} PRIVATE "LINKER:-as-needed") +endif() + ################################################################################ # Service Discovery library ################################################################################ diff --git a/implementation/plugin/src/plugin_manager_impl.cpp b/implementation/plugin/src/plugin_manager_impl.cpp index bfaf27281..963193d65 100644 --- a/implementation/plugin/src/plugin_manager_impl.cpp +++ b/implementation/plugin/src/plugin_manager_impl.cpp @@ -178,7 +178,7 @@ void * plugin_manager_impl::load_library(const std::string &_path) { #ifdef _WIN32 return LoadLibrary(_path.c_str()); #else - return dlopen(_path.c_str(), RTLD_LAZY | RTLD_GLOBAL); + return dlopen(_path.c_str(), RTLD_LAZY | RTLD_LOCAL); #endif }