Skip to content

Commit 84a9534

Browse files
committed
Backport fix for MLIR exports
Otherwise tmt tests will fail due to missing cmake exports.
1 parent ac04b73 commit 84a9534

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
From b443e55162861125a50048ae9bc521e98058b273 Mon Sep 17 00:00:00 2001
2+
From: Nikita Popov <[email protected]>
3+
Date: Mon, 16 Dec 2024 14:44:43 +0100
4+
Subject: [PATCH] [CMake] Use correct exports file for MLIR tools
5+
6+
llvm_add_tool() currently does not respect the passed project and
7+
puts all tools into LLVMExports.cmake. This means that we end up
8+
with binaries like mlir-opt in LLVMExports.cmake instead of
9+
MLIRTargets.cmake, where they should be.
10+
11+
Adjust llvm_add_tool() to take the project into account.
12+
---
13+
llvm/cmake/modules/AddLLVM.cmake | 5 +++--
14+
1 file changed, 3 insertions(+), 2 deletions(-)
15+
16+
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
17+
index 006dfb6de3a199..6cf0ee1a54dbdb 100644
18+
--- a/llvm/cmake/modules/AddLLVM.cmake
19+
+++ b/llvm/cmake/modules/AddLLVM.cmake
20+
@@ -1483,7 +1483,7 @@ macro(llvm_add_tool project name)
21+
22+
if ( ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
23+
if( LLVM_BUILD_TOOLS )
24+
- get_target_export_arg(${name} LLVM export_to_llvmexports)
25+
+ get_target_export_arg(${name} ${project} export_to_llvmexports)
26+
install(TARGETS ${name}
27+
${export_to_llvmexports}
28+
RUNTIME DESTINATION ${${project}_TOOLS_INSTALL_DIR}
29+
@@ -1497,7 +1497,8 @@ macro(llvm_add_tool project name)
30+
endif()
31+
endif()
32+
if( LLVM_BUILD_TOOLS )
33+
- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
34+
+ string(TOUPPER "${project}" project_upper)
35+
+ set_property(GLOBAL APPEND PROPERTY ${project_upper}_EXPORTS ${name})
36+
endif()
37+
endif()
38+
get_subproject_title(subproject_title)

llvm.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
#region main package
197197
Name: %{pkg_name_llvm}
198198
Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}}
199-
Release: 1%{?dist}
199+
Release: 2%{?dist}
200200
Summary: The Low Level Virtual Machine
201201

202202
License: Apache-2.0 WITH LLVM-exception OR NCSA
@@ -275,6 +275,8 @@ Patch1904: 0001-mlir-python-Reuse-the-library-directory.patch
275275
Patch1905: 0001-CMake-Add-missing-dependency-108461.patch
276276
# See https://github.com/llvm/llvm-project/pull/118542
277277
Patch1906: 0001-mlir-Specify-deps-via-LLVM_LINK_COMPONENTS.patch
278+
# See https://github.com/llvm/llvm-project/pull/120079
279+
Patch1907: 0001-CMake-Use-correct-exports-for-MLIR-tools.patch
278280
#endregion MLIR patches
279281

280282
#region LLD patches
@@ -2713,6 +2715,9 @@ fi
27132715

27142716
#region changelog
27152717
%changelog
2718+
* Thu Dec 19 2024 Nikita Popov <[email protected]> - 19.1.6-2
2719+
- Fix mlir exports
2720+
27162721
* Wed Dec 18 2024 Timm Bäder <[email protected]> - 19.1.6-1
27172722
- Update to 19.1.6
27182723

0 commit comments

Comments
 (0)