Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mlir] Add support for MLIR_LINK_MLIR_DYLIB #119408

Merged
merged 2 commits into from
Dec 12, 2024
Merged

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Dec 10, 2024

While MLIR currently supports building a libMLIR.so, it does not support actually linking against it for its own tools. When building with LTO, this means we have to relink the world for every tool, and the resulting binaries are large.

This adds basic support for MLIR_LINK_MLIR_DYLIB, modelled after how CLANG_LINK_CLANG_DYLIB is implemented: Libraries that are part of libMLIR.so should be added via mlir_target_link_libraries instead of target_link_libraries. This will replace them with libMLIR.so if MLIR_LINK_MLIR_DYLIB is enabled.

This adds basic support, I think there are two more things that can be done here:

  • C API unit tests should link against libMLIR-C.so. Currently these still link statically. Actually, this already works when MLIR_BUILD_MLIR_C_DYLIB is enabled.
  • Linking the test libs (not part of libMLIR.so) still pulls in dependencies statically that should come from libMLIR.so.

@llvmbot llvmbot added mlir:core MLIR Core Infrastructure mlir labels Dec 10, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 10, 2024

@llvm/pr-subscribers-mlir

Author: Nikita Popov (nikic)

Changes

While MLIR currently supports building a libMLIR.so, it does not support actually linking against it for its own tools. When building with LTO, this means we have to relink the world for every tool, and the resulting binaries are large.

This adds basic support for MLIR_LINK_MLIR_DYLIB, modelled after how CLANG_LINK_CLANG_DYLIB is implemented: Libraries that are part of libMLIR.so should be added via mlir_target_link_libraries instead of target_link_libraries. This will replace them with libMLIR.so if MLIR_LINK_MLIR_DYLIB is enabled.

This adds basic support, I think there are two more things that can be done here:

  • C API unit tests should link against libMLIR-C.so. Currently these still link statically.
  • Linking the test libs (not part of libMLIR.so) still pulls in dependencies statically that should come from libMLIR.so.

Full diff: https://github.com/llvm/llvm-project/pull/119408.diff

