[Mlir-commits] [mlir] 774f740 - [mlir] Avoid ASan ODR violation in mlir-src-sharder with LLVM dylib (#181045)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Mar 5 02:42:52 PST 2026


Author: Ayush Kumar Gaur
Date: 2026-03-05T11:42:47+01:00
New Revision: 774f740e0b5ff01fe8ad713300ba233f0a42262a

URL: https://github.com/llvm/llvm-project/commit/774f740e0b5ff01fe8ad713300ba233f0a42262a
DIFF: https://github.com/llvm/llvm-project/commit/774f740e0b5ff01fe8ad713300ba233f0a42262a.diff

LOG: [mlir] Avoid ASan ODR violation in mlir-src-sharder with LLVM dylib (#181045)

Build mlir-src-sharder via add_llvm_executable instead of add_tablegen
to avoid embedding a second copy of LLVM Support when linking against
libLLVM.so. Fixes ASan ODR violation for DisableABIBreakingChecks 

Tested with ASan + LLVM dylib configuration; tool runs without abort.
Fixes #180911

Added: 
    

Modified: 
    mlir/tools/mlir-src-sharder/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/tools/mlir-src-sharder/CMakeLists.txt b/mlir/tools/mlir-src-sharder/CMakeLists.txt
index 6f98bd15fc18c..ba78dad1c87b5 100644
--- a/mlir/tools/mlir-src-sharder/CMakeLists.txt
+++ b/mlir/tools/mlir-src-sharder/CMakeLists.txt
@@ -1,14 +1,11 @@
 set(LLVM_LINK_COMPONENTS Support)
 set(LIBS MLIRSupport)
 
-add_tablegen(mlir-src-sharder MLIR_SRC_SHARDER
-  mlir-src-sharder.cpp
-
-  DEPENDS
-  ${LIBS}
-  )
+add_llvm_executable(mlir-src-sharder mlir-src-sharder.cpp)
 
 set_target_properties(mlir-src-sharder PROPERTIES FOLDER "MLIR/Tablegenning")
 target_link_libraries(mlir-src-sharder PRIVATE ${LIBS})
 
+set(MLIR_SRC_SHARDER_TABLEGEN_EXE mlir-src-sharder PARENT_SCOPE)
+
 mlir_check_all_link_libraries(mlir-src-sharder)


        


More information about the Mlir-commits mailing list