diff options
author | Andrzej Warzynski <andrzej.warzynski@arm.com> | 2022-03-11 17:02:30 +0300 |
---|---|---|
committer | Andrzej Warzynski <andrzej.warzynski@arm.com> | 2022-03-11 19:12:36 +0300 |
commit | 85e2731aa3d440384067001a9a460a889037eb11 (patch) | |
tree | 9f0e43d26a45cb420833b297501dfd119348bcfb /flang | |
parent | 9ddb1a49ac08d8cd66771de56d5c3227d586b579 (diff) |
[flang] Fix DYLIB builds
https://reviews.llvm.org/D120568 broke builds that set
both `LLVM_BUILD_LLVM_DYLIB` and `LLVM_LINK_LLVM_DYLIB`. This patch
fixes that.
The build failure was caused by the fact that some LLVM libraries (which
are also LLVM components) were listed directly as link-time dependencies
instead of using `LINK_COMPONENTS` in CMake files. This lead to a linker
invocation like this (simplified version to demonstrate the problem):
```
ld lib/libLLVM.so lib/libLLVMAnalysis.a lib/libLLVMTarget.a
```
That's problematic and unnecessary because `libLLVM.so` incorporates
`libLLVMAnalysis` and `libLLVMTarget`. A correct invocation would look
like this (`LLVM_LINK_LLVM_DYLIB` _is not_ set):
```
ld lib/libLLVMAnalysis.a lib/libLLVMTarget.a
```
or this (`LLVM_LINK_LLVM_DYLIB` _is_ set):
```
ld lib/libLLVM.so
```
Differential Revision: https://reviews.llvm.org/D121461
Diffstat (limited to 'flang')
-rw-r--r-- | flang/lib/Frontend/CMakeLists.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/flang/lib/Frontend/CMakeLists.txt b/flang/lib/Frontend/CMakeLists.txt index a68e0e9a7463..d6520e705dc9 100644 --- a/flang/lib/Frontend/CMakeLists.txt +++ b/flang/lib/Frontend/CMakeLists.txt @@ -27,8 +27,6 @@ add_flang_library(flangFrontend FortranLower clangBasic clangDriver - LLVMAnalysis - LLVMTarget FIRDialect FIRSupport FIRBuilder @@ -40,8 +38,10 @@ add_flang_library(flangFrontend ${dialect_libs} LINK_COMPONENTS + Analysis Option Support + Target FrontendOpenACC FrontendOpenMP ) |