summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/clang/clang/0023-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/clang/clang/0023-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch')
-rw-r--r--recipes-devtools/clang/clang/0023-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch140
1 files changed, 140 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0023-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch b/recipes-devtools/clang/clang/0023-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch
new file mode 100644
index 0000000..c97158e
--- /dev/null
+++ b/recipes-devtools/clang/clang/0023-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch
@@ -0,0 +1,140 @@
1From 8c28658ad591489e35690a245f82b519ae37929e Mon Sep 17 00:00:00 2001
2From: Ovidiu Panait <ovidiu.panait@windriver.com>
3Date: Fri, 31 Jan 2020 10:56:11 +0200
4Subject: [PATCH] clang,llvm: cmake: Fix configure for packages using
5 find_package()
6
7Currently, when a package (i.e. bcc [https://github.com/iovisor/bcc.git])
8that depends on LLVM/Clang tries to run cmake find_package() during
9do_configure, it will fail with a similar error:
10
11| The imported target "llvm-tblgen" references the file
12| ".../recipe-sysroot/usr/bin/llvm-tblgen"
13|
14| but this file does not exist. Possible reasons include:
15| * The file was deleted, renamed, or moved to another location.
16| * An install or uninstall procedure did not complete successfully.
17| * The installation package was faulty and contained
18| ".../recipe-sysroot/usr/lib/cmake/LLVMExports.cmake"
19| but not all the files it references.
20
21This is due to the fact that currently the cmake scripts look for target
22binaries in sysroot. Work around this by not exporting the target binaries in
23Exports-* cmake files.
24
25Upstream-Status: Innapropriate [oe-specific]
26
27Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
28---
29 clang/cmake/modules/AddClang.cmake | 8 --------
30 llvm/cmake/modules/AddLLVM.cmake | 18 ------------------
31 llvm/cmake/modules/TableGen.cmake | 7 -------
32 3 files changed, 33 deletions(-)
33
34diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake
35index 577cc11ab01..5c859d86069 100644
36--- a/clang/cmake/modules/AddClang.cmake
37+++ b/clang/cmake/modules/AddClang.cmake
38@@ -151,15 +151,8 @@ macro(add_clang_tool name)
39 add_dependencies(${name} clang-resource-headers)
40
41 if (CLANG_BUILD_TOOLS)
42- set(export_to_clangtargets)
43- if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
44- NOT LLVM_DISTRIBUTION_COMPONENTS)
45- set(export_to_clangtargets EXPORT ClangTargets)
46- set_property(GLOBAL PROPERTY CLANG_HAS_EXPORTS True)
47- endif()
48
49 install(TARGETS ${name}
50- ${export_to_clangtargets}
51 RUNTIME DESTINATION bin
52 COMPONENT ${name})
53
54@@ -168,7 +161,6 @@ macro(add_clang_tool name)
55 DEPENDS ${name}
56 COMPONENT ${name})
57 endif()
58- set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name})
59 endif()
60 endmacro()
61
62diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
63index fce36ba2125..554ad0b4ade 100644
64--- a/llvm/cmake/modules/AddLLVM.cmake
65+++ b/llvm/cmake/modules/AddLLVM.cmake
66@@ -1033,15 +1033,8 @@ macro(add_llvm_tool name)
67
68 if ( ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
69 if( LLVM_BUILD_TOOLS )
70- set(export_to_llvmexports)
71- if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
72- NOT LLVM_DISTRIBUTION_COMPONENTS)
73- set(export_to_llvmexports EXPORT LLVMExports)
74- set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True)
75- endif()
76
77 install(TARGETS ${name}
78- ${export_to_llvmexports}
79 RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}
80 COMPONENT ${name})
81
82@@ -1052,9 +1045,6 @@ macro(add_llvm_tool name)
83 endif()
84 endif()
85 endif()
86- if( LLVM_BUILD_TOOLS )
87- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
88- endif()
89 set_target_properties(${name} PROPERTIES FOLDER "Tools")
90 endmacro(add_llvm_tool name)
91
92@@ -1092,15 +1082,8 @@ macro(add_llvm_utility name)
93 set_target_properties(${name} PROPERTIES FOLDER "Utils")
94 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
95 if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS)
96- set(export_to_llvmexports)
97- if (${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
98- NOT LLVM_DISTRIBUTION_COMPONENTS)
99- set(export_to_llvmexports EXPORT LLVMExports)
100- set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True)
101- endif()
102
103 install(TARGETS ${name}
104- ${export_to_llvmexports}
105 RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR}
106 COMPONENT ${name})
107
108@@ -1109,7 +1092,6 @@ macro(add_llvm_utility name)
109 DEPENDS ${name}
110 COMPONENT ${name})
111 endif()
112- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
113 elseif(LLVM_BUILD_UTILS)
114 set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
115 endif()
116diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake
117index 9d2fcd9a793..acdb898149d 100644
118--- a/llvm/cmake/modules/TableGen.cmake
119+++ b/llvm/cmake/modules/TableGen.cmake
120@@ -161,14 +161,8 @@ macro(add_tablegen target project)
121 endif()
122
123 if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS)
124- set(export_to_llvmexports)
125- if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
126- NOT LLVM_DISTRIBUTION_COMPONENTS)
127- set(export_to_llvmexports EXPORT LLVMExports)
128- endif()
129
130 install(TARGETS ${target}
131- ${export_to_llvmexports}
132 COMPONENT ${target}
133 RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR})
134 if(NOT LLVM_ENABLE_IDE)
135@@ -177,5 +171,4 @@ macro(add_tablegen target project)
136 COMPONENT ${target})
137 endif()
138 endif()
139- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target})
140 endmacro()