[all-commits] [llvm/llvm-project] 10ef20: [mlir] Add support for MLIR_LINK_MLIR_DYLIB (#119408)

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Dec 12 05:59:57 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 10ef20f6a629797d81252de143117e2a0bc6556d
      https://github.com/llvm/llvm-project/commit/10ef20f6a629797d81252de143117e2a0bc6556d
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-12-12 (Thu, 12 Dec 2024)

  Changed paths:
    M mlir/CMakeLists.txt
    M mlir/cmake/modules/AddMLIR.cmake
    M mlir/tools/mlir-cpu-runner/CMakeLists.txt
    M mlir/tools/mlir-lsp-server/CMakeLists.txt
    M mlir/tools/mlir-opt/CMakeLists.txt
    M mlir/tools/mlir-parser-fuzzer/bytecode/CMakeLists.txt
    M mlir/tools/mlir-parser-fuzzer/text/CMakeLists.txt
    M mlir/tools/mlir-query/CMakeLists.txt
    M mlir/tools/mlir-reduce/CMakeLists.txt
    M mlir/tools/mlir-rewrite/CMakeLists.txt
    M mlir/tools/mlir-translate/CMakeLists.txt

  Log Message:
  -----------
  [mlir] Add support for MLIR_LINK_MLIR_DYLIB (#119408)

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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list