11 Files Affected:

  • (modified) mlir/CMakeLists.txt (+3)
  • (modified) mlir/cmake/modules/AddMLIR.cmake (+12)
  • (modified) mlir/tools/mlir-cpu-runner/CMakeLists.txt (+5-3)
  • (modified) mlir/tools/mlir-lsp-server/CMakeLists.txt (+2-5)
  • (modified) mlir/tools/mlir-opt/CMakeLists.txt (+3-4)
  • (modified) mlir/tools/mlir-parser-fuzzer/bytecode/CMakeLists.txt (+1-1)
  • (modified) mlir/tools/mlir-parser-fuzzer/text/CMakeLists.txt (+1-1)
  • (modified) mlir/tools/mlir-query/CMakeLists.txt (+2-2)
  • (modified) mlir/tools/mlir-reduce/CMakeLists.txt (+2-5)
  • (modified) mlir/tools/mlir-rewrite/CMakeLists.txt (+1-4)
  • (modified) mlir/tools/mlir-translate/CMakeLists.txt (+6-3)
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 82bfbe56f08395..0608eef15c5a4b 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -153,6 +153,9 @@ set(MLIR_INSTALL_AGGREGATE_OBJECTS 1 CACHE BOOL
 
 set(MLIR_BUILD_MLIR_C_DYLIB 0 CACHE BOOL "Builds libMLIR-C shared library.")
 
+set(MLIR_LINK_MLIR_DYLIB ${LLVM_LINK_LLVM_DYLIB} CACHE BOOL
+    "Link tools against libMLIR.so")
+
 configure_file(
   ${MLIR_MAIN_INCLUDE_DIR}/mlir/Config/mlir-config.h.cmake
   ${MLIR_INCLUDE_DIR}/mlir/Config/mlir-config.h)
diff --git a/mlir/cmake/modules/AddMLIR.cmake b/mlir/cmake/modules/AddMLIR.cmake
index a3324705c525ce..d8f9cccd54dc6c 100644
--- a/mlir/cmake/modules/AddMLIR.cmake
+++ b/mlir/cmake/modules/AddMLIR.cmake
@@ -717,3 +717,15 @@ function(mlir_check_all_link_libraries name)
     endforeach()
   endif()
 endfunction(mlir_check_all_link_libraries)
+
+function(mlir_target_link_libraries target type)
+  if (TARGET obj.${target})
+    target_link_libraries(obj.${target} ${ARGN})
+  endif()
+
+  if (MLIR_LINK_MLIR_DYLIB)
+    target_link_libraries(${target} ${type} MLIR)
+  else()
+    target_link_libraries(${target} ${type} ${ARGN})
+  endif()
+endfunction()
diff --git a/mlir/tools/mlir-cpu-runner/CMakeLists.txt b/mlir/tools/mlir-cpu-runner/CMakeLists.txt
index ae6dbceca855d1..811583b97bc71d 100644
--- a/mlir/tools/mlir-cpu-runner/CMakeLists.txt
+++ b/mlir/tools/mlir-cpu-runner/CMakeLists.txt
@@ -11,12 +11,10 @@ add_mlir_tool(mlir-cpu-runner
   EXPORT_SYMBOLS
   )
 llvm_update_compile_flags(mlir-cpu-runner)
-target_link_libraries(mlir-cpu-runner PRIVATE
+mlir_target_link_libraries(mlir-cpu-runner PRIVATE
   MLIRAnalysis
   MLIRBuiltinToLLVMIRTranslation
-  MLIRExecutionEngine
   MLIRIR
-  MLIRJitRunner
   MLIRLLVMDialect
   MLIRLLVMToLLVMIRTranslation
   MLIRToLLVMIRTranslationRegistration
@@ -24,3 +22,7 @@ target_link_libraries(mlir-cpu-runner PRIVATE
   MLIRTargetLLVMIRExport
   MLIRSupport
   )
+target_link_libraries(mlir-cpu-runner PRIVATE
+  MLIRExecutionEngine
+  MLIRJitRunner
+  )
diff --git a/mlir/tools/mlir-lsp-server/CMakeLists.txt b/mlir/tools/mlir-lsp-server/CMakeLists.txt
index 8ff9cc2f07e8eb..6932e0f3977951 100644
--- a/mlir/tools/mlir-lsp-server/CMakeLists.txt
+++ b/mlir/tools/mlir-lsp-server/CMakeLists.txt
@@ -38,7 +38,6 @@ set(LIBS
   ${conversion_libs}
   ${dialect_libs}
   ${extension_libs}
-  ${test_libs}
 
   MLIRAffineAnalysis
   MLIRAnalysis
@@ -56,11 +55,9 @@ set(LIBS
 
 add_mlir_tool(mlir-lsp-server
   mlir-lsp-server.cpp
-
-  DEPENDS
-  ${LIBS}
   )
-target_link_libraries(mlir-lsp-server PRIVATE ${LIBS})
+mlir_target_link_libraries(mlir-lsp-server PRIVATE ${LIBS})
+target_link_libraries(mlir-lsp-server PRIVATE ${test_libs})
 llvm_update_compile_flags(mlir-lsp-server)
 
 mlir_check_all_link_libraries(mlir-lsp-server)
diff --git a/mlir/tools/mlir-opt/CMakeLists.txt b/mlir/tools/mlir-opt/CMakeLists.txt
index 8b79de58fa1028..71ab67d94ef91f 100644
--- a/mlir/tools/mlir-opt/CMakeLists.txt
+++ b/mlir/tools/mlir-opt/CMakeLists.txt
@@ -45,6 +45,7 @@ if(MLIR_INCLUDE_TESTS)
     MLIRTestReducer
     MLIRTestTransforms
     MLIRTilingInterfaceTestPasses
+    MLIRTosaTestPasses
     MLIRVectorTestPasses
     MLIRTestVectorToSPIRV
     MLIRLLVMTestPasses
@@ -66,7 +67,6 @@ set(LIBS
   ${dialect_libs}
   ${conversion_libs}
   ${extension_libs}
-  ${test_libs}
 
   MLIRAffineAnalysis
   MLIRAnalysis
@@ -99,11 +99,10 @@ add_mlir_library(MLIRMlirOptMain
 add_mlir_tool(mlir-opt
   mlir-opt.cpp
 
-  DEPENDS
-  ${LIBS}
   SUPPORT_PLUGINS
   )
-target_link_libraries(mlir-opt PRIVATE ${LIBS})
+mlir_target_link_libraries(mlir-opt PRIVATE ${LIBS})
+target_link_libraries(mlir-opt PRIVATE ${test_libs})
 llvm_update_compile_flags(mlir-opt)
 
 mlir_check_all_link_libraries(mlir-opt)
diff --git a/mlir/tools/mlir-parser-fuzzer/bytecode/CMakeLists.txt b/mlir/tools/mlir-parser-fuzzer/bytecode/CMakeLists.txt
index 7d922656ad12f4..e17b1588519898 100644
--- a/mlir/tools/mlir-parser-fuzzer/bytecode/CMakeLists.txt
+++ b/mlir/tools/mlir-parser-fuzzer/bytecode/CMakeLists.txt
@@ -6,7 +6,7 @@ add_llvm_fuzzer(mlir-bytecode-parser-fuzzer
   mlir-bytecode-parser-fuzzer.cpp
   DUMMY_MAIN DummyParserFuzzer.cpp
 )
-target_link_libraries(mlir-bytecode-parser-fuzzer
+mlir_target_link_libraries(mlir-bytecode-parser-fuzzer
   PUBLIC
   MLIRIR
   MLIRParser
diff --git a/mlir/tools/mlir-parser-fuzzer/text/CMakeLists.txt b/mlir/tools/mlir-parser-fuzzer/text/CMakeLists.txt
index a9c9e1047b54ef..b4a2bacc0ee0be 100644
--- a/mlir/tools/mlir-parser-fuzzer/text/CMakeLists.txt
+++ b/mlir/tools/mlir-parser-fuzzer/text/CMakeLists.txt
@@ -6,7 +6,7 @@ add_llvm_fuzzer(mlir-text-parser-fuzzer
   mlir-text-parser-fuzzer.cpp
   DUMMY_MAIN DummyParserFuzzer.cpp
 )
-target_link_libraries(mlir-text-parser-fuzzer
+mlir_target_link_libraries(mlir-text-parser-fuzzer
   PUBLIC
   MLIRIR
   MLIRParser
diff --git a/mlir/tools/mlir-query/CMakeLists.txt b/mlir/tools/mlir-query/CMakeLists.txt
index ef2e5a84b5569b..18263970a7bbc7 100644
--- a/mlir/tools/mlir-query/CMakeLists.txt
+++ b/mlir/tools/mlir-query/CMakeLists.txt
@@ -10,11 +10,11 @@ add_mlir_tool(mlir-query
   mlir-query.cpp
   )
 llvm_update_compile_flags(mlir-query)
-target_link_libraries(mlir-query
+mlir_target_link_libraries(mlir-query
   PRIVATE
   ${dialect_libs}
-  ${test_libs}
   MLIRQueryLib
   )
+target_link_libraries(mlir-query PRIVATE ${test_libs})
 
 mlir_check_link_libraries(mlir-query)
diff --git a/mlir/tools/mlir-reduce/CMakeLists.txt b/mlir/tools/mlir-reduce/CMakeLists.txt
index 8549dbf805f54e..d71ac861a29dca 100644
--- a/mlir/tools/mlir-reduce/CMakeLists.txt
+++ b/mlir/tools/mlir-reduce/CMakeLists.txt
@@ -10,7 +10,6 @@ endif()
 set(LIBS
   ${conversion_libs}
   ${dialect_libs}
-  ${test_libs}
   MLIRDialect
   MLIRIR
   MLIRPass
@@ -19,12 +18,10 @@ set(LIBS
 
 add_mlir_tool(mlir-reduce
   mlir-reduce.cpp
-
-  DEPENDS
-  ${LIBS}
   )
 
-target_link_libraries(mlir-reduce PRIVATE ${LIBS})
+mlir_target_link_libraries(mlir-reduce PRIVATE ${LIBS})
+target_link_libraries(mlir-reduce PRIVATE ${test_libs})
 llvm_update_compile_flags(mlir-reduce)
 
 mlir_check_all_link_libraries(mlir-reduce)
diff --git a/mlir/tools/mlir-rewrite/CMakeLists.txt b/mlir/tools/mlir-rewrite/CMakeLists.txt
index 5b8c1cd4553997..216491eb432af0 100644
--- a/mlir/tools/mlir-rewrite/CMakeLists.txt
+++ b/mlir/tools/mlir-rewrite/CMakeLists.txt
@@ -5,7 +5,6 @@ set(LLVM_LINK_COMPONENTS
 
 set(LIBS
   ${dialect_libs}
-  ${test_libs}
 
   MLIRAffineAnalysis
   MLIRAnalysis
@@ -24,11 +23,9 @@ include_directories(../../../clang/include)
 add_mlir_tool(mlir-rewrite
   mlir-rewrite.cpp
 
-  DEPENDS
-  ${LIBS}
   SUPPORT_PLUGINS
   )
-target_link_libraries(mlir-rewrite PRIVATE ${LIBS})
+mlir_target_link_libraries(mlir-rewrite PRIVATE ${LIBS})
 llvm_update_compile_flags(mlir-rewrite)
 
 mlir_check_all_link_libraries(mlir-rewrite)
diff --git a/mlir/tools/mlir-translate/CMakeLists.txt b/mlir/tools/mlir-translate/CMakeLists.txt
index a78131b8c356c0..b356e04bb1dc4a 100644
--- a/mlir/tools/mlir-translate/CMakeLists.txt
+++ b/mlir/tools/mlir-translate/CMakeLists.txt
@@ -9,11 +9,9 @@ add_mlir_tool(mlir-translate
   mlir-translate.cpp
   )
 llvm_update_compile_flags(mlir-translate)
-target_link_libraries(mlir-translate
+mlir_target_link_libraries(mlir-translate
   PRIVATE
   ${dialect_libs}
-  ${translation_libs}
-  ${test_libs}
   MLIRIR
   MLIRParser
   MLIRPass
@@ -21,5 +19,10 @@ target_link_libraries(mlir-translate
   MLIRTranslateLib
   MLIRSupport
   )
+target_link_libraries(mlir-translate
+  PRIVATE
+  ${translation_libs}
+  ${test_libs}
+  )
 
 mlir_check_link_libraries(mlir-translate)

@llvmbot
Copy link
Member

llvmbot commented Dec 10, 2024

@llvm/pr-subscribers-mlir-core

Author: Nikita Popov (nikic)

Changes

While MLIR currently supports building a libMLIR.so, it does not support actually linking against it for its own tools. When building with LTO, this means we have to relink the world for every tool, and the resulting binaries are large.

This adds basic support for MLIR_LINK_MLIR_DYLIB, modelled after how CLANG_LINK_CLANG_DYLIB is implemented: Libraries that are part of libMLIR.so should be added via mlir_target_link_libraries instead of target_link_libraries. This will replace them with libMLIR.so if MLIR_LINK_MLIR_DYLIB is enabled.

This adds basic support, I think there are two more things that can be done here:

  • C API unit tests should link against libMLIR-C.so. Currently these still link statically.
  • Linking the test libs (not part of libMLIR.so) still pulls in dependencies statically that should come from libMLIR.so.

Full diff: https://github.com/llvm/llvm-project/pull/119408.diff

11 Files Affected:

  • (modified) mlir/CMakeLists.txt (+3)
  • (modified) mlir/cmake/modules/AddMLIR.cmake (+12)
  • (modified) mlir/tools/mlir-cpu-runner/CMakeLists.txt (+5-3)
  • (modified) mlir/tools/mlir-lsp-server/CMakeLists.txt (+2-5)
  • (modified) mlir/tools/mlir-opt/CMakeLists.txt (+3-4)
  • (modified) mlir/tools/mlir-parser-fuzzer/bytecode/CMakeLists.txt (+1-1)
  • (modified) mlir/tools/mlir-parser-fuzzer/text/CMakeLists.txt (+1-1)
  • (modified) mlir/tools/mlir-query/CMakeLists.txt (+2-2)
  • (modified) mlir/tools/mlir-reduce/CMakeLists.txt (+2-5)
  • (modified) mlir/tools/mlir-rewrite/CMakeLists.txt (+1-4)
  • (modified) mlir/tools/mlir-translate/CMakeLists.txt (+6-3)
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 82bfbe56f08395..0608eef15c5a4b 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -153,6 +153,9 @@ set(MLIR_INSTALL_AGGREGATE_OBJECTS 1 CACHE BOOL
 
 set(MLIR_BUILD_MLIR_C_DYLIB 0 CACHE BOOL "Builds libMLIR-C shared library.")
 
+set(MLIR_LINK_MLIR_DYLIB ${LLVM_LINK_LLVM_DYLIB} CACHE BOOL
+    "Link tools against libMLIR.so")
+
 configure_file(
   ${MLIR_MAIN_INCLUDE_DIR}/mlir/Config/mlir-config.h.cmake
   ${MLIR_INCLUDE_DIR}/mlir/Config/mlir-config.h)
diff --git a/mlir/cmake/modules/AddMLIR.cmake b/mlir/cmake/modules/AddMLIR.cmake
index a3324705c525ce..d8f9cccd54dc6c 100644
--- a/mlir/cmake/modules/AddMLIR.cmake
+++ b/mlir/cmake/modules/AddMLIR.cmake
@@ -717,3 +717,15 @@ function(mlir_check_all_link_libraries name)
     endforeach()
   endif()
 endfunction(mlir_check_all_link_libraries)
+
+function(mlir_target_link_libraries target type)
+  if (TARGET obj.${target})
+    target_link_libraries(obj.${target} ${ARGN})
+  endif()
+
+  if (MLIR_LINK_MLIR_DYLIB)
+    target_link_libraries(${target} ${type} MLIR)
+  else()
+    target_link_libraries(${target} ${type} ${ARGN})
+  endif()
+endfunction()
diff --git a/mlir/tools/mlir-cpu-runner/CMakeLists.txt b/mlir/tools/mlir-cpu-runner/CMakeLists.txt
index ae6dbceca855d1..811583b97bc71d 100644
--- a/mlir/tools/mlir-cpu-runner/CMakeLists.txt
+++ b/mlir/tools/mlir-cpu-runner/CMakeLists.txt
@@ -11,12 +11,10 @@ add_mlir_tool(mlir-cpu-runner
   EXPORT_SYMBOLS
   )
 llvm_update_compile_flags(mlir-cpu-runner)
-target_link_libraries(mlir-cpu-runner PRIVATE
+mlir_target_link_libraries(mlir-cpu-runner PRIVATE
   MLIRAnalysis
   MLIRBuiltinToLLVMIRTranslation
-  MLIRExecutionEngine
   MLIRIR
-  MLIRJitRunner
   MLIRLLVMDialect
   MLIRLLVMToLLVMIRTranslation
   MLIRToLLVMIRTranslationRegistration
@@ -24,3 +22,7 @@ target_link_libraries(mlir-cpu-runner PRIVATE
   MLIRTargetLLVMIRExport
   MLIRSupport
   )
+target_link_libraries(mlir-cpu-runner PRIVATE
+  MLIRExecutionEngine
+  MLIRJitRunner
+  )
diff --git a/mlir/tools/mlir-lsp-server/CMakeLists.txt b/mlir/tools/mlir-lsp-server/CMakeLists.txt
index 8ff9cc2f07e8eb..6932e0f3977951 100644
--- a/mlir/tools/mlir-lsp-server/CMakeLists.txt
+++ b/mlir/tools/mlir-lsp-server/CMakeLists.txt
@@ -38,7 +38,6 @@ set(LIBS
   ${conversion_libs}
   ${dialect_libs}
   ${extension_libs}
-  ${test_libs}
 
   MLIRAffineAnalysis
   MLIRAnalysis
@@ -56,11 +55,9 @@ set(LIBS
 
 add_mlir_tool(mlir-lsp-server
   mlir-lsp-server.cpp
-
-  DEPENDS
-  ${LIBS}
   )
-target_link_libraries(mlir-lsp-server PRIVATE ${LIBS})
+mlir_target_link_libraries(mlir-lsp-server PRIVATE ${LIBS})
+target_link_libraries(mlir-lsp-server PRIVATE ${test_libs})
 llvm_update_compile_flags(mlir-lsp-server)
 
 mlir_check_all_link_libraries(mlir-lsp-server)
diff --git a/mlir/tools/mlir-opt/CMakeLists.txt b/mlir/tools/mlir-opt/CMakeLists.txt
index 8b79de58fa1028..71ab67d94ef91f 100644
--- a/mlir/tools/mlir-opt/CMakeLists.txt
+++ b/mlir/tools/mlir-opt/CMakeLists.txt
@@ -45,6 +45,7 @@ if(MLIR_INCLUDE_TESTS)
     MLIRTestReducer
     MLIRTestTransforms
     MLIRTilingInterfaceTestPasses
+    MLIRTosaTestPasses
     MLIRVectorTestPasses
     MLIRTestVectorToSPIRV
     MLIRLLVMTestPasses
@@ -66,7 +67,6 @@ set(LIBS
   ${dialect_libs}
   ${conversion_libs}
   ${extension_libs}
-  ${test_libs}
 
   MLIRAffineAnalysis
   MLIRAnalysis
@@ -99,11 +99,10 @@ add_mlir_library(MLIRMlirOptMain
 add_mlir_tool(mlir-opt
   mlir-opt.cpp
 
-  DEPENDS
-  ${LIBS}
   SUPPORT_PLUGINS
   )
-target_link_libraries(mlir-opt PRIVATE ${LIBS})
+mlir_target_link_libraries(mlir-opt PRIVATE ${LIBS})
+target_link_libraries(mlir-opt PRIVATE ${test_libs})
 llvm_update_compile_flags(mlir-opt)
 
 mlir_check_all_link_libraries(mlir-opt)
diff --git a/mlir/tools/mlir-parser-fuzzer/bytecode/CMakeLists.txt b/mlir/tools/mlir-parser-fuzzer/bytecode/CMakeLists.txt
index 7d922656ad12f4..e17b1588519898 100644
--- a/mlir/tools/mlir-parser-fuzzer/bytecode/CMakeLists.txt
+++ b/mlir/tools/mlir-parser-fuzzer/bytecode/CMakeLists.txt
@@ -6,7 +6,7 @@ add_llvm_fuzzer(mlir-bytecode-parser-fuzzer
   mlir-bytecode-parser-fuzzer.cpp
   DUMMY_MAIN DummyParserFuzzer.cpp
 )
-target_link_libraries(mlir-bytecode-parser-fuzzer
+mlir_target_link_libraries(mlir-bytecode-parser-fuzzer
   PUBLIC
   MLIRIR
   MLIRParser
diff --git a/mlir/tools/mlir-parser-fuzzer/text/CMakeLists.txt b/mlir/tools/mlir-parser-fuzzer/text/CMakeLists.txt
index a9c9e1047b54ef..b4a2bacc0ee0be 100644
--- a/mlir/tools/mlir-parser-fuzzer/text/CMakeLists.txt
+++ b/mlir/tools/mlir-parser-fuzzer/text/CMakeLists.txt
@@ -6,7 +6,7 @@ add_llvm_fuzzer(mlir-text-parser-fuzzer
   mlir-text-parser-fuzzer.cpp
   DUMMY_MAIN DummyParserFuzzer.cpp
 )
-target_link_libraries(mlir-text-parser-fuzzer
+mlir_target_link_libraries(mlir-text-parser-fuzzer
   PUBLIC
   MLIRIR
   MLIRParser
diff --git a/mlir/tools/mlir-query/CMakeLists.txt b/mlir/tools/mlir-query/CMakeLists.txt
index ef2e5a84b5569b..18263970a7bbc7 100644
--- a/mlir/tools/mlir-query/CMakeLists.txt
+++ b/mlir/tools/mlir-query/CMakeLists.txt
@@ -10,11 +10,11 @@ add_mlir_tool(mlir-query
   mlir-query.cpp
   )
 llvm_update_compile_flags(mlir-query)
-target_link_libraries(mlir-query
+mlir_target_link_libraries(mlir-query
   PRIVATE
   ${dialect_libs}
-  ${test_libs}
   MLIRQueryLib
   )
+target_link_libraries(mlir-query PRIVATE ${test_libs})
 
 mlir_check_link_libraries(mlir-query)
diff --git a/mlir/tools/mlir-reduce/CMakeLists.txt b/mlir/tools/mlir-reduce/CMakeLists.txt
index 8549dbf805f54e..d71ac861a29dca 100644
--- a/mlir/tools/mlir-reduce/CMakeLists.txt
+++ b/mlir/tools/mlir-reduce/CMakeLists.txt
@@ -10,7 +10,6 @@ endif()
 set(LIBS
   ${conversion_libs}
   ${dialect_libs}
-  ${test_libs}
   MLIRDialect
   MLIRIR
   MLIRPass
@@ -19,12 +18,10 @@ set(LIBS
 
 add_mlir_tool(mlir-reduce
   mlir-reduce.cpp
-
-  DEPENDS
-  ${LIBS}
   )
 
-target_link_libraries(mlir-reduce PRIVATE ${LIBS})
+mlir_target_link_libraries(mlir-reduce PRIVATE ${LIBS})
+target_link_libraries(mlir-reduce PRIVATE ${test_libs})
 llvm_update_compile_flags(mlir-reduce)
 
 mlir_check_all_link_libraries(mlir-reduce)
diff --git a/mlir/tools/mlir-rewrite/CMakeLists.txt b/mlir/tools/mlir-rewrite/CMakeLists.txt
index 5b8c1cd4553997..216491eb432af0 100644
--- a/mlir/tools/mlir-rewrite/CMakeLists.txt
+++ b/mlir/tools/mlir-rewrite/CMakeLists.txt
@@ -5,7 +5,6 @@ set(LLVM_LINK_COMPONENTS
 
 set(LIBS
   ${dialect_libs}
-  ${test_libs}
 
   MLIRAffineAnalysis
   MLIRAnalysis
@@ -24,11 +23,9 @@ include_directories(../../../clang/include)
 add_mlir_tool(mlir-rewrite
   mlir-rewrite.cpp
 
-  DEPENDS
-  ${LIBS}
   SUPPORT_PLUGINS
   )
-target_link_libraries(mlir-rewrite PRIVATE ${LIBS})
+mlir_target_link_libraries(mlir-rewrite PRIVATE ${LIBS})
 llvm_update_compile_flags(mlir-rewrite)
 
 mlir_check_all_link_libraries(mlir-rewrite)
diff --git a/mlir/tools/mlir-translate/CMakeLists.txt b/mlir/tools/mlir-translate/CMakeLists.txt
index a78131b8c356c0..b356e04bb1dc4a 100644
--- a/mlir/tools/mlir-translate/CMakeLists.txt
+++ b/mlir/tools/mlir-translate/CMakeLists.txt
@@ -9,11 +9,9 @@ add_mlir_tool(mlir-translate
   mlir-translate.cpp
   )
 llvm_update_compile_flags(mlir-translate)
-target_link_libraries(mlir-translate
+mlir_target_link_libraries(mlir-translate
   PRIVATE
   ${dialect_libs}
-  ${translation_libs}
-  ${test_libs}
   MLIRIR
   MLIRParser
   MLIRPass
@@ -21,5 +19,10 @@ target_link_libraries(mlir-translate
   MLIRTranslateLib
   MLIRSupport
   )
+target_link_libraries(mlir-translate
+  PRIVATE
+  ${translation_libs}
+  ${test_libs}
+  )
 
 mlir_check_link_libraries(mlir-translate)

While MLIR currently supports building a libMLIR.so, it does not
support actually linking against it for its own tools. When building
with LTO, this means we have to relink the world for every tool,
and the resulting binaries are large.

This adds basic support for MLIR_LINK_MLIR_DYLIB, modelled after
how CLANG_LINK_CLANG_DYLIB is implemented: Libraries that are
part of libMLIR.so should be added via mlir_target_link_libraries
instead of target_link_libraries. This will replace them with
libMLIR.so if MLIR_LINK_MLIR_DYLIB is enabled.

This adds basic support, I think there are two more things that
can be done here:
 * C API unit tests should link against libMLIR-C.so. Currently
   these still link statically.
 * Linking the test libs (not part of libMLIR.so) still pulls in
   dependencies statically that should come from libMLIR.so.
@@ -717,3 +717,15 @@ function(mlir_check_all_link_libraries name)
endforeach()
endif()
endfunction(mlir_check_all_link_libraries)

function(mlir_target_link_libraries target type)
Copy link
Collaborator

@joker-eph joker-eph Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you document this? (why it is there and when/how it should be used?)

My concern isn't really in the context of this PR, but for people who have to read the cmake code later and try to figure out what's going on.

@nikic nikic merged commit 10ef20f into llvm:main Dec 12, 2024
8 checks passed
@nikic nikic deleted the mlir-link-dylib branch December 12, 2024 13:59
@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 12, 2024

LLVM Buildbot has detected a new failure on builder flang-aarch64-libcxx running on linaro-flang-aarch64-libcxx while building mlir at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/89/builds/12531

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
75.806 [1591/77/5627] Creating library symlink lib/libMLIRTestPDLL.so
75.806 [1591/76/5628] Creating library symlink lib/libclangAST.so
75.808 [1591/75/5629] Creating library symlink lib/libMLIRTestOneToNTypeConversionPass.so
75.813 [1591/74/5630] Creating library symlink lib/libMLIRFuncTestPasses.so
75.814 [1591/73/5631] Creating library symlink lib/libMLIRMemRefTestPasses.so
75.814 [1591/72/5632] Creating library symlink lib/libMLIRGPUTestPasses.so
75.815 [1591/71/5633] Creating library symlink lib/libMLIRCAPIConversion.so
75.817 [1591/70/5634] Creating library symlink lib/libMLIRDLTITestPasses.so
75.842 [1591/69/5635] Linking CXX shared library lib/libMLIRTestFuncToLLVM.so.20.0git
75.982 [1591/68/5636] Linking CXX shared library lib/libMLIRMlirOptMain.so.20.0git
FAILED: lib/libMLIRMlirOptMain.so.20.0git 
: && /usr/local/bin/c++ -fPIC -stdlib=libc++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -O3 -DNDEBUG  -stdlib=libc++ -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRMlirOptMain.so.20.0git -o lib/libMLIRMlirOptMain.so.20.0git tools/mlir/tools/mlir-opt/CMakeFiles/MLIRMlirOptMain.dir/mlir-opt.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/lib:"  lib/libMLIRAffineTransformOps.so.20.0git  lib/libMLIRAMDGPUTransforms.so.20.0git  lib/libMLIRArithValueBoundsOpInterfaceImpl.so.20.0git  lib/libMLIRArmNeonTransforms.so.20.0git  lib/libMLIRAsyncTransforms.so.20.0git  lib/libMLIRBufferizationPipelines.so.20.0git  lib/libMLIRBufferizationTransformOps.so.20.0git  lib/libMLIRControlFlowTransforms.so.20.0git  lib/libMLIRDLTITransformOps.so.20.0git  lib/libMLIRFuncTransformOps.so.20.0git  lib/libMLIRGPUTransformOps.so.20.0git  lib/libMLIRGPUPipelines.so.20.0git  lib/libMLIRMathTransforms.so.20.0git  lib/libMLIRMemRefTransformOps.so.20.0git  lib/libMLIRMLProgramTransforms.so.20.0git  lib/libMLIRNVGPUTransformOps.so.20.0git  lib/libMLIRNVGPUTransforms.so.20.0git  lib/libMLIROpenACCTransforms.so.20.0git  lib/libMLIRPolynomialDialect.so.20.0git  lib/libMLIRPtrDialect.so.20.0git  lib/libMLIRQuantTransforms.so.20.0git  lib/libMLIRSCFTransformOps.so.20.0git  lib/libMLIRShapeOpsTransforms.so.20.0git  lib/libMLIRSparseTensorPipelines.so.20.0git  lib/libMLIRSparseTensorTransformOps.so.20.0git  lib/libMLIRSparseTensorTransforms.so.20.0git  lib/libMLIRSparseTensorUtils.so.20.0git  lib/libMLIRSPIRVModuleCombiner.so.20.0git  lib/libMLIRTensorInferTypeOpInterfaceImpl.so.20.0git  lib/libMLIRTensorTransformOps.so.20.0git  lib/libMLIRTransformDebugExtension.so.20.0git  lib/libMLIRTransformDialectIRDLExtension.so.20.0git  lib/libMLIRTransformLoopExtension.so.20.0git  lib/libMLIRTransformPDLExtension.so.20.0git  lib/libMLIRTransformDialectTransforms.so.20.0git  lib/libMLIRVectorTransformOps.so.20.0git  lib/libMLIRXeGPUTransforms.so.20.0git  lib/libMLIRTestDynDialect.so.20.0git  lib/libMLIRTosaTestPasses.so.20.0git  lib/libMLIRArithToAMDGPU.so.20.0git  lib/libMLIRArithToArmSME.so.20.0git  lib/libMLIRArithToEmitC.so.20.0git  lib/libMLIRArmNeon2dToIntr.so.20.0git  lib/libMLIRArmSMEToSCF.so.20.0git  lib/libMLIRArmSMEToLLVM.so.20.0git  lib/libMLIRBufferizationToMemRef.so.20.0git  lib/libMLIRComplexToLibm.so.20.0git  lib/libMLIRComplexToLLVM.so.20.0git  lib/libMLIRComplexToSPIRV.so.20.0git  lib/libMLIRComplexToStandard.so.20.0git  lib/libMLIRControlFlowToSCF.so.20.0git  lib/libMLIRControlFlowToSPIRV.so.20.0git  lib/libMLIRConvertToSPIRVPass.so.20.0git  lib/libMLIRFuncToEmitC.so.20.0git  lib/libMLIRGPUToLLVMSPV.so.20.0git  lib/libMLIRGPUToNVVMTransforms.so.20.0git  lib/libMLIRGPUToROCDLTransforms.so.20.0git  lib/libMLIRGPUToSPIRV.so.20.0git  lib/libMLIRGPUToVulkanTransforms.so.20.0git  lib/libMLIRIndexToLLVM.so.20.0git  lib/libMLIRLinalgToStandard.so.20.0git  lib/libMLIRMathToFuncs.so.20.0git  lib/libMLIRMathToLibm.so.20.0git  lib/libMLIRMathToLLVM.so.20.0git  lib/libMLIRMathToROCDL.so.20.0git  lib/libMLIRMathToSPIRV.so.20.0git  lib/libMLIRMemRefToEmitC.so.20.0git  lib/libMLIRMeshToMPI.so.20.0git  lib/libMLIRNVGPUToNVVM.so.20.0git  lib/libMLIRNVVMToLLVM.so.20.0git  lib/libMLIROpenACCToSCF.so.20.0git  lib/libMLIROpenMPToLLVM.so.20.0git  lib/libMLIRReconcileUnrealizedCasts.so.20.0git  lib/libMLIRSCFToControlFlow.so.20.0git  lib/libMLIRSCFToEmitC.so.20.0git  lib/libMLIRSCFToGPU.so.20.0git  lib/libMLIRSCFToOpenMP.so.20.0git  lib/libMLIRSCFToSPIRV.so.20.0git  lib/libMLIRShapeToStandard.so.20.0git  lib/libMLIRSPIRVToLLVM.so.20.0git  lib/libMLIRTensorToLinalg.so.20.0git  lib/libMLIRTensorToSPIRV.so.20.0git  lib/libMLIRTosaToArith.so.20.0git  lib/libMLIRTosaToLinalg.so.20.0git  lib/libMLIRTosaToMLProgram.so.20.0git  lib/libMLIRTosaToSCF.so.20.0git  lib/libMLIRTosaToTensor.so.20.0git  lib/libMLIRUBToLLVM.so.20.0git  lib/libMLIRUBToSPIRV.so.20.0git  lib/libMLIRVectorToArmSME.so.20.0git  lib/libMLIRVectorToGPU.so.20.0git  lib/libMLIRVectorToLLVMPass.so.20.0git  lib/libMLIRVectorToSPIRV.so.20.0git  lib/libMLIRVectorToXeGPU.so.20.0git  lib/libMLIRFuncAllExtensions.so.20.0git  lib/libMLIRTensorAllExtensions.so.20.0git  lib/libMLIROptLib.so.20.0git  lib/libMLIRToLLVMIRTranslationRegistration.so.20.0git  lib/libMLIRAMXTransforms.so.20.0git  lib/libMLIRArmSVETransforms.so.20.0git  lib/libMLIRLinalgTransformOps.so.20.0git  lib/libMLIRTransformDialect.so.20.0git  lib/libMLIRTransformDialectInterfaces.so.20.0git  lib/libMLIRTransformDialectUtils.so.20.0git  lib/libMLIRX86VectorTransforms.so.20.0git  lib/libMLIREmitCTransforms.so.20.0git  lib/libMLIRArmSMETransforms.so.20.0git  lib/libMLIRSPIRVTransforms.so.20.0git  lib/libMLIRIndexToSPIRV.so.20.0git  lib/libMLIRMemRefToSPIRV.so.20.0git  lib/libMLIRAMDGPUToROCDL.so.20.0git  lib/libMLIRAMDGPUUtils.so.20.0git  lib/libMLIRAMDGPUDialect.so.20.0git  lib/libMLIRGPUToGPURuntimeTransforms.so.20.0git  lib/libMLIRAsyncToLLVM.so.20.0git  lib/libMLIRConvertToLLVMPass.so.20.0git  lib/libMLIRConvertToLLVMInterface.so.20.0git  lib/libMLIRVectorToLLVM.so.20.0git  lib/libMLIRMPIDialect.so.20.0git  lib/libMLIREmitCDialect.so.20.0git  lib/libMLIRGPUTransforms.so.20.0git  lib/libMLIRAsyncDialect.so.20.0git  lib/libMLIRSPIRVTarget.so.20.0git  lib/libMLIRSPIRVSerialization.so.20.0git  lib/libMLIRSPIRVBinaryUtils.so.20.0git  lib/libMLIRNVVMTarget.so.20.0git  lib/libMLIRROCDLTarget.so.20.0git  lib/libMLIRTargetLLVM.so.20.0git  lib/libMLIRExecutionEngineUtils.so.20.0git  lib/libLLVMPasses.so.20.0git  lib/libLLVMTarget.so.20.0git  lib/libLLVMipo.so.20.0git  lib/libLLVMLinker.so.20.0git  lib/libMLIRAffineToStandard.so.20.0git  lib/libMLIRShapeDialect.so.20.0git  lib/libMLIRSPIRVUtils.so.20.0git  lib/libMLIRFuncToLLVM.so.20.0git  lib/libMLIRArithToLLVM.so.20.0git  lib/libMLIRArithAttrToLLVMConversion.so.20.0git  lib/libMLIRControlFlowToLLVM.so.20.0git  lib/libMLIRMemRefToLLVM.so.20.0git  lib/libMLIRSPIRVAttrToLLVMConversion.so.20.0git  lib/libMLIRLinalgTransforms.so.20.0git  lib/libMLIRMemRefTransforms.so.20.0git  lib/libMLIRArithTransforms.so.20.0git  lib/libMLIRFuncTransforms.so.20.0git  lib/libMLIRMeshTransforms.so.20.0git  lib/libMLIRTosaShardingInterfaceImpl.so.20.0git  lib/libMLIRSCFTransforms.so.20.0git  lib/libMLIRBufferizationTransforms.so.20.0git  lib/libMLIRTensorTransforms.so.20.0git  lib/libMLIRAffineTransforms.so.20.0git  lib/libMLIRSCFUtils.so.20.0git  lib/libMLIRTensorTilingInterfaceImpl.so.20.0git  lib/libMLIRTilingInterface.so.20.0git  lib/libMLIRVectorToSCF.so.20.0git  lib/libMLIRArithToSPIRV.so.20.0git  lib/libMLIRFuncToSPIRV.so.20.0git  lib/libMLIRSPIRVConversion.so.20.0git  lib/libMLIRIndexDialect.so.20.0git  lib/libMLIRLinalgUtils.so.20.0git  lib/libMLIRMLProgramDialect.so.20.0git  lib/libMLIRTensorUtils.so.20.0git  lib/libMLIRTosaTransforms.so.20.0git  lib/libMLIRTosaDialect.so.20.0git  lib/libMLIRQuantUtils.so.20.0git  lib/libMLIRQuantDialect.so.20.0git  lib/libMLIRLLVMCommonConversion.so.20.0git  lib/libMLIRNVGPUUtils.so.20.0git  lib/libMLIRNVGPUDialect.so.20.0git  lib/libMLIRVectorTransforms.so.20.0git  lib/libMLIRAffineUtils.so.20.0git  lib/libMLIRLinalgDialect.so.20.0git  lib/libMLIRBufferizationDialect.so.20.0git  lib/libMLIRMathDialect.so.20.0git  lib/libMLIRSparseTensorDialect.so.20.0git  lib/libMLIRMemRefUtils.so.20.0git  lib/libMLIRVectorUtils.so.20.0git  lib/libMLIRAffineAnalysis.so.20.0git  lib/libMLIRXeGPUDialect.so.20.0git  lib/libMLIRFuncInlinerExtension.so.20.0git  lib/libMLIRFuncMeshShardingExtensions.so.20.0git  lib/libMLIRTensorMeshShardingExtensions.so.20.0git  lib/libMLIRShardingInterface.so.20.0git  lib/libMLIRMeshDialect.so.20.0git  lib/libMLIRIRDL.so.20.0git  lib/libMLIRBytecodeWriter.so.20.0git  lib/libMLIRBytecodeOpInterface.so.20.0git  lib/libMLIRDebug.so.20.0git  lib/libMLIRObservers.so.20.0git  lib/libMLIRPluginsLib.so.20.0git  lib/libMLIRNVVMToLLVMIRTranslation.so.20.0git  lib/libMLIRROCDLToLLVMIRTranslation.so.20.0git  lib/libMLIRROCDLDialect.so.20.0git  lib/libMLIRArmNeonToLLVMIRTranslation.so.20.0git  lib/libMLIRArmNeonDialect.so.20.0git  lib/libMLIRArmSMEToLLVMIRTranslation.so.20.0git  lib/libMLIRArmSMEDialect.so.20.0git  lib/libMLIRSCFDialect.so.20.0git  lib/libMLIRControlFlowDialect.so.20.0git  lib/libMLIRArmSVEToLLVMIRTranslation.so.20.0git  lib/libMLIRArmSVEDialect.so.20.0git  lib/libMLIRVectorDialect.so.20.0git  lib/libMLIRTensorDialect.so.20.0git  lib/libMLIRAffineDialect.so.20.0git  lib/libMLIRParallelCombiningOpInterface.so.20.0git  lib/libMLIRVectorInterfaces.so.20.0git  lib/libMLIRMaskableOpInterface.so.20.0git  lib/libMLIRMaskingOpInterface.so.20.0git  lib/libMLIRAMXToLLVMIRTranslation.so.20.0git  lib/libMLIRAMXDialect.so.20.0git  lib/libMLIRBuiltinToLLVMIRTranslation.so.20.0git  lib/libMLIRGPUToLLVMIRTranslation.so.20.0git  lib/libMLIRGPUDialect.so.20.0git  lib/libMLIRX86VectorToLLVMIRTranslation.so.20.0git  lib/libMLIRX86VectorDialect.so.20.0git  lib/libMLIRLLVMToLLVMIRTranslation.so.20.0git  lib/libMLIROpenACCToLLVMIRTranslation.so.20.0git  lib/libMLIROpenACCDialect.so.20.0git  lib/libMLIRMemRefDialect.so.20.0git  lib/libMLIRArithUtils.so.20.0git  lib/libMLIRComplexDialect.so.20.0git  lib/libMLIRArithDialect.so.20.0git  lib/libMLIRCastInterfaces.so.20.0git  lib/libMLIRInferIntRangeCommon.so.20.0git  lib/libMLIRDialect.so.20.0git  lib/libMLIRDialectUtils.so.20.0git  lib/libMLIRShapedOpInterfaces.so.20.0git  lib/libMLIROpenMPToLLVMIRTranslation.so.20.0git  lib/libMLIROpenMPDialect.so.20.0git  lib/libMLIROpenACCMPCommon.so.20.0git  lib/libMLIRSPIRVToLLVMIRTranslation.so.20.0git  lib/libMLIRSPIRVDialect.so.20.0git  lib/libMLIRUBDialect.so.20.0git  lib/libMLIRVCIXToLLVMIRTranslation.so.20.0git  lib/libMLIRVCIXDialect.so.20.0git  lib/libMLIRTargetLLVMIRExport.so.20.0git  lib/libMLIRDLTIDialect.so.20.0git  lib/libMLIRLLVMIRTransforms.so.20.0git  lib/libMLIRFuncDialect.so.20.0git  lib/libMLIRNVVMDialect.so.20.0git  lib/libMLIRTransforms.so.20.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.20.0git  lib/libMLIRLLVMDialect.so.20.0git  lib/libMLIRMemorySlotInterfaces.so.20.0git  lib/libLLVMBitWriter.so.20.0git  lib/libMLIRTransformUtils.so.20.0git  lib/libMLIRSubsetOpInterface.so.20.0git  lib/libMLIRValueBoundsOpInterface.so.20.0git  lib/libMLIRDestinationStyleOpInterface.so.20.0git  lib/libMLIRRewrite.so.20.0git  lib/libMLIRRewritePDL.so.20.0git  lib/libMLIRPDLToPDLInterp.so.20.0git  lib/libMLIRPDLInterpDialect.so.20.0git  lib/libMLIRPDLDialect.so.20.0git  lib/libMLIRPass.so.20.0git  lib/libMLIRAnalysis.so.20.0git  lib/libMLIRCallInterfaces.so.20.0git  lib/libMLIRControlFlowInterfaces.so.20.0git  lib/libMLIRPresburger.so.20.0git  lib/libMLIRLoopLikeInterface.so.20.0git  lib/libMLIRViewLikeInterface.so.20.0git  lib/libMLIRInferIntRangeInterface.so.20.0git  lib/libMLIRFunctionInterfaces.so.20.0git  lib/libMLIRDataLayoutInterfaces.so.20.0git  lib/libMLIRInferTypeOpInterface.so.20.0git  lib/libMLIRSideEffectInterfaces.so.20.0git  lib/libMLIRTranslateLib.so.20.0git  lib/libMLIRParser.so.20.0git  lib/libMLIRBytecodeReader.so.20.0git  lib/libMLIRAsmParser.so.20.0git  lib/libMLIRIR.so.20.0git  lib/libMLIRSupport.so.20.0git  lib/libLLVMFrontendOpenMP.so.20.0git  lib/libLLVMFrontendOffloading.so.20.0git  lib/libLLVMTransformUtils.so.20.0git  lib/libLLVMMCParser.so.20.0git  lib/libLLVMMC.so.20.0git  lib/libLLVMIRReader.so.20.0git  lib/libLLVMAsmParser.so.20.0git  lib/libLLVMBitReader.so.20.0git  lib/libLLVMCore.so.20.0git  lib/libLLVMBinaryFormat.so.20.0git  lib/libLLVMTargetParser.so.20.0git  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/lib && :
/usr/bin/ld: tools/mlir/tools/mlir-opt/CMakeFiles/MLIRMlirOptMain.dir/mlir-opt.cpp.o: in function `registerTestPasses()':
mlir-opt.cpp:(.text._Z18registerTestPassesv+0x8): undefined reference to `mlir::registerCloneTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0xc): undefined reference to `mlir::registerConvertToTargetEnvPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x10): undefined reference to `mlir::registerLazyLoadingTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x14): undefined reference to `mlir::registerLoopLikeInterfaceTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x18): undefined reference to `mlir::registerPassManagerTestPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x1c): undefined reference to `mlir::registerPrintSpirvAvailabilityPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x20): undefined reference to `mlir::registerRegionTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x24): undefined reference to `mlir::registerShapeFunctionTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x28): undefined reference to `mlir::registerSideEffectTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x2c): undefined reference to `mlir::registerSliceAnalysisTestPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x30): undefined reference to `mlir::registerSymbolTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x34): undefined reference to `mlir::registerTestAffineAccessAnalysisPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x38): undefined reference to `mlir::registerTestAffineDataCopyPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x3c): undefined reference to `mlir::registerTestAffineLoopUnswitchingPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x40): undefined reference to `mlir::registerTestAffineReifyValueBoundsPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x44): undefined reference to `mlir::registerTestAffineWalk()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x48): undefined reference to `mlir::registerTestBytecodeRoundtripPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x4c): undefined reference to `mlir::registerTestDecomposeAffineOpPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x50): undefined reference to `mlir::registerTestFunc()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x54): undefined reference to `mlir::registerTestGpuLoweringPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x58): undefined reference to `mlir::registerTestGpuMemoryPromotionPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x5c): undefined reference to `mlir::registerTestLoopPermutationPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x60): undefined reference to `mlir::registerTestMatchers()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x64): undefined reference to `mlir::registerTestOperationEqualPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x68): undefined reference to `mlir::registerTestPreserveUseListOrders()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x6c): undefined reference to `mlir::registerTestPrintDefUsePass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x70): undefined reference to `mlir::registerTestPrintInvalidPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x74): undefined reference to `mlir::registerTestPrintNestingPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x78): undefined reference to `mlir::registerTestReducer()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x7c): undefined reference to `mlir::registerTestSpirvEntryPointABIPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x80): undefined reference to `mlir::registerTestSpirvModuleCombinerPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x84): undefined reference to `mlir::registerTestTraitsPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x8c): undefined reference to `mlir::registerVectorizerTestPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x90): undefined reference to `mlir::test::registerCommutativityUtils()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x94): undefined reference to `mlir::test::registerConvertCallOpPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x98): undefined reference to `mlir::test::registerConvertFuncOpPass()'

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 12, 2024

LLVM Buildbot has detected a new failure on builder mlir-nvidia running on mlir-nvidia while building mlir at step 6 "build-check-mlir-build-only".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/138/builds/7670

Here is the relevant piece of the build log for the reference
Step 6 (build-check-mlir-build-only) failure: build (failure)
...
32.066 [57/4/4987] Linking CXX shared library lib/libMLIRGPUTransformOps.so.20.0git
32.072 [56/4/4988] Creating library symlink lib/libMLIRGPUTransformOps.so
32.251 [43/16/4989] Linking CXX shared library lib/libMLIRCAPIConversion.so.20.0git
32.268 [42/16/4990] Linking CXX shared library lib/libMLIRGPUTestPasses.so.20.0git
32.276 [41/16/4991] Linking CXX shared library lib/libMLIRTestPass.so.20.0git
32.277 [40/16/4992] Creating library symlink lib/libMLIRCAPIConversion.so
32.287 [40/15/4993] Creating library symlink lib/libMLIRTestPass.so
32.293 [39/15/4994] Linking CXX executable bin/mlir-rewrite
32.294 [39/14/4995] Creating library symlink lib/libMLIRGPUTestPasses.so
32.307 [38/14/4996] Linking CXX shared library lib/libMLIRMlirOptMain.so.20.0git
FAILED: lib/libMLIRMlirOptMain.so.20.0git 
: && /usr/bin/clang++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete -fuse-ld=lld -Wl,--color-diagnostics   -Wl,--gc-sections -shared -Wl,-soname,libMLIRMlirOptMain.so.20.0git -o lib/libMLIRMlirOptMain.so.20.0git tools/mlir/tools/mlir-opt/CMakeFiles/MLIRMlirOptMain.dir/mlir-opt.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/lib:"  lib/libMLIRAffineTransformOps.so.20.0git  lib/libMLIRAMDGPUTransforms.so.20.0git  lib/libMLIRArithValueBoundsOpInterfaceImpl.so.20.0git  lib/libMLIRArmNeonTransforms.so.20.0git  lib/libMLIRAsyncTransforms.so.20.0git  lib/libMLIRBufferizationPipelines.so.20.0git  lib/libMLIRBufferizationTransformOps.so.20.0git  lib/libMLIRControlFlowTransforms.so.20.0git  lib/libMLIRDLTITransformOps.so.20.0git  lib/libMLIRFuncTransformOps.so.20.0git  lib/libMLIRGPUTransformOps.so.20.0git  lib/libMLIRGPUPipelines.so.20.0git  lib/libMLIRMathTransforms.so.20.0git  lib/libMLIRMemRefTransformOps.so.20.0git  lib/libMLIRMLProgramTransforms.so.20.0git  lib/libMLIRNVGPUTransformOps.so.20.0git  lib/libMLIRNVGPUTransforms.so.20.0git  lib/libMLIROpenACCTransforms.so.20.0git  lib/libMLIRPolynomialDialect.so.20.0git  lib/libMLIRPtrDialect.so.20.0git  lib/libMLIRQuantTransforms.so.20.0git  lib/libMLIRSCFTransformOps.so.20.0git  lib/libMLIRShapeOpsTransforms.so.20.0git  lib/libMLIRSparseTensorPipelines.so.20.0git  lib/libMLIRSparseTensorTransformOps.so.20.0git  lib/libMLIRSparseTensorTransforms.so.20.0git  lib/libMLIRSparseTensorUtils.so.20.0git  lib/libMLIRSPIRVModuleCombiner.so.20.0git  lib/libMLIRTensorInferTypeOpInterfaceImpl.so.20.0git  lib/libMLIRTensorTransformOps.so.20.0git  lib/libMLIRTransformDebugExtension.so.20.0git  lib/libMLIRTransformDialectIRDLExtension.so.20.0git  lib/libMLIRTransformLoopExtension.so.20.0git  lib/libMLIRTransformPDLExtension.so.20.0git  lib/libMLIRTransformDialectTransforms.so.20.0git  lib/libMLIRVectorTransformOps.so.20.0git  lib/libMLIRXeGPUTransforms.so.20.0git  lib/libMLIRTestDynDialect.so.20.0git  lib/libMLIRTosaTestPasses.so.20.0git  lib/libMLIRArithToAMDGPU.so.20.0git  lib/libMLIRArithToArmSME.so.20.0git  lib/libMLIRArithToEmitC.so.20.0git  lib/libMLIRArmNeon2dToIntr.so.20.0git  lib/libMLIRArmSMEToSCF.so.20.0git  lib/libMLIRArmSMEToLLVM.so.20.0git  lib/libMLIRBufferizationToMemRef.so.20.0git  lib/libMLIRComplexToLibm.so.20.0git  lib/libMLIRComplexToLLVM.so.20.0git  lib/libMLIRComplexToSPIRV.so.20.0git  lib/libMLIRComplexToStandard.so.20.0git  lib/libMLIRControlFlowToSCF.so.20.0git  lib/libMLIRControlFlowToSPIRV.so.20.0git  lib/libMLIRConvertToSPIRVPass.so.20.0git  lib/libMLIRFuncToEmitC.so.20.0git  lib/libMLIRGPUToLLVMSPV.so.20.0git  lib/libMLIRGPUToNVVMTransforms.so.20.0git  lib/libMLIRGPUToROCDLTransforms.so.20.0git  lib/libMLIRGPUToSPIRV.so.20.0git  lib/libMLIRGPUToVulkanTransforms.so.20.0git  lib/libMLIRIndexToLLVM.so.20.0git  lib/libMLIRLinalgToStandard.so.20.0git  lib/libMLIRMathToFuncs.so.20.0git  lib/libMLIRMathToLibm.so.20.0git  lib/libMLIRMathToLLVM.so.20.0git  lib/libMLIRMathToROCDL.so.20.0git  lib/libMLIRMathToSPIRV.so.20.0git  lib/libMLIRMemRefToEmitC.so.20.0git  lib/libMLIRMeshToMPI.so.20.0git  lib/libMLIRNVGPUToNVVM.so.20.0git  lib/libMLIRNVVMToLLVM.so.20.0git  lib/libMLIROpenACCToSCF.so.20.0git  lib/libMLIROpenMPToLLVM.so.20.0git  lib/libMLIRReconcileUnrealizedCasts.so.20.0git  lib/libMLIRSCFToControlFlow.so.20.0git  lib/libMLIRSCFToEmitC.so.20.0git  lib/libMLIRSCFToGPU.so.20.0git  lib/libMLIRSCFToOpenMP.so.20.0git  lib/libMLIRSCFToSPIRV.so.20.0git  lib/libMLIRShapeToStandard.so.20.0git  lib/libMLIRSPIRVToLLVM.so.20.0git  lib/libMLIRTensorToLinalg.so.20.0git  lib/libMLIRTensorToSPIRV.so.20.0git  lib/libMLIRTosaToArith.so.20.0git  lib/libMLIRTosaToLinalg.so.20.0git  lib/libMLIRTosaToMLProgram.so.20.0git  lib/libMLIRTosaToSCF.so.20.0git  lib/libMLIRTosaToTensor.so.20.0git  lib/libMLIRUBToLLVM.so.20.0git  lib/libMLIRUBToSPIRV.so.20.0git  lib/libMLIRVectorToArmSME.so.20.0git  lib/libMLIRVectorToGPU.so.20.0git  lib/libMLIRVectorToLLVMPass.so.20.0git  lib/libMLIRVectorToSPIRV.so.20.0git  lib/libMLIRVectorToXeGPU.so.20.0git  lib/libMLIRFuncAllExtensions.so.20.0git  lib/libMLIRTensorAllExtensions.so.20.0git  lib/libMLIROptLib.so.20.0git  lib/libMLIRToLLVMIRTranslationRegistration.so.20.0git  lib/libMLIRAMXTransforms.so.20.0git  lib/libMLIRArmSVETransforms.so.20.0git  lib/libMLIRLinalgTransformOps.so.20.0git  lib/libMLIRTransformDialect.so.20.0git  lib/libMLIRTransformDialectInterfaces.so.20.0git  lib/libMLIRTransformDialectUtils.so.20.0git  lib/libMLIRX86VectorTransforms.so.20.0git  lib/libMLIREmitCTransforms.so.20.0git  lib/libMLIRArmSMETransforms.so.20.0git  lib/libMLIRSPIRVTransforms.so.20.0git  lib/libMLIRIndexToSPIRV.so.20.0git  lib/libMLIRMemRefToSPIRV.so.20.0git  lib/libMLIRAMDGPUToROCDL.so.20.0git  lib/libMLIRAMDGPUUtils.so.20.0git  lib/libMLIRAMDGPUDialect.so.20.0git  lib/libMLIRGPUToGPURuntimeTransforms.so.20.0git  lib/libMLIRAsyncToLLVM.so.20.0git  lib/libMLIRConvertToLLVMPass.so.20.0git  lib/libMLIRConvertToLLVMInterface.so.20.0git  lib/libMLIRVectorToLLVM.so.20.0git  lib/libMLIRMPIDialect.so.20.0git  lib/libMLIREmitCDialect.so.20.0git  lib/libMLIRGPUTransforms.so.20.0git  lib/libMLIRAsyncDialect.so.20.0git  lib/libMLIRSPIRVTarget.so.20.0git  lib/libMLIRSPIRVSerialization.so.20.0git  lib/libMLIRSPIRVBinaryUtils.so.20.0git  lib/libMLIRNVVMTarget.so.20.0git  lib/libLLVMNVPTXCodeGen.so.20.0git  lib/libLLVMNVPTXDesc.so.20.0git  lib/libLLVMNVPTXInfo.so.20.0git  lib/libMLIRROCDLTarget.so.20.0git  lib/libMLIRTargetLLVM.so.20.0git  lib/libMLIRExecutionEngineUtils.so.20.0git  lib/libLLVMPasses.so.20.0git  lib/libLLVMTarget.so.20.0git  lib/libLLVMipo.so.20.0git  lib/libLLVMLinker.so.20.0git  lib/libMLIRAffineToStandard.so.20.0git  lib/libMLIRShapeDialect.so.20.0git  lib/libMLIRSPIRVUtils.so.20.0git  lib/libMLIRFuncToLLVM.so.20.0git  lib/libMLIRArithToLLVM.so.20.0git  lib/libMLIRArithAttrToLLVMConversion.so.20.0git  lib/libMLIRControlFlowToLLVM.so.20.0git  lib/libMLIRMemRefToLLVM.so.20.0git  lib/libMLIRSPIRVAttrToLLVMConversion.so.20.0git  lib/libMLIRLinalgTransforms.so.20.0git  lib/libMLIRMemRefTransforms.so.20.0git  lib/libMLIRArithTransforms.so.20.0git  lib/libMLIRFuncTransforms.so.20.0git  lib/libMLIRMeshTransforms.so.20.0git  lib/libMLIRTosaShardingInterfaceImpl.so.20.0git  lib/libMLIRSCFTransforms.so.20.0git  lib/libMLIRBufferizationTransforms.so.20.0git  lib/libMLIRTensorTransforms.so.20.0git  lib/libMLIRAffineTransforms.so.20.0git  lib/libMLIRSCFUtils.so.20.0git  lib/libMLIRTensorTilingInterfaceImpl.so.20.0git  lib/libMLIRTilingInterface.so.20.0git  lib/libMLIRVectorToSCF.so.20.0git  lib/libMLIRArithToSPIRV.so.20.0git  lib/libMLIRFuncToSPIRV.so.20.0git  lib/libMLIRSPIRVConversion.so.20.0git  lib/libMLIRIndexDialect.so.20.0git  lib/libMLIRLinalgUtils.so.20.0git  lib/libMLIRMLProgramDialect.so.20.0git  lib/libMLIRTensorUtils.so.20.0git  lib/libMLIRTosaTransforms.so.20.0git  lib/libMLIRTosaDialect.so.20.0git  lib/libMLIRQuantUtils.so.20.0git  lib/libMLIRQuantDialect.so.20.0git  lib/libMLIRLLVMCommonConversion.so.20.0git  lib/libMLIRNVGPUUtils.so.20.0git  lib/libMLIRNVGPUDialect.so.20.0git  lib/libMLIRVectorTransforms.so.20.0git  lib/libMLIRAffineUtils.so.20.0git  lib/libMLIRLinalgDialect.so.20.0git  lib/libMLIRBufferizationDialect.so.20.0git  lib/libMLIRMathDialect.so.20.0git  lib/libMLIRSparseTensorDialect.so.20.0git  lib/libMLIRMemRefUtils.so.20.0git  lib/libMLIRVectorUtils.so.20.0git  lib/libMLIRAffineAnalysis.so.20.0git  lib/libMLIRXeGPUDialect.so.20.0git  lib/libMLIRFuncInlinerExtension.so.20.0git  lib/libMLIRFuncMeshShardingExtensions.so.20.0git  lib/libMLIRTensorMeshShardingExtensions.so.20.0git  lib/libMLIRShardingInterface.so.20.0git  lib/libMLIRMeshDialect.so.20.0git  lib/libMLIRIRDL.so.20.0git  lib/libMLIRBytecodeWriter.so.20.0git  lib/libMLIRBytecodeOpInterface.so.20.0git  lib/libMLIRDebug.so.20.0git  lib/libMLIRObservers.so.20.0git  lib/libMLIRPluginsLib.so.20.0git  lib/libMLIRNVVMToLLVMIRTranslation.so.20.0git  lib/libMLIRROCDLToLLVMIRTranslation.so.20.0git  lib/libMLIRROCDLDialect.so.20.0git  lib/libMLIRArmNeonToLLVMIRTranslation.so.20.0git  lib/libMLIRArmNeonDialect.so.20.0git  lib/libMLIRArmSMEToLLVMIRTranslation.so.20.0git  lib/libMLIRArmSMEDialect.so.20.0git  lib/libMLIRSCFDialect.so.20.0git  lib/libMLIRControlFlowDialect.so.20.0git  lib/libMLIRArmSVEToLLVMIRTranslation.so.20.0git  lib/libMLIRArmSVEDialect.so.20.0git  lib/libMLIRVectorDialect.so.20.0git  lib/libMLIRTensorDialect.so.20.0git  lib/libMLIRAffineDialect.so.20.0git  lib/libMLIRParallelCombiningOpInterface.so.20.0git  lib/libMLIRVectorInterfaces.so.20.0git  lib/libMLIRMaskableOpInterface.so.20.0git  lib/libMLIRMaskingOpInterface.so.20.0git  lib/libMLIRAMXToLLVMIRTranslation.so.20.0git  lib/libMLIRAMXDialect.so.20.0git  lib/libMLIRBuiltinToLLVMIRTranslation.so.20.0git  lib/libMLIRGPUToLLVMIRTranslation.so.20.0git  lib/libMLIRGPUDialect.so.20.0git  lib/libMLIRX86VectorToLLVMIRTranslation.so.20.0git  lib/libMLIRX86VectorDialect.so.20.0git  lib/libMLIRLLVMToLLVMIRTranslation.so.20.0git  lib/libMLIROpenACCToLLVMIRTranslation.so.20.0git  lib/libMLIROpenACCDialect.so.20.0git  lib/libMLIRMemRefDialect.so.20.0git  lib/libMLIRArithUtils.so.20.0git  lib/libMLIRComplexDialect.so.20.0git  lib/libMLIRArithDialect.so.20.0git  lib/libMLIRCastInterfaces.so.20.0git  lib/libMLIRInferIntRangeCommon.so.20.0git  lib/libMLIRDialect.so.20.0git  lib/libMLIRDialectUtils.so.20.0git  lib/libMLIRShapedOpInterfaces.so.20.0git  lib/libMLIROpenMPToLLVMIRTranslation.so.20.0git  lib/libMLIROpenMPDialect.so.20.0git  lib/libMLIROpenACCMPCommon.so.20.0git  lib/libMLIRSPIRVToLLVMIRTranslation.so.20.0git  lib/libMLIRSPIRVDialect.so.20.0git  lib/libMLIRUBDialect.so.20.0git  lib/libMLIRVCIXToLLVMIRTranslation.so.20.0git  lib/libMLIRVCIXDialect.so.20.0git  lib/libMLIRTargetLLVMIRExport.so.20.0git  lib/libMLIRDLTIDialect.so.20.0git  lib/libMLIRLLVMIRTransforms.so.20.0git  lib/libMLIRFuncDialect.so.20.0git  lib/libMLIRNVVMDialect.so.20.0git  lib/libMLIRTransforms.so.20.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.20.0git  lib/libMLIRLLVMDialect.so.20.0git  lib/libMLIRMemorySlotInterfaces.so.20.0git  lib/libLLVMBitWriter.so.20.0git  lib/libMLIRTransformUtils.so.20.0git  lib/libMLIRSubsetOpInterface.so.20.0git  lib/libMLIRValueBoundsOpInterface.so.20.0git  lib/libMLIRDestinationStyleOpInterface.so.20.0git  lib/libMLIRRewrite.so.20.0git  lib/libMLIRRewritePDL.so.20.0git  lib/libMLIRPDLToPDLInterp.so.20.0git  lib/libMLIRPDLInterpDialect.so.20.0git  lib/libMLIRPDLDialect.so.20.0git  lib/libMLIRPass.so.20.0git  lib/libMLIRAnalysis.so.20.0git  lib/libMLIRCallInterfaces.so.20.0git  lib/libMLIRControlFlowInterfaces.so.20.0git  lib/libMLIRPresburger.so.20.0git  lib/libMLIRLoopLikeInterface.so.20.0git  lib/libMLIRViewLikeInterface.so.20.0git  lib/libMLIRInferIntRangeInterface.so.20.0git  lib/libMLIRFunctionInterfaces.so.20.0git  lib/libMLIRDataLayoutInterfaces.so.20.0git  lib/libMLIRInferTypeOpInterface.so.20.0git  lib/libMLIRSideEffectInterfaces.so.20.0git  lib/libMLIRTranslateLib.so.20.0git  lib/libMLIRParser.so.20.0git  lib/libMLIRBytecodeReader.so.20.0git  lib/libMLIRAsmParser.so.20.0git  lib/libMLIRIR.so.20.0git  lib/libMLIRSupport.so.20.0git  lib/libLLVMFrontendOpenMP.so.20.0git  lib/libLLVMFrontendOffloading.so.20.0git  lib/libLLVMTransformUtils.so.20.0git  lib/libLLVMMCParser.so.20.0git  lib/libLLVMMC.so.20.0git  lib/libLLVMIRReader.so.20.0git  lib/libLLVMAsmParser.so.20.0git  lib/libLLVMBitReader.so.20.0git  lib/libLLVMCore.so.20.0git  lib/libLLVMBinaryFormat.so.20.0git  lib/libLLVMTargetParser.so.20.0git  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/lib && :
ld.lld: error: undefined symbol: mlir::registerCloneTestPasses()
>>> referenced by mlir-opt.cpp
>>>               tools/mlir/tools/mlir-opt/CMakeFiles/MLIRMlirOptMain.dir/mlir-opt.cpp.o:(registerTestPasses())

ld.lld: error: undefined symbol: mlir::registerConvertToTargetEnvPass()
>>> referenced by mlir-opt.cpp
>>>               tools/mlir/tools/mlir-opt/CMakeFiles/MLIRMlirOptMain.dir/mlir-opt.cpp.o:(registerTestPasses())

ld.lld: error: undefined symbol: mlir::registerLazyLoadingTestPasses()
>>> referenced by mlir-opt.cpp
>>>               tools/mlir/tools/mlir-opt/CMakeFiles/MLIRMlirOptMain.dir/mlir-opt.cpp.o:(registerTestPasses())

ld.lld: error: undefined symbol: mlir::registerLoopLikeInterfaceTestPasses()
>>> referenced by mlir-opt.cpp
>>>               tools/mlir/tools/mlir-opt/CMakeFiles/MLIRMlirOptMain.dir/mlir-opt.cpp.o:(registerTestPasses())

ld.lld: error: undefined symbol: mlir::registerPassManagerTestPass()
>>> referenced by mlir-opt.cpp
>>>               tools/mlir/tools/mlir-opt/CMakeFiles/MLIRMlirOptMain.dir/mlir-opt.cpp.o:(registerTestPasses())

ld.lld: error: undefined symbol: mlir::registerPrintSpirvAvailabilityPass()
>>> referenced by mlir-opt.cpp
>>>               tools/mlir/tools/mlir-opt/CMakeFiles/MLIRMlirOptMain.dir/mlir-opt.cpp.o:(registerTestPasses())

ld.lld: error: undefined symbol: mlir::registerRegionTestPasses()
>>> referenced by mlir-opt.cpp
>>>               tools/mlir/tools/mlir-opt/CMakeFiles/MLIRMlirOptMain.dir/mlir-opt.cpp.o:(registerTestPasses())

ld.lld: error: undefined symbol: mlir::registerShapeFunctionTestPasses()
>>> referenced by mlir-opt.cpp
>>>               tools/mlir/tools/mlir-opt/CMakeFiles/MLIRMlirOptMain.dir/mlir-opt.cpp.o:(registerTestPasses())

ld.lld: error: undefined symbol: mlir::registerSideEffectTestPasses()
>>> referenced by mlir-opt.cpp
>>>               tools/mlir/tools/mlir-opt/CMakeFiles/MLIRMlirOptMain.dir/mlir-opt.cpp.o:(registerTestPasses())

ld.lld: error: undefined symbol: mlir::registerSliceAnalysisTestPass()

@nikic
Copy link
Contributor Author

nikic commented Dec 12, 2024

e582865 should fix the buildbot failures.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 12, 2024

LLVM Buildbot has detected a new failure on builder flang-aarch64-latest-gcc running on linaro-flang-aarch64-latest-gcc while building mlir at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/130/builds/7465

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
355.360 [2204/7/5100] Copying clang's mm3dnow.h...
355.867 [2204/6/5101] Linking CXX shared library lib/libMLIRTestDialect.so.20.0git
355.892 [2200/9/5102] Creating library symlink lib/libMLIRTestDialect.so
355.904 [2196/12/5103] Copying clang's movrs_avx10_2intrin.h...
355.904 [2196/11/5104] Copying clang's movrsintrin.h...
355.904 [2196/10/5105] Copying clang's mwaitxintrin.h...
355.963 [2196/9/5106] Linking CXX executable bin/mlir-rewrite
356.052 [2196/8/5107] Linking CXX executable bin/mlir-cpu-runner
356.067 [2185/18/5108] Linking CXX shared library lib/libMLIRCAPIRegisterEverything.so.20.0git
356.136 [2185/17/5109] Linking CXX shared library lib/libMLIRMlirOptMain.so.20.0git
FAILED: lib/libMLIRMlirOptMain.so.20.0git 
: && /usr/local/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Wno-unused-but-set-parameter -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRMlirOptMain.so.20.0git -o lib/libMLIRMlirOptMain.so.20.0git tools/mlir/tools/mlir-opt/CMakeFiles/MLIRMlirOptMain.dir/mlir-opt.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/lib:"  lib/libMLIRAffineTransformOps.so.20.0git  lib/libMLIRAMDGPUTransforms.so.20.0git  lib/libMLIRArithValueBoundsOpInterfaceImpl.so.20.0git  lib/libMLIRArmNeonTransforms.so.20.0git  lib/libMLIRAsyncTransforms.so.20.0git  lib/libMLIRBufferizationPipelines.so.20.0git  lib/libMLIRBufferizationTransformOps.so.20.0git  lib/libMLIRControlFlowTransforms.so.20.0git  lib/libMLIRDLTITransformOps.so.20.0git  lib/libMLIRFuncTransformOps.so.20.0git  lib/libMLIRGPUTransformOps.so.20.0git  lib/libMLIRGPUPipelines.so.20.0git  lib/libMLIRMathTransforms.so.20.0git  lib/libMLIRMemRefTransformOps.so.20.0git  lib/libMLIRMLProgramTransforms.so.20.0git  lib/libMLIRNVGPUTransformOps.so.20.0git  lib/libMLIRNVGPUTransforms.so.20.0git  lib/libMLIROpenACCTransforms.so.20.0git  lib/libMLIRPolynomialDialect.so.20.0git  lib/libMLIRPtrDialect.so.20.0git  lib/libMLIRQuantTransforms.so.20.0git  lib/libMLIRSCFTransformOps.so.20.0git  lib/libMLIRShapeOpsTransforms.so.20.0git  lib/libMLIRSparseTensorPipelines.so.20.0git  lib/libMLIRSparseTensorTransformOps.so.20.0git  lib/libMLIRSparseTensorTransforms.so.20.0git  lib/libMLIRSparseTensorUtils.so.20.0git  lib/libMLIRSPIRVModuleCombiner.so.20.0git  lib/libMLIRTensorInferTypeOpInterfaceImpl.so.20.0git  lib/libMLIRTensorTransformOps.so.20.0git  lib/libMLIRTransformDebugExtension.so.20.0git  lib/libMLIRTransformDialectIRDLExtension.so.20.0git  lib/libMLIRTransformLoopExtension.so.20.0git  lib/libMLIRTransformPDLExtension.so.20.0git  lib/libMLIRTransformDialectTransforms.so.20.0git  lib/libMLIRVectorTransformOps.so.20.0git  lib/libMLIRXeGPUTransforms.so.20.0git  lib/libMLIRTestDynDialect.so.20.0git  lib/libMLIRTosaTestPasses.so.20.0git  lib/libMLIRArithToAMDGPU.so.20.0git  lib/libMLIRArithToArmSME.so.20.0git  lib/libMLIRArithToEmitC.so.20.0git  lib/libMLIRArmNeon2dToIntr.so.20.0git  lib/libMLIRArmSMEToSCF.so.20.0git  lib/libMLIRArmSMEToLLVM.so.20.0git  lib/libMLIRBufferizationToMemRef.so.20.0git  lib/libMLIRComplexToLibm.so.20.0git  lib/libMLIRComplexToLLVM.so.20.0git  lib/libMLIRComplexToSPIRV.so.20.0git  lib/libMLIRComplexToStandard.so.20.0git  lib/libMLIRControlFlowToSCF.so.20.0git  lib/libMLIRControlFlowToSPIRV.so.20.0git  lib/libMLIRConvertToSPIRVPass.so.20.0git  lib/libMLIRFuncToEmitC.so.20.0git  lib/libMLIRGPUToLLVMSPV.so.20.0git  lib/libMLIRGPUToNVVMTransforms.so.20.0git  lib/libMLIRGPUToROCDLTransforms.so.20.0git  lib/libMLIRGPUToSPIRV.so.20.0git  lib/libMLIRGPUToVulkanTransforms.so.20.0git  lib/libMLIRIndexToLLVM.so.20.0git  lib/libMLIRLinalgToStandard.so.20.0git  lib/libMLIRMathToFuncs.so.20.0git  lib/libMLIRMathToLibm.so.20.0git  lib/libMLIRMathToLLVM.so.20.0git  lib/libMLIRMathToROCDL.so.20.0git  lib/libMLIRMathToSPIRV.so.20.0git  lib/libMLIRMemRefToEmitC.so.20.0git  lib/libMLIRMeshToMPI.so.20.0git  lib/libMLIRNVGPUToNVVM.so.20.0git  lib/libMLIRNVVMToLLVM.so.20.0git  lib/libMLIROpenACCToSCF.so.20.0git  lib/libMLIROpenMPToLLVM.so.20.0git  lib/libMLIRReconcileUnrealizedCasts.so.20.0git  lib/libMLIRSCFToControlFlow.so.20.0git  lib/libMLIRSCFToEmitC.so.20.0git  lib/libMLIRSCFToGPU.so.20.0git  lib/libMLIRSCFToOpenMP.so.20.0git  lib/libMLIRSCFToSPIRV.so.20.0git  lib/libMLIRShapeToStandard.so.20.0git  lib/libMLIRSPIRVToLLVM.so.20.0git  lib/libMLIRTensorToLinalg.so.20.0git  lib/libMLIRTensorToSPIRV.so.20.0git  lib/libMLIRTosaToArith.so.20.0git  lib/libMLIRTosaToLinalg.so.20.0git  lib/libMLIRTosaToMLProgram.so.20.0git  lib/libMLIRTosaToSCF.so.20.0git  lib/libMLIRTosaToTensor.so.20.0git  lib/libMLIRUBToLLVM.so.20.0git  lib/libMLIRUBToSPIRV.so.20.0git  lib/libMLIRVectorToArmSME.so.20.0git  lib/libMLIRVectorToGPU.so.20.0git  lib/libMLIRVectorToLLVMPass.so.20.0git  lib/libMLIRVectorToSPIRV.so.20.0git  lib/libMLIRVectorToXeGPU.so.20.0git  lib/libMLIRFuncAllExtensions.so.20.0git  lib/libMLIRTensorAllExtensions.so.20.0git  lib/libMLIROptLib.so.20.0git  lib/libMLIRToLLVMIRTranslationRegistration.so.20.0git  lib/libMLIRAMXTransforms.so.20.0git  lib/libMLIRArmSVETransforms.so.20.0git  lib/libMLIRLinalgTransformOps.so.20.0git  lib/libMLIRTransformDialect.so.20.0git  lib/libMLIRTransformDialectInterfaces.so.20.0git  lib/libMLIRTransformDialectUtils.so.20.0git  lib/libMLIRX86VectorTransforms.so.20.0git  lib/libMLIREmitCTransforms.so.20.0git  lib/libMLIRArmSMETransforms.so.20.0git  lib/libMLIRSPIRVTransforms.so.20.0git  lib/libMLIRIndexToSPIRV.so.20.0git  lib/libMLIRMemRefToSPIRV.so.20.0git  lib/libMLIRAMDGPUToROCDL.so.20.0git  lib/libMLIRAMDGPUUtils.so.20.0git  lib/libMLIRAMDGPUDialect.so.20.0git  lib/libMLIRGPUToGPURuntimeTransforms.so.20.0git  lib/libMLIRAsyncToLLVM.so.20.0git  lib/libMLIRConvertToLLVMPass.so.20.0git  lib/libMLIRConvertToLLVMInterface.so.20.0git  lib/libMLIRVectorToLLVM.so.20.0git  lib/libMLIRMPIDialect.so.20.0git  lib/libMLIREmitCDialect.so.20.0git  lib/libMLIRGPUTransforms.so.20.0git  lib/libMLIRAsyncDialect.so.20.0git  lib/libMLIRSPIRVTarget.so.20.0git  lib/libMLIRSPIRVSerialization.so.20.0git  lib/libMLIRSPIRVBinaryUtils.so.20.0git  lib/libMLIRNVVMTarget.so.20.0git  lib/libMLIRROCDLTarget.so.20.0git  lib/libMLIRTargetLLVM.so.20.0git  lib/libMLIRExecutionEngineUtils.so.20.0git  lib/libLLVMPasses.so.20.0git  lib/libLLVMTarget.so.20.0git  lib/libLLVMipo.so.20.0git  lib/libLLVMLinker.so.20.0git  lib/libMLIRAffineToStandard.so.20.0git  lib/libMLIRShapeDialect.so.20.0git  lib/libMLIRSPIRVUtils.so.20.0git  lib/libMLIRFuncToLLVM.so.20.0git  lib/libMLIRArithToLLVM.so.20.0git  lib/libMLIRArithAttrToLLVMConversion.so.20.0git  lib/libMLIRControlFlowToLLVM.so.20.0git  lib/libMLIRMemRefToLLVM.so.20.0git  lib/libMLIRSPIRVAttrToLLVMConversion.so.20.0git  lib/libMLIRLinalgTransforms.so.20.0git  lib/libMLIRMemRefTransforms.so.20.0git  lib/libMLIRArithTransforms.so.20.0git  lib/libMLIRFuncTransforms.so.20.0git  lib/libMLIRMeshTransforms.so.20.0git  lib/libMLIRTosaShardingInterfaceImpl.so.20.0git  lib/libMLIRSCFTransforms.so.20.0git  lib/libMLIRBufferizationTransforms.so.20.0git  lib/libMLIRTensorTransforms.so.20.0git  lib/libMLIRAffineTransforms.so.20.0git  lib/libMLIRSCFUtils.so.20.0git  lib/libMLIRTensorTilingInterfaceImpl.so.20.0git  lib/libMLIRTilingInterface.so.20.0git  lib/libMLIRVectorToSCF.so.20.0git  lib/libMLIRArithToSPIRV.so.20.0git  lib/libMLIRFuncToSPIRV.so.20.0git  lib/libMLIRSPIRVConversion.so.20.0git  lib/libMLIRIndexDialect.so.20.0git  lib/libMLIRLinalgUtils.so.20.0git  lib/libMLIRMLProgramDialect.so.20.0git  lib/libMLIRTensorUtils.so.20.0git  lib/libMLIRTosaTransforms.so.20.0git  lib/libMLIRTosaDialect.so.20.0git  lib/libMLIRQuantUtils.so.20.0git  lib/libMLIRQuantDialect.so.20.0git  lib/libMLIRLLVMCommonConversion.so.20.0git  lib/libMLIRNVGPUUtils.so.20.0git  lib/libMLIRNVGPUDialect.so.20.0git  lib/libMLIRVectorTransforms.so.20.0git  lib/libMLIRAffineUtils.so.20.0git  lib/libMLIRLinalgDialect.so.20.0git  lib/libMLIRBufferizationDialect.so.20.0git  lib/libMLIRMathDialect.so.20.0git  lib/libMLIRSparseTensorDialect.so.20.0git  lib/libMLIRMemRefUtils.so.20.0git  lib/libMLIRVectorUtils.so.20.0git  lib/libMLIRAffineAnalysis.so.20.0git  lib/libMLIRXeGPUDialect.so.20.0git  lib/libMLIRFuncInlinerExtension.so.20.0git  lib/libMLIRFuncMeshShardingExtensions.so.20.0git  lib/libMLIRTensorMeshShardingExtensions.so.20.0git  lib/libMLIRShardingInterface.so.20.0git  lib/libMLIRMeshDialect.so.20.0git  lib/libMLIRIRDL.so.20.0git  lib/libMLIRBytecodeWriter.so.20.0git  lib/libMLIRBytecodeOpInterface.so.20.0git  lib/libMLIRDebug.so.20.0git  lib/libMLIRObservers.so.20.0git  lib/libMLIRPluginsLib.so.20.0git  lib/libMLIRNVVMToLLVMIRTranslation.so.20.0git  lib/libMLIRROCDLToLLVMIRTranslation.so.20.0git  lib/libMLIRROCDLDialect.so.20.0git  lib/libMLIRArmNeonToLLVMIRTranslation.so.20.0git  lib/libMLIRArmNeonDialect.so.20.0git  lib/libMLIRArmSMEToLLVMIRTranslation.so.20.0git  lib/libMLIRArmSMEDialect.so.20.0git  lib/libMLIRSCFDialect.so.20.0git  lib/libMLIRControlFlowDialect.so.20.0git  lib/libMLIRArmSVEToLLVMIRTranslation.so.20.0git  lib/libMLIRArmSVEDialect.so.20.0git  lib/libMLIRVectorDialect.so.20.0git  lib/libMLIRTensorDialect.so.20.0git  lib/libMLIRAffineDialect.so.20.0git  lib/libMLIRParallelCombiningOpInterface.so.20.0git  lib/libMLIRVectorInterfaces.so.20.0git  lib/libMLIRMaskableOpInterface.so.20.0git  lib/libMLIRMaskingOpInterface.so.20.0git  lib/libMLIRAMXToLLVMIRTranslation.so.20.0git  lib/libMLIRAMXDialect.so.20.0git  lib/libMLIRBuiltinToLLVMIRTranslation.so.20.0git  lib/libMLIRGPUToLLVMIRTranslation.so.20.0git  lib/libMLIRGPUDialect.so.20.0git  lib/libMLIRX86VectorToLLVMIRTranslation.so.20.0git  lib/libMLIRX86VectorDialect.so.20.0git  lib/libMLIRLLVMToLLVMIRTranslation.so.20.0git  lib/libMLIROpenACCToLLVMIRTranslation.so.20.0git  lib/libMLIROpenACCDialect.so.20.0git  lib/libMLIRMemRefDialect.so.20.0git  lib/libMLIRArithUtils.so.20.0git  lib/libMLIRComplexDialect.so.20.0git  lib/libMLIRArithDialect.so.20.0git  lib/libMLIRCastInterfaces.so.20.0git  lib/libMLIRInferIntRangeCommon.so.20.0git  lib/libMLIRDialect.so.20.0git  lib/libMLIRDialectUtils.so.20.0git  lib/libMLIRShapedOpInterfaces.so.20.0git  lib/libMLIROpenMPToLLVMIRTranslation.so.20.0git  lib/libMLIROpenMPDialect.so.20.0git  lib/libMLIROpenACCMPCommon.so.20.0git  lib/libMLIRSPIRVToLLVMIRTranslation.so.20.0git  lib/libMLIRSPIRVDialect.so.20.0git  lib/libMLIRUBDialect.so.20.0git  lib/libMLIRVCIXToLLVMIRTranslation.so.20.0git  lib/libMLIRVCIXDialect.so.20.0git  lib/libMLIRTargetLLVMIRExport.so.20.0git  lib/libMLIRDLTIDialect.so.20.0git  lib/libMLIRLLVMIRTransforms.so.20.0git  lib/libMLIRFuncDialect.so.20.0git  lib/libMLIRNVVMDialect.so.20.0git  lib/libMLIRTransforms.so.20.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.20.0git  lib/libMLIRLLVMDialect.so.20.0git  lib/libMLIRMemorySlotInterfaces.so.20.0git  lib/libLLVMBitWriter.so.20.0git  lib/libMLIRTransformUtils.so.20.0git  lib/libMLIRSubsetOpInterface.so.20.0git  lib/libMLIRValueBoundsOpInterface.so.20.0git  lib/libMLIRDestinationStyleOpInterface.so.20.0git  lib/libMLIRRewrite.so.20.0git  lib/libMLIRRewritePDL.so.20.0git  lib/libMLIRPDLToPDLInterp.so.20.0git  lib/libMLIRPDLInterpDialect.so.20.0git  lib/libMLIRPDLDialect.so.20.0git  lib/libMLIRPass.so.20.0git  lib/libMLIRAnalysis.so.20.0git  lib/libMLIRCallInterfaces.so.20.0git  lib/libMLIRControlFlowInterfaces.so.20.0git  lib/libMLIRPresburger.so.20.0git  lib/libMLIRLoopLikeInterface.so.20.0git  lib/libMLIRViewLikeInterface.so.20.0git  lib/libMLIRInferIntRangeInterface.so.20.0git  lib/libMLIRFunctionInterfaces.so.20.0git  lib/libMLIRDataLayoutInterfaces.so.20.0git  lib/libMLIRInferTypeOpInterface.so.20.0git  lib/libMLIRSideEffectInterfaces.so.20.0git  lib/libMLIRTranslateLib.so.20.0git  lib/libMLIRParser.so.20.0git  lib/libMLIRBytecodeReader.so.20.0git  lib/libMLIRAsmParser.so.20.0git  lib/libMLIRIR.so.20.0git  lib/libMLIRSupport.so.20.0git  lib/libLLVMFrontendOpenMP.so.20.0git  lib/libLLVMFrontendOffloading.so.20.0git  lib/libLLVMTransformUtils.so.20.0git  lib/libLLVMMCParser.so.20.0git  lib/libLLVMMC.so.20.0git  lib/libLLVMIRReader.so.20.0git  lib/libLLVMAsmParser.so.20.0git  lib/libLLVMBitReader.so.20.0git  lib/libLLVMCore.so.20.0git  lib/libLLVMBinaryFormat.so.20.0git  lib/libLLVMTargetParser.so.20.0git  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/lib && :
/usr/bin/ld: tools/mlir/tools/mlir-opt/CMakeFiles/MLIRMlirOptMain.dir/mlir-opt.cpp.o: in function `registerTestPasses() [clone .localalias]':
mlir-opt.cpp:(.text._Z18registerTestPassesv+0x8): undefined reference to `mlir::registerCloneTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0xc): undefined reference to `mlir::registerConvertToTargetEnvPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x10): undefined reference to `mlir::registerLazyLoadingTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x14): undefined reference to `mlir::registerLoopLikeInterfaceTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x18): undefined reference to `mlir::registerPassManagerTestPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x1c): undefined reference to `mlir::registerPrintSpirvAvailabilityPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x20): undefined reference to `mlir::registerRegionTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x24): undefined reference to `mlir::registerShapeFunctionTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x28): undefined reference to `mlir::registerSideEffectTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x2c): undefined reference to `mlir::registerSliceAnalysisTestPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x30): undefined reference to `mlir::registerSymbolTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x34): undefined reference to `mlir::registerTestAffineAccessAnalysisPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x38): undefined reference to `mlir::registerTestAffineDataCopyPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x3c): undefined reference to `mlir::registerTestAffineLoopUnswitchingPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x40): undefined reference to `mlir::registerTestAffineReifyValueBoundsPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x44): undefined reference to `mlir::registerTestAffineWalk()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x48): undefined reference to `mlir::registerTestBytecodeRoundtripPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x4c): undefined reference to `mlir::registerTestDecomposeAffineOpPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x50): undefined reference to `mlir::registerTestFunc()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x54): undefined reference to `mlir::registerTestGpuLoweringPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x58): undefined reference to `mlir::registerTestGpuMemoryPromotionPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x5c): undefined reference to `mlir::registerTestLoopPermutationPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x60): undefined reference to `mlir::registerTestMatchers()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x64): undefined reference to `mlir::registerTestOperationEqualPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x68): undefined reference to `mlir::registerTestPreserveUseListOrders()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x6c): undefined reference to `mlir::registerTestPrintDefUsePass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x70): undefined reference to `mlir::registerTestPrintInvalidPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x74): undefined reference to `mlir::registerTestPrintNestingPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x78): undefined reference to `mlir::registerTestReducer()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x7c): undefined reference to `mlir::registerTestSpirvEntryPointABIPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x80): undefined reference to `mlir::registerTestSpirvModuleCombinerPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x84): undefined reference to `mlir::registerTestTraitsPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x8c): undefined reference to `mlir::registerVectorizerTestPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x90): undefined reference to `mlir::test::registerCommutativityUtils()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x94): undefined reference to `mlir::test::registerConvertCallOpPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x98): undefined reference to `mlir::test::registerConvertFuncOpPass()'

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 12, 2024

LLVM Buildbot has detected a new failure on builder flang-aarch64-sharedlibs running on linaro-flang-aarch64-sharedlibs while building mlir at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/80/builds/7581

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
281.016 [2475/15/5017] Building CXX object tools/mlir/examples/toy/Ch7/CMakeFiles/toyc-ch7.dir/mlir/LowerToLLVM.cpp.o
281.045 [2475/14/5018] Linking CXX shared library lib/libMLIRTestIR.so.20.0git
281.060 [2475/13/5019] Building CXX object tools/mlir/examples/toy/Ch7/CMakeFiles/toyc-ch7.dir/toyc.cpp.o
281.067 [2475/12/5020] Linking CXX shared library lib/libMLIRTestToLLVMIRTranslation.so.20.0git
281.140 [2475/11/5021] Building CXX object tools/mlir/examples/toy/Ch7/CMakeFiles/toyc-ch7.dir/parser/AST.cpp.o
281.178 [2475/10/5022] Building CXX object tools/mlir/examples/toy/Ch7/CMakeFiles/toyc-ch7.dir/mlir/Dialect.cpp.o
281.198 [2470/14/5023] Building CXX object tools/mlir/examples/minimal-opt/CMakeFiles/mlir-minimal-opt-canonicalize.dir/mlir-minimal-opt-canonicalize.cpp.o
281.200 [2470/13/5024] Building CXX object tools/mlir/examples/transform/Ch2/lib/CMakeFiles/MyExtensionCh2.dir/MyExtension.cpp.o
281.201 [2470/12/5025] Creating library symlink lib/libMLIRTestToLLVMIRTranslation.so
281.202 [2470/11/5026] Linking CXX shared library lib/libMLIRMlirOptMain.so.20.0git
FAILED: lib/libMLIRMlirOptMain.so.20.0git 
: && /usr/local/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRMlirOptMain.so.20.0git -o lib/libMLIRMlirOptMain.so.20.0git tools/mlir/tools/mlir-opt/CMakeFiles/MLIRMlirOptMain.dir/mlir-opt.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/lib:"  lib/libMLIRAffineTransformOps.so.20.0git  lib/libMLIRAMDGPUTransforms.so.20.0git  lib/libMLIRArithValueBoundsOpInterfaceImpl.so.20.0git  lib/libMLIRArmNeonTransforms.so.20.0git  lib/libMLIRAsyncTransforms.so.20.0git  lib/libMLIRBufferizationPipelines.so.20.0git  lib/libMLIRBufferizationTransformOps.so.20.0git  lib/libMLIRControlFlowTransforms.so.20.0git  lib/libMLIRDLTITransformOps.so.20.0git  lib/libMLIRFuncTransformOps.so.20.0git  lib/libMLIRGPUTransformOps.so.20.0git  lib/libMLIRGPUPipelines.so.20.0git  lib/libMLIRMathTransforms.so.20.0git  lib/libMLIRMemRefTransformOps.so.20.0git  lib/libMLIRMLProgramTransforms.so.20.0git  lib/libMLIRNVGPUTransformOps.so.20.0git  lib/libMLIRNVGPUTransforms.so.20.0git  lib/libMLIROpenACCTransforms.so.20.0git  lib/libMLIRPolynomialDialect.so.20.0git  lib/libMLIRPtrDialect.so.20.0git  lib/libMLIRQuantTransforms.so.20.0git  lib/libMLIRSCFTransformOps.so.20.0git  lib/libMLIRShapeOpsTransforms.so.20.0git  lib/libMLIRSparseTensorPipelines.so.20.0git  lib/libMLIRSparseTensorTransformOps.so.20.0git  lib/libMLIRSparseTensorTransforms.so.20.0git  lib/libMLIRSparseTensorUtils.so.20.0git  lib/libMLIRSPIRVModuleCombiner.so.20.0git  lib/libMLIRTensorInferTypeOpInterfaceImpl.so.20.0git  lib/libMLIRTensorTransformOps.so.20.0git  lib/libMLIRTransformDebugExtension.so.20.0git  lib/libMLIRTransformDialectIRDLExtension.so.20.0git  lib/libMLIRTransformLoopExtension.so.20.0git  lib/libMLIRTransformPDLExtension.so.20.0git  lib/libMLIRTransformDialectTransforms.so.20.0git  lib/libMLIRVectorTransformOps.so.20.0git  lib/libMLIRXeGPUTransforms.so.20.0git  lib/libMLIRTestDynDialect.so.20.0git  lib/libMLIRTosaTestPasses.so.20.0git  lib/libMLIRArithToAMDGPU.so.20.0git  lib/libMLIRArithToArmSME.so.20.0git  lib/libMLIRArithToEmitC.so.20.0git  lib/libMLIRArmNeon2dToIntr.so.20.0git  lib/libMLIRArmSMEToSCF.so.20.0git  lib/libMLIRArmSMEToLLVM.so.20.0git  lib/libMLIRBufferizationToMemRef.so.20.0git  lib/libMLIRComplexToLibm.so.20.0git  lib/libMLIRComplexToLLVM.so.20.0git  lib/libMLIRComplexToSPIRV.so.20.0git  lib/libMLIRComplexToStandard.so.20.0git  lib/libMLIRControlFlowToSCF.so.20.0git  lib/libMLIRControlFlowToSPIRV.so.20.0git  lib/libMLIRConvertToSPIRVPass.so.20.0git  lib/libMLIRFuncToEmitC.so.20.0git  lib/libMLIRGPUToLLVMSPV.so.20.0git  lib/libMLIRGPUToNVVMTransforms.so.20.0git  lib/libMLIRGPUToROCDLTransforms.so.20.0git  lib/libMLIRGPUToSPIRV.so.20.0git  lib/libMLIRGPUToVulkanTransforms.so.20.0git  lib/libMLIRIndexToLLVM.so.20.0git  lib/libMLIRLinalgToStandard.so.20.0git  lib/libMLIRMathToFuncs.so.20.0git  lib/libMLIRMathToLibm.so.20.0git  lib/libMLIRMathToLLVM.so.20.0git  lib/libMLIRMathToROCDL.so.20.0git  lib/libMLIRMathToSPIRV.so.20.0git  lib/libMLIRMemRefToEmitC.so.20.0git  lib/libMLIRMeshToMPI.so.20.0git  lib/libMLIRNVGPUToNVVM.so.20.0git  lib/libMLIRNVVMToLLVM.so.20.0git  lib/libMLIROpenACCToSCF.so.20.0git  lib/libMLIROpenMPToLLVM.so.20.0git  lib/libMLIRReconcileUnrealizedCasts.so.20.0git  lib/libMLIRSCFToControlFlow.so.20.0git  lib/libMLIRSCFToEmitC.so.20.0git  lib/libMLIRSCFToGPU.so.20.0git  lib/libMLIRSCFToOpenMP.so.20.0git  lib/libMLIRSCFToSPIRV.so.20.0git  lib/libMLIRShapeToStandard.so.20.0git  lib/libMLIRSPIRVToLLVM.so.20.0git  lib/libMLIRTensorToLinalg.so.20.0git  lib/libMLIRTensorToSPIRV.so.20.0git  lib/libMLIRTosaToArith.so.20.0git  lib/libMLIRTosaToLinalg.so.20.0git  lib/libMLIRTosaToMLProgram.so.20.0git  lib/libMLIRTosaToSCF.so.20.0git  lib/libMLIRTosaToTensor.so.20.0git  lib/libMLIRUBToLLVM.so.20.0git  lib/libMLIRUBToSPIRV.so.20.0git  lib/libMLIRVectorToArmSME.so.20.0git  lib/libMLIRVectorToGPU.so.20.0git  lib/libMLIRVectorToLLVMPass.so.20.0git  lib/libMLIRVectorToSPIRV.so.20.0git  lib/libMLIRVectorToXeGPU.so.20.0git  lib/libMLIRFuncAllExtensions.so.20.0git  lib/libMLIRTensorAllExtensions.so.20.0git  lib/libMLIROptLib.so.20.0git  lib/libMLIRToLLVMIRTranslationRegistration.so.20.0git  lib/libMLIRAMXTransforms.so.20.0git  lib/libMLIRArmSVETransforms.so.20.0git  lib/libMLIRLinalgTransformOps.so.20.0git  lib/libMLIRTransformDialect.so.20.0git  lib/libMLIRTransformDialectInterfaces.so.20.0git  lib/libMLIRTransformDialectUtils.so.20.0git  lib/libMLIRX86VectorTransforms.so.20.0git  lib/libMLIREmitCTransforms.so.20.0git  lib/libMLIRArmSMETransforms.so.20.0git  lib/libMLIRSPIRVTransforms.so.20.0git  lib/libMLIRIndexToSPIRV.so.20.0git  lib/libMLIRMemRefToSPIRV.so.20.0git  lib/libMLIRAMDGPUToROCDL.so.20.0git  lib/libMLIRAMDGPUUtils.so.20.0git  lib/libMLIRAMDGPUDialect.so.20.0git  lib/libMLIRGPUToGPURuntimeTransforms.so.20.0git  lib/libMLIRAsyncToLLVM.so.20.0git  lib/libMLIRConvertToLLVMPass.so.20.0git  lib/libMLIRConvertToLLVMInterface.so.20.0git  lib/libMLIRVectorToLLVM.so.20.0git  lib/libMLIRMPIDialect.so.20.0git  lib/libMLIREmitCDialect.so.20.0git  lib/libMLIRGPUTransforms.so.20.0git  lib/libMLIRAsyncDialect.so.20.0git  lib/libMLIRSPIRVTarget.so.20.0git  lib/libMLIRSPIRVSerialization.so.20.0git  lib/libMLIRSPIRVBinaryUtils.so.20.0git  lib/libMLIRNVVMTarget.so.20.0git  lib/libMLIRROCDLTarget.so.20.0git  lib/libMLIRTargetLLVM.so.20.0git  lib/libMLIRExecutionEngineUtils.so.20.0git  lib/libLLVMPasses.so.20.0git  lib/libLLVMTarget.so.20.0git  lib/libLLVMipo.so.20.0git  lib/libLLVMLinker.so.20.0git  lib/libMLIRAffineToStandard.so.20.0git  lib/libMLIRShapeDialect.so.20.0git  lib/libMLIRSPIRVUtils.so.20.0git  lib/libMLIRFuncToLLVM.so.20.0git  lib/libMLIRArithToLLVM.so.20.0git  lib/libMLIRArithAttrToLLVMConversion.so.20.0git  lib/libMLIRControlFlowToLLVM.so.20.0git  lib/libMLIRMemRefToLLVM.so.20.0git  lib/libMLIRSPIRVAttrToLLVMConversion.so.20.0git  lib/libMLIRLinalgTransforms.so.20.0git  lib/libMLIRMemRefTransforms.so.20.0git  lib/libMLIRArithTransforms.so.20.0git  lib/libMLIRFuncTransforms.so.20.0git  lib/libMLIRMeshTransforms.so.20.0git  lib/libMLIRTosaShardingInterfaceImpl.so.20.0git  lib/libMLIRSCFTransforms.so.20.0git  lib/libMLIRBufferizationTransforms.so.20.0git  lib/libMLIRTensorTransforms.so.20.0git  lib/libMLIRAffineTransforms.so.20.0git  lib/libMLIRSCFUtils.so.20.0git  lib/libMLIRTensorTilingInterfaceImpl.so.20.0git  lib/libMLIRTilingInterface.so.20.0git  lib/libMLIRVectorToSCF.so.20.0git  lib/libMLIRArithToSPIRV.so.20.0git  lib/libMLIRFuncToSPIRV.so.20.0git  lib/libMLIRSPIRVConversion.so.20.0git  lib/libMLIRIndexDialect.so.20.0git  lib/libMLIRLinalgUtils.so.20.0git  lib/libMLIRMLProgramDialect.so.20.0git  lib/libMLIRTensorUtils.so.20.0git  lib/libMLIRTosaTransforms.so.20.0git  lib/libMLIRTosaDialect.so.20.0git  lib/libMLIRQuantUtils.so.20.0git  lib/libMLIRQuantDialect.so.20.0git  lib/libMLIRLLVMCommonConversion.so.20.0git  lib/libMLIRNVGPUUtils.so.20.0git  lib/libMLIRNVGPUDialect.so.20.0git  lib/libMLIRVectorTransforms.so.20.0git  lib/libMLIRAffineUtils.so.20.0git  lib/libMLIRLinalgDialect.so.20.0git  lib/libMLIRBufferizationDialect.so.20.0git  lib/libMLIRMathDialect.so.20.0git  lib/libMLIRSparseTensorDialect.so.20.0git  lib/libMLIRMemRefUtils.so.20.0git  lib/libMLIRVectorUtils.so.20.0git  lib/libMLIRAffineAnalysis.so.20.0git  lib/libMLIRXeGPUDialect.so.20.0git  lib/libMLIRFuncInlinerExtension.so.20.0git  lib/libMLIRFuncMeshShardingExtensions.so.20.0git  lib/libMLIRTensorMeshShardingExtensions.so.20.0git  lib/libMLIRShardingInterface.so.20.0git  lib/libMLIRMeshDialect.so.20.0git  lib/libMLIRIRDL.so.20.0git  lib/libMLIRBytecodeWriter.so.20.0git  lib/libMLIRBytecodeOpInterface.so.20.0git  lib/libMLIRDebug.so.20.0git  lib/libMLIRObservers.so.20.0git  lib/libMLIRPluginsLib.so.20.0git  lib/libMLIRNVVMToLLVMIRTranslation.so.20.0git  lib/libMLIRROCDLToLLVMIRTranslation.so.20.0git  lib/libMLIRROCDLDialect.so.20.0git  lib/libMLIRArmNeonToLLVMIRTranslation.so.20.0git  lib/libMLIRArmNeonDialect.so.20.0git  lib/libMLIRArmSMEToLLVMIRTranslation.so.20.0git  lib/libMLIRArmSMEDialect.so.20.0git  lib/libMLIRSCFDialect.so.20.0git  lib/libMLIRControlFlowDialect.so.20.0git  lib/libMLIRArmSVEToLLVMIRTranslation.so.20.0git  lib/libMLIRArmSVEDialect.so.20.0git  lib/libMLIRVectorDialect.so.20.0git  lib/libMLIRTensorDialect.so.20.0git  lib/libMLIRAffineDialect.so.20.0git  lib/libMLIRParallelCombiningOpInterface.so.20.0git  lib/libMLIRVectorInterfaces.so.20.0git  lib/libMLIRMaskableOpInterface.so.20.0git  lib/libMLIRMaskingOpInterface.so.20.0git  lib/libMLIRAMXToLLVMIRTranslation.so.20.0git  lib/libMLIRAMXDialect.so.20.0git  lib/libMLIRBuiltinToLLVMIRTranslation.so.20.0git  lib/libMLIRGPUToLLVMIRTranslation.so.20.0git  lib/libMLIRGPUDialect.so.20.0git  lib/libMLIRX86VectorToLLVMIRTranslation.so.20.0git  lib/libMLIRX86VectorDialect.so.20.0git  lib/libMLIRLLVMToLLVMIRTranslation.so.20.0git  lib/libMLIROpenACCToLLVMIRTranslation.so.20.0git  lib/libMLIROpenACCDialect.so.20.0git  lib/libMLIRMemRefDialect.so.20.0git  lib/libMLIRArithUtils.so.20.0git  lib/libMLIRComplexDialect.so.20.0git  lib/libMLIRArithDialect.so.20.0git  lib/libMLIRCastInterfaces.so.20.0git  lib/libMLIRInferIntRangeCommon.so.20.0git  lib/libMLIRDialect.so.20.0git  lib/libMLIRDialectUtils.so.20.0git  lib/libMLIRShapedOpInterfaces.so.20.0git  lib/libMLIROpenMPToLLVMIRTranslation.so.20.0git  lib/libMLIROpenMPDialect.so.20.0git  lib/libMLIROpenACCMPCommon.so.20.0git  lib/libMLIRSPIRVToLLVMIRTranslation.so.20.0git  lib/libMLIRSPIRVDialect.so.20.0git  lib/libMLIRUBDialect.so.20.0git  lib/libMLIRVCIXToLLVMIRTranslation.so.20.0git  lib/libMLIRVCIXDialect.so.20.0git  lib/libMLIRTargetLLVMIRExport.so.20.0git  lib/libMLIRDLTIDialect.so.20.0git  lib/libMLIRLLVMIRTransforms.so.20.0git  lib/libMLIRFuncDialect.so.20.0git  lib/libMLIRNVVMDialect.so.20.0git  lib/libMLIRTransforms.so.20.0git  lib/libMLIRRuntimeVerifiableOpInterface.so.20.0git  lib/libMLIRLLVMDialect.so.20.0git  lib/libMLIRMemorySlotInterfaces.so.20.0git  lib/libLLVMBitWriter.so.20.0git  lib/libMLIRTransformUtils.so.20.0git  lib/libMLIRSubsetOpInterface.so.20.0git  lib/libMLIRValueBoundsOpInterface.so.20.0git  lib/libMLIRDestinationStyleOpInterface.so.20.0git  lib/libMLIRRewrite.so.20.0git  lib/libMLIRRewritePDL.so.20.0git  lib/libMLIRPDLToPDLInterp.so.20.0git  lib/libMLIRPDLInterpDialect.so.20.0git  lib/libMLIRPDLDialect.so.20.0git  lib/libMLIRPass.so.20.0git  lib/libMLIRAnalysis.so.20.0git  lib/libMLIRCallInterfaces.so.20.0git  lib/libMLIRControlFlowInterfaces.so.20.0git  lib/libMLIRPresburger.so.20.0git  lib/libMLIRLoopLikeInterface.so.20.0git  lib/libMLIRViewLikeInterface.so.20.0git  lib/libMLIRInferIntRangeInterface.so.20.0git  lib/libMLIRFunctionInterfaces.so.20.0git  lib/libMLIRDataLayoutInterfaces.so.20.0git  lib/libMLIRInferTypeOpInterface.so.20.0git  lib/libMLIRSideEffectInterfaces.so.20.0git  lib/libMLIRTranslateLib.so.20.0git  lib/libMLIRParser.so.20.0git  lib/libMLIRBytecodeReader.so.20.0git  lib/libMLIRAsmParser.so.20.0git  lib/libMLIRIR.so.20.0git  lib/libMLIRSupport.so.20.0git  lib/libLLVMFrontendOpenMP.so.20.0git  lib/libLLVMFrontendOffloading.so.20.0git  lib/libLLVMTransformUtils.so.20.0git  lib/libLLVMMCParser.so.20.0git  lib/libLLVMMC.so.20.0git  lib/libLLVMIRReader.so.20.0git  lib/libLLVMAsmParser.so.20.0git  lib/libLLVMBitReader.so.20.0git  lib/libLLVMCore.so.20.0git  lib/libLLVMBinaryFormat.so.20.0git  lib/libLLVMTargetParser.so.20.0git  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/lib && :
/usr/bin/ld: tools/mlir/tools/mlir-opt/CMakeFiles/MLIRMlirOptMain.dir/mlir-opt.cpp.o: in function `registerTestPasses()':
mlir-opt.cpp:(.text._Z18registerTestPassesv+0x8): undefined reference to `mlir::registerCloneTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0xc): undefined reference to `mlir::registerConvertToTargetEnvPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x10): undefined reference to `mlir::registerLazyLoadingTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x14): undefined reference to `mlir::registerLoopLikeInterfaceTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x18): undefined reference to `mlir::registerPassManagerTestPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x1c): undefined reference to `mlir::registerPrintSpirvAvailabilityPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x20): undefined reference to `mlir::registerRegionTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x24): undefined reference to `mlir::registerShapeFunctionTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x28): undefined reference to `mlir::registerSideEffectTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x2c): undefined reference to `mlir::registerSliceAnalysisTestPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x30): undefined reference to `mlir::registerSymbolTestPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x34): undefined reference to `mlir::registerTestAffineAccessAnalysisPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x38): undefined reference to `mlir::registerTestAffineDataCopyPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x3c): undefined reference to `mlir::registerTestAffineLoopUnswitchingPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x40): undefined reference to `mlir::registerTestAffineReifyValueBoundsPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x44): undefined reference to `mlir::registerTestAffineWalk()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x48): undefined reference to `mlir::registerTestBytecodeRoundtripPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x4c): undefined reference to `mlir::registerTestDecomposeAffineOpPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x50): undefined reference to `mlir::registerTestFunc()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x54): undefined reference to `mlir::registerTestGpuLoweringPasses()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x58): undefined reference to `mlir::registerTestGpuMemoryPromotionPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x5c): undefined reference to `mlir::registerTestLoopPermutationPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x60): undefined reference to `mlir::registerTestMatchers()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x64): undefined reference to `mlir::registerTestOperationEqualPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x68): undefined reference to `mlir::registerTestPreserveUseListOrders()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x6c): undefined reference to `mlir::registerTestPrintDefUsePass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x70): undefined reference to `mlir::registerTestPrintInvalidPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x74): undefined reference to `mlir::registerTestPrintNestingPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x78): undefined reference to `mlir::registerTestReducer()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x7c): undefined reference to `mlir::registerTestSpirvEntryPointABIPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x80): undefined reference to `mlir::registerTestSpirvModuleCombinerPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x84): undefined reference to `mlir::registerTestTraitsPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x8c): undefined reference to `mlir::registerVectorizerTestPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x90): undefined reference to `mlir::test::registerCommutativityUtils()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x94): undefined reference to `mlir::test::registerConvertCallOpPass()'
/usr/bin/ld: mlir-opt.cpp:(.text._Z18registerTestPassesv+0x98): undefined reference to `mlir::test::registerConvertFuncOpPass()'

nikic added a commit to nikic/llvm-project that referenced this pull request Dec 13, 2024
This is a followup to llvm#119408,
which switches unit test binaries to also use
mlir_target_link_libraries() where necessary. This allows them
to link against against the MLIR dylib.
nikic added a commit that referenced this pull request Dec 16, 2024
This is a followup to #119408,
which switches unit test binaries to also use
mlir_target_link_libraries() where necessary. This allows them to link
against against the MLIR dylib.
@mgorny
Copy link
Member

mgorny commented Dec 22, 2024

Just want to say: thank you a lot! With this in, I have finally added MLIR to Gentoo, and I think we're going to be ready for ClangIR too. Do you happen to know if libMLIR is good enough for Flang to link to? I'm about to start trying to port it to mlir_target_link_libraries.

@nikic
Copy link
Contributor Author

nikic commented Dec 22, 2024

I haven't tried it, but I would expect libMLIR to work for flang as well.

@Zentrik
Copy link
Contributor

Zentrik commented Dec 22, 2024

FWIW, this broke building on windows with mingw for me with LLVM_BUILD_LLVM_DYLIB, LLVM_LINK_LLVM_DYLIB and MLIR_BUILD_MLIR_C_DYLIB set with the following error (full log at https://github.com/Zentrik/llvm_julia_tester/actions/runs/12423441352/job/34686970477)

2024-12-20T05:07:02.7907449Z [05:07:02] ninja: job failed: : && /opt/bin/x86_64-w64-mingw32-libgfortran5-cxx11/x86_64-w64-mingw32-clang++ --target=x86_64-w64-mingw32 --sysroot=/opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/ -remap -D__USING_SJLJ_EXCEPTIONS__ -D__CRT__NO_INLINE -pthread -DMLIR_CAPI_ENABLE_WINDOWS_DLL_DECLSPEC -Dmlir_arm_sme_abi_stubs_EXPORTS -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -O3 -DNDEBUG -Wl,--stack,16777216    -Wl,--gc-sections tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/DummyParserFuzzer.cpp.obj tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj -o bin/mlir-text-parser-fuzzer.exe -Wl,--out-implib,lib/libmlir-text-parser-fuzzer.dll.a -Wl,--major-image-version,0,--minor-image-version,0  lib/libMLIR.dll.a  lib/libLLVM-20jl.dll.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && :
2024-12-20T05:07:02.7915777Z [05:07:02] clang-16: warning: argument unused during compilation: '-remap' [-Wunused-command-line-argument]
2024-12-20T05:07:02.7917223Z [05:07:02] ld.lld: error: undefined symbol: mlir::SuccessorRange::SuccessorRange(mlir::Operation*)
2024-12-20T05:07:02.7919009Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(mlir::Operation::debug_getSuccessors())
2024-12-20T05:07:02.7995542Z [05:07:02] 
2024-12-20T05:07:02.7996151Z [05:07:02] ld.lld: error: undefined symbol: mlir::DialectRegistry::DialectRegistry()
2024-12-20T05:07:02.7997503Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(LLVMFuzzerTestOneInput)
2024-12-20T05:07:02.7998609Z [05:07:02] 
2024-12-20T05:07:02.7999332Z [05:07:02] ld.lld: error: undefined symbol: mlir::MLIRContext::MLIRContext(mlir::DialectRegistry const&, mlir::MLIRContext::Threading)
2024-12-20T05:07:02.8000883Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(LLVMFuzzerTestOneInput)
2024-12-20T05:07:02.8002001Z [05:07:02] 
2024-12-20T05:07:02.8002532Z [05:07:02] ld.lld: error: undefined symbol: mlir::MLIRContext::allowUnregisteredDialects(bool)
2024-12-20T05:07:02.8003832Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(LLVMFuzzerTestOneInput)
2024-12-20T05:07:02.8004899Z [05:07:02] 
2024-12-20T05:07:02.8005332Z [05:07:02] ld.lld: error: undefined symbol: mlir::MLIRContext::getDiagEngine()
2024-12-20T05:07:02.8006558Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(LLVMFuzzerTestOneInput)
2024-12-20T05:07:02.8007998Z [05:07:02] 
2024-12-20T05:07:02.8008764Z [05:07:02] ld.lld: error: undefined symbol: mlir::DiagnosticEngine::registerHandler(llvm::unique_function<llvm::LogicalResult (mlir::Diagnostic&)>)
2024-12-20T05:07:02.8010699Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(LLVMFuzzerTestOneInput)
2024-12-20T05:07:02.8011962Z [05:07:02] 
2024-12-20T05:07:02.8013215Z [05:07:02] ld.lld: error: undefined symbol: mlir::parseSourceString(llvm::StringRef, mlir::Block*, mlir::ParserConfig const&, llvm::StringRef, mlir::LocationAttr*)
2024-12-20T05:07:02.8015129Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(LLVMFuzzerTestOneInput)
2024-12-20T05:07:02.8016387Z [05:07:02] 
2024-12-20T05:07:02.8016836Z [05:07:02] ld.lld: error: undefined symbol: mlir::Block::~Block()
2024-12-20T05:07:02.8018371Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(LLVMFuzzerTestOneInput)
2024-12-20T05:07:02.8019596Z [05:07:02] 
2024-12-20T05:07:02.8020097Z [05:07:02] ld.lld: error: undefined symbol: mlir::Operation::erase()
2024-12-20T05:07:02.8021501Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(LLVMFuzzerTestOneInput)
2024-12-20T05:07:02.8024268Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(mlir::OwningOpRef<mlir::ModuleOp> mlir::detail::constructContainerOpForParserIfNecessary<mlir::ModuleOp>(mlir::Block*, mlir::MLIRContext*, mlir::Location))
2024-12-20T05:07:02.8026250Z [05:07:02] 
2024-12-20T05:07:02.8026777Z [05:07:02] ld.lld: error: undefined symbol: mlir::MLIRContext::~MLIRContext()
2024-12-20T05:07:02.8028235Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(LLVMFuzzerTestOneInput)
2024-12-20T05:07:02.8029472Z [05:07:02] 
2024-12-20T05:07:02.8048255Z [05:07:02] ld.lld: error: undefined symbol: llvm::ilist_traits<mlir::Operation>::transferNodesFromList(llvm::ilist_traits<mlir::Operation>&, llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, true, false, void, false, void>, false, false>, llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, true, false, void, false, void>, false, false>)
2024-12-20T05:07:02.8051622Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(mlir::OwningOpRef<mlir::ModuleOp> mlir::detail::constructContainerOpForParserIfNecessary<mlir::ModuleOp>(mlir::Block*, mlir::MLIRContext*, mlir::Location))
2024-12-20T05:07:02.8053405Z [05:07:02] 
2024-12-20T05:07:02.8053851Z [05:07:02] ld.lld: error: undefined symbol: mlir::ModuleOp::verifyInvariants()
2024-12-20T05:07:02.8055667Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(mlir::OwningOpRef<mlir::ModuleOp> mlir::detail::constructContainerOpForParserIfNecessary<mlir::ModuleOp>(mlir::Block*, mlir::MLIRContext*, mlir::Location))
2024-12-20T05:07:02.8057526Z [05:07:02] 
2024-12-20T05:07:02.8058788Z [05:07:02] ld.lld: error: undefined symbol: llvm::ilist_detail::SpecificNodeAccess<llvm::ilist_detail::node_options<mlir::Operation, true, false, void, false, void>>::getValuePtr(llvm::ilist_node_impl<llvm::ilist_detail::node_options<mlir::Operation, true, false, void, false, void>>*)
2024-12-20T05:07:02.8061551Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(mlir::OwningOpRef<mlir::ModuleOp> mlir::detail::constructContainerOpForParserIfNecessary<mlir::ModuleOp>(mlir::Block*, mlir::MLIRContext*, mlir::Location))
2024-12-20T05:07:02.8063272Z [05:07:02] 
2024-12-20T05:07:02.8063659Z [05:07:02] ld.lld: error: undefined symbol: mlir::Operation::remove()
2024-12-20T05:07:02.8065798Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(mlir::OwningOpRef<mlir::ModuleOp> mlir::detail::constructContainerOpForParserIfNecessary<mlir::ModuleOp>(mlir::Block*, mlir::MLIRContext*, mlir::Location))
2024-12-20T05:07:02.8067844Z [05:07:02] 
2024-12-20T05:07:02.8068313Z [05:07:02] ld.lld: error: undefined symbol: mlir::Attribute::getContext() const
2024-12-20T05:07:02.8069852Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(mlir::ModuleOp mlir::OpBuilder::create<mlir::ModuleOp>(mlir::Location))
2024-12-20T05:07:02.8071184Z [05:07:02] 
2024-12-20T05:07:02.8071995Z [05:07:02] ld.lld: error: undefined symbol: mlir::RegisteredOperationName::lookup(mlir::TypeID, mlir::MLIRContext*)
2024-12-20T05:07:02.8073727Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(mlir::ModuleOp mlir::OpBuilder::create<mlir::ModuleOp>(mlir::Location))
2024-12-20T05:07:02.8075071Z [05:07:02] 
2024-12-20T05:07:02.8075726Z [05:07:02] ld.lld: error: undefined symbol: mlir::OperationState::OperationState(mlir::Location, mlir::OperationName)
2024-12-20T05:07:02.8077459Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(mlir::ModuleOp mlir::OpBuilder::create<mlir::ModuleOp>(mlir::Location))
2024-12-20T05:07:02.8078766Z [05:07:02] 
2024-12-20T05:07:02.8079487Z [05:07:02] ld.lld: error: undefined symbol: mlir::ModuleOp::build(mlir::OpBuilder&, mlir::OperationState&, std::optional<llvm::StringRef>)
2024-12-20T05:07:02.8081244Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(mlir::ModuleOp mlir::OpBuilder::create<mlir::ModuleOp>(mlir::Location))
2024-12-20T05:07:02.8082453Z [05:07:02] 
2024-12-20T05:07:02.8085633Z [05:07:02] ld.lld: error: undefined symbol: mlir::OpBuilder::create(mlir::OperationState const&)
2024-12-20T05:07:02.8087582Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(mlir::ModuleOp mlir::OpBuilder::create<mlir::ModuleOp>(mlir::Location))
2024-12-20T05:07:02.8088910Z [05:07:02] 
2024-12-20T05:07:02.8089387Z [05:07:02] ld.lld: error: undefined symbol: mlir::OperationState::~OperationState()
2024-12-20T05:07:02.8091026Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-parser-fuzzer/text/CMakeFiles/mlir-text-parser-fuzzer.dir/mlir-text-parser-fuzzer.cpp.obj:(mlir::ModuleOp mlir::OpBuilder::create<mlir::ModuleOp>(mlir::Location))
2024-12-20T05:07:02.8092409Z [05:07:02] 
2024-12-20T05:07:02.8092993Z [05:07:02] ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
2024-12-20T05:07:02.8093915Z [05:07:02] clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
2024-12-20T05:07:02.8100485Z [05:07:02] ninja: job failed: : && /opt/bin/x86_64-w64-mingw32-libgfortran5-cxx11/x86_64-w64-mingw32-clang++ --target=x86_64-w64-mingw32 --sysroot=/opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/ -remap -D__USING_SJLJ_EXCEPTIONS__ -D__CRT__NO_INLINE -pthread -DMLIR_CAPI_ENABLE_WINDOWS_DLL_DECLSPEC -Dmlir_arm_sme_abi_stubs_EXPORTS -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -O3 -DNDEBUG -Wl,--stack,16777216 tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj -o bin/mlir-rewrite.exe -Wl,--out-implib,lib/libmlir-rewrite.dll.a -Wl,--major-image-version,0,--minor-image-version,0  lib/libMLIR.dll.a  lib/libLLVM-20jl.dll.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && :
2024-12-20T05:07:02.8107359Z [05:07:02] clang-16: warning: argument unused during compilation: '-remap' [-Wunused-command-line-argument]
2024-12-20T05:07:02.8108397Z [05:07:02] ld.lld: error: undefined symbol: mlir::SuccessorRange::SuccessorRange(mlir::Operation*)
2024-12-20T05:07:02.8109619Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::Operation::debug_getSuccessors())
2024-12-20T05:07:02.8110586Z [05:07:02] 
2024-12-20T05:07:02.8111146Z [05:07:02] ld.lld: error: undefined symbol: mlir::MLIRContext::MLIRContext(mlir::MLIRContext::Threading)
2024-12-20T05:07:02.8112667Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::RewritePad::init(llvm::StringRef, llvm::StringRef))
2024-12-20T05:07:02.8113715Z [05:07:02] 
2024-12-20T05:07:02.8114193Z [05:07:02] ld.lld: error: undefined symbol: mlir::DialectRegistry::DialectRegistry()
2024-12-20T05:07:02.8115391Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::RewritePad::init(llvm::StringRef, llvm::StringRef))
2024-12-20T05:07:02.8116451Z [05:07:02] 
2024-12-20T05:07:02.8116912Z [05:07:02] ld.lld: error: undefined symbol: mlir::AsmParserState::AsmParserState()
2024-12-20T05:07:02.8118161Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::RewritePad::init(llvm::StringRef, llvm::StringRef))
2024-12-20T05:07:02.8119190Z [05:07:02] 
2024-12-20T05:07:02.8119970Z [05:07:02] ld.lld: error: undefined symbol: mlir::openInputFile(llvm::StringRef, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
2024-12-20T05:07:02.8121464Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::RewritePad::init(llvm::StringRef, llvm::StringRef))
2024-12-20T05:07:02.8122446Z [05:07:02] 
2024-12-20T05:07:02.8123143Z [05:07:02] ld.lld: error: undefined symbol: mlir::MLIRContext::appendDialectRegistry(mlir::DialectRegistry const&)
2024-12-20T05:07:02.8124585Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::RewritePad::init(llvm::StringRef, llvm::StringRef))
2024-12-20T05:07:02.8125541Z [05:07:02] 
2024-12-20T05:07:02.8126005Z [05:07:02] ld.lld: error: undefined symbol: mlir::MLIRContext::allowUnregisteredDialects(bool)
2024-12-20T05:07:02.8127159Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::RewritePad::init(llvm::StringRef, llvm::StringRef))
2024-12-20T05:07:02.8130507Z [05:07:02] 
2024-12-20T05:07:02.8131488Z [05:07:02] ld.lld: error: undefined symbol: mlir::parseAsmSourceFile(llvm::SourceMgr const&, mlir::Block*, mlir::ParserConfig const&, mlir::AsmParserState*, mlir::AsmParserCodeCompleteContext*)
2024-12-20T05:07:02.8133212Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::RewritePad::init(llvm::StringRef, llvm::StringRef))
2024-12-20T05:07:02.8134181Z [05:07:02] 
2024-12-20T05:07:02.8134859Z [05:07:02] ld.lld: error: undefined symbol: mlir::affine::registerValueBoundsOpInterfaceExternalModels(mlir::DialectRegistry&)
2024-12-20T05:07:02.8136227Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::registerAllDialects(mlir::DialectRegistry&))
2024-12-20T05:07:02.8137169Z [05:07:02] 
2024-12-20T05:07:02.8137959Z [05:07:02] ld.lld: error: undefined symbol: mlir::arith::registerBufferDeallocationOpInterfaceExternalModels(mlir::DialectRegistry&)
2024-12-20T05:07:02.8139323Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::registerAllDialects(mlir::DialectRegistry&))
2024-12-20T05:07:02.8140393Z [05:07:02] 
2024-12-20T05:07:02.8141089Z [05:07:02] ld.lld: error: undefined symbol: mlir::arith::registerBufferizableOpInterfaceExternalModels(mlir::DialectRegistry&)
2024-12-20T05:07:02.8142432Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::registerAllDialects(mlir::DialectRegistry&))
2024-12-20T05:07:02.8143459Z [05:07:02] 
2024-12-20T05:07:02.8144188Z [05:07:02] ld.lld: error: undefined symbol: mlir::arith::registerBufferViewFlowOpInterfaceExternalModels(mlir::DialectRegistry&)
2024-12-20T05:07:02.8145523Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::registerAllDialects(mlir::DialectRegistry&))
2024-12-20T05:07:02.8146561Z [05:07:02] 
2024-12-20T05:07:02.8147426Z [05:07:02] ld.lld: error: undefined symbol: mlir::arith::registerValueBoundsOpInterfaceExternalModels(mlir::DialectRegistry&)
2024-12-20T05:07:02.8148967Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::registerAllDialects(mlir::DialectRegistry&))
2024-12-20T05:07:02.8150013Z [05:07:02] 
2024-12-20T05:07:02.8150876Z [05:07:02] ld.lld: error: undefined symbol: mlir::bufferization::func_ext::registerBufferizableOpInterfaceExternalModels(mlir::DialectRegistry&)
2024-12-20T05:07:02.8152528Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::registerAllDialects(mlir::DialectRegistry&))
2024-12-20T05:07:02.8153539Z [05:07:02] 
2024-12-20T05:07:02.8154211Z [05:07:02] ld.lld: error: undefined symbol: mlir::builtin::registerCastOpInterfaceExternalModels(mlir::DialectRegistry&)
2024-12-20T05:07:02.8156012Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::registerAllDialects(mlir::DialectRegistry&))
2024-12-20T05:07:02.8157063Z [05:07:02] 
2024-12-20T05:07:02.8157773Z [05:07:02] ld.lld: error: undefined symbol: mlir::cf::registerBufferizableOpInterfaceExternalModels(mlir::DialectRegistry&)
2024-12-20T05:07:02.8159308Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::registerAllDialects(mlir::DialectRegistry&))
2024-12-20T05:07:02.8160219Z [05:07:02] 
2024-12-20T05:07:02.8160966Z [05:07:02] ld.lld: error: undefined symbol: mlir::cf::registerBufferDeallocationOpInterfaceExternalModels(mlir::DialectRegistry&)
2024-12-20T05:07:02.8162565Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::registerAllDialects(mlir::DialectRegistry&))
2024-12-20T05:07:02.8163629Z [05:07:02] 
2024-12-20T05:07:02.8164445Z [05:07:02] ld.lld: error: undefined symbol: mlir::gpu::registerBufferDeallocationOpInterfaceExternalModels(mlir::DialectRegistry&)
2024-12-20T05:07:02.8166063Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::registerAllDialects(mlir::DialectRegistry&))
2024-12-20T05:07:02.8167156Z [05:07:02] 
2024-12-20T05:07:02.8167959Z [05:07:02] ld.lld: error: undefined symbol: mlir::LLVM::registerInlinerInterface(mlir::DialectRegistry&)
2024-12-20T05:07:02.8169235Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::registerAllDialects(mlir::DialectRegistry&))
2024-12-20T05:07:02.8170142Z [05:07:02] 
2024-12-20T05:07:02.8170786Z [05:07:02] ld.lld: error: undefined symbol: mlir::linalg::registerAllDialectInterfaceImplementations(mlir::DialectRegistry&)
2024-12-20T05:07:02.8172093Z [05:07:02] >>> referenced by tools/mlir/tools/mlir-rewrite/CMakeFiles/mlir-rewrite.dir/mlir-rewrite.cpp.obj:(mlir::registerAllDialects(mlir::DialectRegistry&))
2024-12-20T05:07:02.8172990Z [05:07:02] 
2024-12-20T05:07:02.8173484Z [05:07:02] ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
2024-12-20T05:07:02.8174411Z [05:07:02] clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
2024-12-20T05:07:03.0460234Z [05:07:03] clang-16: warning: argument unused during compilation: '-remap' [-Wunused-command-line-argument]
2024-12-20T05:07:04.9602702Z [05:07:04] clang-16: warning: argument unused during compilation: '-remap' [-Wunused-command-line-argument]
2024-12-20T05:07:04.9609854Z [05:07:04] ninja: subcommands failed
2024-12-20T05:07:04.9625243Z [05:07:04]  ---> ninja -j${nproc} -vv
2024-12-20T05:07:04.9626688Z [05:07:04]  ---> ninja -j${nproc} -vv
2024-12-20T05:07:04.9627958Z [05:07:04] Previous command exited with 1
2024-12-20T05:07:04.9833666Z [05:07:04] Child Process exited, exit code 1
2024-12-20T05:07:05.7477111Z ERROR: Build for LLVM_full_assert on x86_64-w64-mingw32-cxx11 did not complete successfully

Looks somewhat similar to #106859.

Anyways setting DMLIR_LINK_MLIR_DYLIB=OFF gets things working again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlir:core MLIR Core Infrastructure mlir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants