Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mlir] Avoid building some shared libraries when PIC is off
When `LLVM_ENABLE_PIC = OFF`, shared libraries cannot be built against code that's compiled without -fPIC. Example error message: `` ld.lld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC >>> defined in lib/libLLVMSupport.a(StringMap.cpp.o) >>> referenced by StringMap.cpp >>> StringMap.cpp.o:(llvm::StringMapImpl::StringMapImpl(unsigned >>> int, unsigned int)) in archive lib/libLLVMSupport.a `` Similar to [how libclang handles this](https://github.com/llvm/llvm-project/blob/main/clang/tools/clang-shlib/CMakeLists.txt#L2-L4), skip building these shared libraries when `LLVM_ENABLE_PIC = OFF`. Differential Revision: https://reviews.llvm.org/D142941
- Loading branch information
Showing
2 changed files
with
141 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters