[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
Loading
Please sign in to comment