From f4be62b4084af4f73af8dc31e661bc40400950a6 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Thu, 16 Aug 2018 15:12:12 +0000 Subject: [PATCH] [cmake] Prevent LLVMgold.so from being unloaded on Linux Extend the fix from D40459 to also apply to modules such as the LLVM gold plugin. This is needed because current binutils master (and future binutils 2.32) calls dlclose() on bfd plugins as part of a recent fix for https://sourceware.org/bugzilla/show_bug.cgi?id=23460. Patch by Evangelos Foutras! Differential Revision: https://reviews.llvm.org/D50416 llvm-svn: 339883 --- cmake/modules/HandleLLVMOptions.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake index 5fd318f0091..05cf9026953 100644 --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake @@ -149,6 +149,7 @@ endif() # is unloaded. if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,nodelete") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,nodelete") endif()