Skip to content

Commit e3f1e70

Browse files
committedMar 21, 2025
mlir: emit libMLIR.so for not-static host platforms
mlir piggybacks onto LLVM_BUILD_LLVM_DYLIB for determining if a shared libMLIR.so is emitted. This also fixes build failures in MLIR 20+ where tablegen'd files aren't generated. In file included from /build/mlir-src-21.0.0-unstable-2025-03-09/mlir/include/mlir/IR/UseDefLists.h:16, from /build/mlir-src-21.0.0-unstable-2025-03-09/mlir/include/mlir/IR/Value.h:17, from /build/mlir-src-21.0.0-unstable-2025-03-09/mlir/include/mlir/IR/BlockSupport.h:16, from /build/mlir-src-21.0.0-unstable-2025-03-09/mlir/include/mlir/IR/OperationSupport.h:18, from /build/mlir-src-21.0.0-unstable-2025-03-09/mlir/include/mlir/IR/Dialect.h:17, from /build/mlir-src-21.0.0-unstable-2025-03-09/mlir/tools/mlir-lsp-server/mlir-lsp-server.cpp:9: /build/mlir-src-21.0.0-unstable-2025-03-09/mlir/include/mlir/IR/Location.h:145:10: fatal error: mlir/IR/BuiltinLocationAttributes.h.inc: No such file or directory 145 | #include "mlir/IR/BuiltinLocationAttributes.h.inc" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
1 parent 8b304f2 commit e3f1e70

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

‎pkgs/development/compilers/llvm/common/mlir/default.nix

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ stdenv.mkDerivation rec {
6161
"-DLLVM_ENABLE_DUMP=ON"
6262
"-DLLVM_TABLEGEN_EXE=${buildLlvmTools.tblgen}/bin/llvm-tblgen"
6363
"-DMLIR_TABLEGEN_EXE=${buildLlvmTools.tblgen}/bin/mlir-tblgen"
64+
(lib.cmakeBool "LLVM_BUILD_LLVM_DYLIB" (!stdenv.hostPlatform.isStatic))
6465
] ++ lib.optionals stdenv.hostPlatform.isStatic [
6566
# Disables building of shared libs, -fPIC is still injected by cc-wrapper
6667
"-DLLVM_ENABLE_PIC=OFF"

0 commit comments

Comments
 (0)
Failed to load comments.