Prevent external projects from linking against both static and shared libraries

rhbz#1558657
This commit is contained in:
Tom Stellard 2018-03-20 18:49:21 +00:00
parent 699e7bbabc
commit 3d213b0da3
2 changed files with 45 additions and 1 deletions

View File

@ -0,0 +1,39 @@
From 4d613a84ce271c6225068bef67d727ae02b2e3b1 Mon Sep 17 00:00:00 2001
From: Pavel Labath <labath@google.com>
Date: Wed, 14 Mar 2018 09:28:38 +0000
Subject: [PATCH] Export LLVM_DYLIB_COMPONENTS in LLVMConfig.cmake
Summary:
This is needed so that external projects (e.g. a standalone build of
lldb) can link to the LLVM shared library via the USE_SHARED argument of
llvm_config. Without this, llvm_config would add LLVM to the link list,
but then also add the constituent static libraries, resulting in
multiply defined symbols.
Reviewers: beanz, mgorny
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D44391
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327484 91177308-0d34-0410-b5e6-96231b3b80d8
---
cmake/modules/LLVMConfig.cmake.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/cmake/modules/LLVMConfig.cmake.in b/cmake/modules/LLVMConfig.cmake.in
index fe4df52..e700186 100644
--- a/cmake/modules/LLVMConfig.cmake.in
+++ b/cmake/modules/LLVMConfig.cmake.in
@@ -13,6 +13,8 @@ set(LLVM_COMMON_DEPENDS @LLVM_COMMON_DEPENDS@)
set(LLVM_AVAILABLE_LIBS @LLVM_AVAILABLE_LIBS@)
+set(LLVM_DYLIB_COMPONENTS @LLVM_DYLIB_COMPONENTS@)
+
set(LLVM_ALL_TARGETS @LLVM_ALL_TARGETS@)
set(LLVM_TARGETS_TO_BUILD @LLVM_TARGETS_TO_BUILD@)
--
1.8.3.1

View File

@ -12,7 +12,7 @@
Name: llvm
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
Release: 8%{?dist}
Release: 9%{?dist}
Summary: The Low Level Virtual Machine
License: NCSA
@ -26,6 +26,7 @@ Patch5: 0001-DebugInfo-Discard-invalid-DBG_VALUE-instructions-in-.patch
Patch6: 0001-Fixup-for-rL326769-RegState-Debug-is-being-truncated.patch
Patch7: 0001-Filter-out-cxxflags-not-supported-by-clang.patch
Patch8: 0001-PPC-Avoid-non-simple-MVT-in-STBRX-optimization.patch
Patch9: 0001-Export-LLVM_DYLIB_COMPONENTS-in-LLVMConfig.cmake.patch
BuildRequires: cmake
BuildRequires: ninja-build
@ -217,6 +218,10 @@ fi
%{_libdir}/cmake/llvm/LLVMStaticExports.cmake
%changelog
* Tue Mar 20 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-9
- Prevent external projects from linking against both static and shared
libraries. rhbz#1558657
* Mon Mar 19 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-8
- Backport r327651 from trunk rhbz#1554349