diff options
| author | Pavel Labath <labath@google.com> | 2017-01-09 09:57:08 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2017-01-09 09:57:08 +0000 |
| commit | c9fa114b284a406827ba6c3238a524e01774a331 (patch) | |
| tree | 5101f9efa7a5bbd37231ec81ccfe49dada9f19cf /lld/lib/ReaderWriter | |
| parent | be2d68f774a4f032cd316601d0f9f2a363466401 (diff) | |
| download | bcm5719-llvm-c9fa114b284a406827ba6c3238a524e01774a331.tar.gz bcm5719-llvm-c9fa114b284a406827ba6c3238a524e01774a331.zip | |
[lld][cmake] Fix LLVM_LINK_LLVM_DYLIB build
Summary:
Lld's build had a couple of issues which prevented a successfull
LLVM_LINK_LLVM_DYLIB compilation.
- add_llvm_library vs llvm_add_library: One adds a library to libLLVM.so, other
one doesn't. Lld was using the wrong one, causing symbols to be mupltiply
defined in things linking to libLLVM.
- confusion when to use LINK_LIBS vs LINK_COMPONENTS in llvm_add_library
- not using LLVM_LINK_COMPONENTS for add_lld_tool
With these fixes lld compiles and it's test suite passes both in
LLVM_LINK_LLVM_DYLIB mode and without it.
Reviewers: ruiu, beanz
Subscribers: llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D28397
llvm-svn: 291432
Diffstat (limited to 'lld/lib/ReaderWriter')
| -rw-r--r-- | lld/lib/ReaderWriter/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | lld/lib/ReaderWriter/MachO/CMakeLists.txt | 11 | ||||
| -rw-r--r-- | lld/lib/ReaderWriter/YAML/CMakeLists.txt | 5 |
3 files changed, 15 insertions, 7 deletions
diff --git a/lld/lib/ReaderWriter/CMakeLists.txt b/lld/lib/ReaderWriter/CMakeLists.txt index 4408d9c18b8..8751d569b75 100644 --- a/lld/lib/ReaderWriter/CMakeLists.txt +++ b/lld/lib/ReaderWriter/CMakeLists.txt @@ -11,9 +11,11 @@ add_lld_library(lldReaderWriter ADDITIONAL_HEADER_DIRS ${LLD_INCLUDE_DIR}/lld/ReaderWriter + LINK_COMPONENTS + Object + Support + LINK_LIBS lldCore lldYAML - LLVMObject - LLVMSupport ) diff --git a/lld/lib/ReaderWriter/MachO/CMakeLists.txt b/lld/lib/ReaderWriter/MachO/CMakeLists.txt index 6a1064d6dfb..3b0698525aa 100644 --- a/lld/lib/ReaderWriter/MachO/CMakeLists.txt +++ b/lld/lib/ReaderWriter/MachO/CMakeLists.txt @@ -18,13 +18,16 @@ add_lld_library(lldMachO StubsPass.cpp TLVPass.cpp WriterMachO.cpp + + LINK_COMPONENTS + DebugInfoDWARF + Object + Support + Demangle + LINK_LIBS lldCore lldYAML - LLVMDebugInfoDWARF - LLVMObject - LLVMSupport - LLVMDemangle ${PTHREAD_LIB} ) diff --git a/lld/lib/ReaderWriter/YAML/CMakeLists.txt b/lld/lib/ReaderWriter/YAML/CMakeLists.txt index 5c25444e5db..0e63574a63d 100644 --- a/lld/lib/ReaderWriter/YAML/CMakeLists.txt +++ b/lld/lib/ReaderWriter/YAML/CMakeLists.txt @@ -1,6 +1,9 @@ add_lld_library(lldYAML ReaderWriterYAML.cpp + + LINK_COMPONENTS + Support + LINK_LIBS lldCore - LLVMSupport ) |

