Skip to content

Commit 01d683b

Browse files
authored
[mlir] Don't set RPATH for libMLIR
By default [`llvm_add_library`](https://github.com/llvm/llvm-project/blob/94837c8b5761d20310947be5d2e1e568f67e8c0c/llvm/cmake/modules/AddLLVM.cmake#L681) calls `llvm_setup_rpath`, which has the strange effect that even libs inside of `install/lib` have non-empty self-referential `RPATH`s; e.g., on Mac ``` $ llvm-install/lib/libMLIR.dylib | grep RPATH -A4 cmd LC_RPATH cmdsize 32 path @loader_path/../lib (offset 12) ``` which is bad/awkward if you want to move `libMLIR` (like into a wheel...). Now possibly we want to do this for all shlibs but I think we definitely want to do this for `libMLIR` because it should have no runtime lib deps (at least until [this](#108253) lands).
1 parent 814902a commit 01d683b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mlir/tools/mlir-shlib/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ if(LLVM_BUILD_LLVM_DYLIB)
3535
MLIR
3636
SHARED
3737
EXCLUDE_FROM_LIBMLIR
38+
NO_INSTALL_RPATH
3839
${INSTALL_WITH_TOOLCHAIN}
3940
mlir-shlib.cpp
4041
${_OBJECTS}

0 commit comments

Comments
 (0)