[Mlir-commits] [mlir] fc01c81 - [MLIR][build] Fix undefined references in debug shared libs (#189207)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sun Mar 29 04:03:42 PDT 2026
Author: dwrank
Date: 2026-03-29T13:03:37+02:00
New Revision: fc01c81d03c74b9da6aa4e3ea22487b2e5b2517a
URL: https://github.com/llvm/llvm-project/commit/fc01c81d03c74b9da6aa4e3ea22487b2e5b2517a
DIFF: https://github.com/llvm/llvm-project/commit/fc01c81d03c74b9da6aa4e3ea22487b2e5b2517a.diff
LOG: [MLIR][build] Fix undefined references in debug shared libs (#189207)
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)
Fixes #189206
Assisted-by: Claude Code
From:
https://github.com/llvm/llvm-project/commit/d7e60d525026f24a3514be34d8e6e56622436823
Utils were added to OpenMP, particularly [[maybe_unused]]
setOffloadModuleInterfaceAttributes() which calls
llvm::Triple::normalize() creating a new dependency on TargetParser.
Added:
Modified:
mlir/lib/Dialect/LLVMIR/CMakeLists.txt
mlir/lib/Dialect/OpenMP/CMakeLists.txt
Removed:
################################################################################
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
More information about the Mlir-commits
mailing list