[all-commits] [llvm/llvm-project] 8e628f: [mlir] Avoid building some shared libraries when P...
Han Zhu via All-commits
all-commits at lists.llvm.org
Mon Feb 13 10:14:04 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8e628f72b00cd6d8224b1d2aee3266ee49f50973
https://github.com/llvm/llvm-project/commit/8e628f72b00cd6d8224b1d2aee3266ee49f50973
Author: Han Zhu <zhuhan7737 at gmail.com>
Date: 2023-02-13 (Mon, 13 Feb 2023)
Changed paths:
M mlir/lib/ExecutionEngine/CMakeLists.txt
M mlir/test/CMakeLists.txt
Log Message:
-----------
[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
More information about the All-commits
mailing list