[all-commits] [llvm/llvm-project] 4c6242: [mlir] Link libraries that aren't included in libM...

Michał Górny via All-commits all-commits at lists.llvm.org
Tue Jan 21 23:55:16 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4c6242ebf50dde0597df2bace49d534b61122496
      https://github.com/llvm/llvm-project/commit/4c6242ebf50dde0597df2bace49d534b61122496
  Author: Michał Górny <mgorny at gentoo.org>
  Date:   2025-01-22 (Wed, 22 Jan 2025)

  Changed paths:
    M mlir/cmake/modules/AddMLIR.cmake
    M mlir/lib/CAPI/ExecutionEngine/CMakeLists.txt
    M mlir/lib/ExecutionEngine/CMakeLists.txt
    M mlir/lib/ExecutionEngine/SparseTensor/CMakeLists.txt
    M mlir/test/lib/Analysis/CMakeLists.txt
    M mlir/test/lib/Conversion/ConvertToSPIRV/CMakeLists.txt
    M mlir/test/lib/Conversion/FuncToLLVM/CMakeLists.txt
    M mlir/test/lib/Conversion/MathToVCIX/CMakeLists.txt
    M mlir/test/lib/Conversion/OneToNTypeConversion/CMakeLists.txt
    M mlir/test/lib/Conversion/VectorToSPIRV/CMakeLists.txt
    M mlir/test/lib/Dialect/Affine/CMakeLists.txt
    M mlir/test/lib/Dialect/Arith/CMakeLists.txt
    M mlir/test/lib/Dialect/ArmNeon/CMakeLists.txt
    M mlir/test/lib/Dialect/ArmSME/CMakeLists.txt
    M mlir/test/lib/Dialect/Bufferization/CMakeLists.txt
    M mlir/test/lib/Dialect/ControlFlow/CMakeLists.txt
    M mlir/test/lib/Dialect/DLTI/CMakeLists.txt
    M mlir/test/lib/Dialect/Func/CMakeLists.txt
    M mlir/test/lib/Dialect/GPU/CMakeLists.txt
    M mlir/test/lib/Dialect/LLVM/CMakeLists.txt
    M mlir/test/lib/Dialect/Linalg/CMakeLists.txt
    M mlir/test/lib/Dialect/Math/CMakeLists.txt
    M mlir/test/lib/Dialect/MemRef/CMakeLists.txt
    M mlir/test/lib/Dialect/Mesh/CMakeLists.txt
    M mlir/test/lib/Dialect/NVGPU/CMakeLists.txt
    M mlir/test/lib/Dialect/SCF/CMakeLists.txt
    M mlir/test/lib/Dialect/SPIRV/CMakeLists.txt
    M mlir/test/lib/Dialect/Shape/CMakeLists.txt
    M mlir/test/lib/Dialect/Tensor/CMakeLists.txt
    M mlir/test/lib/Dialect/Test/CMakeLists.txt
    M mlir/test/lib/Dialect/TestDyn/CMakeLists.txt
    M mlir/test/lib/Dialect/Tosa/CMakeLists.txt
    M mlir/test/lib/Dialect/Transform/CMakeLists.txt
    M mlir/test/lib/Dialect/Vector/CMakeLists.txt
    M mlir/test/lib/IR/CMakeLists.txt
    M mlir/test/lib/Interfaces/LoopLikeInterface/CMakeLists.txt
    M mlir/test/lib/Interfaces/TilingInterface/CMakeLists.txt
    M mlir/test/lib/Pass/CMakeLists.txt
    M mlir/test/lib/Reducer/CMakeLists.txt
    M mlir/test/lib/Rewrite/CMakeLists.txt
    M mlir/test/lib/Tools/PDLL/CMakeLists.txt
    M mlir/test/lib/Transforms/CMakeLists.txt
    M mlir/test/python/lib/CMakeLists.txt
    M mlir/tools/mlir-opt/CMakeLists.txt

  Log Message:
  -----------
  [mlir] Link libraries that aren't included in libMLIR to libMLIR (#123781)

Use `mlir_target_link_libraries()` to link dependencies of libraries
that are not included in libMLIR, to ensure that they link to the dylib
when they are used in Flang. Otherwise, they implicitly pull in all
their static dependencies, effectively causing Flang binaries to
simultaneously link to the dylib and to static libraries, which is never
a good idea.

I have only covered the libraries that are used by Flang. If you wish, I
can extend this approach to all non-libMLIR libraries in MLIR, making
MLIR itself also link to the dylib consistently.

[v2 with fixed `-DBUILD_SHARED_LIBS=ON` build]



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