File llvm-fix-bsc1192305.patch of Package llvm6.21708

Upstream patch: https://reviews.llvm.org/D50416
Fixes: https://bugzilla.suse.com/show_bug.cgi?id=1192305

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 PR23460 (https://sourceware.org/bugzilla/show_bug.cgi?id=23460).
Index: llvm-6.0.1.src/cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- llvm-6.0.1.src/cmake/modules/HandleLLVMOptions.cmake
+++ llvm-6.0.1.src/cmake/modules/HandleLLVMOptions.cmake
@@ -149,6 +149,7 @@
 # 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()
openSUSE Build Service is sponsored by