[Mlir-commits] [mlir] [MLIR][build] Fix undefined references in debug shared libs (#189206) (PR #189207)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sat Mar 28 20:29:17 PDT 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-llvm
Author: dwrank
<details>
<summary>Changes</summary>
Fixes undefined references in debug shared libs when building MLIR:
-DLLVM_ENABLE_PROJECTS="mlir"
-DCMAKE_BUILD_TYPE=Debug
-DBUILD_SHARED_LIBS=1
Debug build (-O0) disables dead code elimination, resulting in undefined references in the following shared libs:
MLIROpenMPDialect (needs to link with TargetParser)
MLIRXeVMDialect (needs to link with TargetParser and MLIROpenMPDialect)
MLIRNVVMDialect (needs to link with TargetParser and MLIROpenMPDialect)
Assisted-by: Claude Code
---
Full diff: https://github.com/llvm/llvm-project/pull/189207.diff
2 Files Affected:
- (modified) mlir/lib/Dialect/LLVMIR/CMakeLists.txt (+4)
- (modified) mlir/lib/Dialect/OpenMP/CMakeLists.txt (+3)
``````````diff
diff --git a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
index 21b60ae747a71..494a1e4c3ee97 100644
--- a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
+++ b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
@@ -60,11 +60,13 @@ add_mlir_dialect_library(MLIRNVVMDialect
LINK_COMPONENTS
AsmParser
Core
+ TargetParser
LINK_LIBS PUBLIC
MLIRIR
MLIRLLVMDialect
MLIRGPUDialect
+ MLIROpenMPDialect
MLIRSideEffectInterfaces
MLIRInferIntRangeInterface
)
@@ -128,10 +130,12 @@ add_mlir_dialect_library(MLIRXeVMDialect
LINK_COMPONENTS
AsmParser
Core
+ TargetParser
LINK_LIBS PUBLIC
MLIRDialectUtils
MLIRIR
MLIRLLVMDialect
+ MLIROpenMPDialect
MLIRSideEffectInterfaces
)
diff --git a/mlir/lib/Dialect/OpenMP/CMakeLists.txt b/mlir/lib/Dialect/OpenMP/CMakeLists.txt
index f3c02da458508..41c68b4244590 100644
--- a/mlir/lib/Dialect/OpenMP/CMakeLists.txt
+++ b/mlir/lib/Dialect/OpenMP/CMakeLists.txt
@@ -12,6 +12,9 @@ add_mlir_dialect_library(MLIROpenMPDialect
MLIROpenMPOpsInterfacesIncGen
MLIROpenMPTypeInterfacesIncGen
+ LINK_COMPONENTS
+ TargetParser
+
LINK_LIBS PUBLIC
MLIRIR
MLIRLLVMDialect
``````````
</details>
https://github.com/llvm/llvm-project/pull/189207
More information about the Mlir-commits
mailing list