summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/clang/clang
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-08-28 12:10:12 -0700
committerKhem Raj <raj.khem@gmail.com>2021-09-02 22:22:57 -0700
commit4f69b68228f75b6a3f2375a0258fd04f4f67ce70 (patch)
tree815caba103839555e78d98f0a2ee88aaf11b46c9 /recipes-devtools/clang/clang
parent610c47baddbfb310ffa681cc202211ed4a659e95 (diff)
downloadmeta-clang-4f69b68228f75b6a3f2375a0258fd04f4f67ce70.tar.gz
clang: Fix llvm-link and opt dependency build failure in libomp
Update to latest 13.x as well * 9e41dc71b8d4 [docs] Mention that the legacy PM is deprecated and will be removed after 14 * 73c36a9be558 [OpenMP][FIX] Allow declare variant to work with reference types * bcb43617cb7f [NewPM] Add missing LTO ArgPromotion pass * 703ee975d26a [AlignFromAssume] Bailout w/non-constant alignments (pr51680) Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'recipes-devtools/clang/clang')
-rw-r--r--recipes-devtools/clang/clang/0037-Revert-libomptarget-amdcgn-Add-build-dependency-for-.patch23
-rw-r--r--recipes-devtools/clang/clang/D108404.diff58
-rw-r--r--recipes-devtools/clang/clang/D108868.diff47
3 files changed, 105 insertions, 23 deletions
diff --git a/recipes-devtools/clang/clang/0037-Revert-libomptarget-amdcgn-Add-build-dependency-for-.patch b/recipes-devtools/clang/clang/0037-Revert-libomptarget-amdcgn-Add-build-dependency-for-.patch
deleted file mode 100644
index 66463a2..0000000
--- a/recipes-devtools/clang/clang/0037-Revert-libomptarget-amdcgn-Add-build-dependency-for-.patch
+++ /dev/null
@@ -1,23 +0,0 @@
1From d23235c2b03957e6b1f55068808e33419896ee4d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 27 Aug 2021 16:45:24 -0700
4Subject: [PATCH] Revert "[libomptarget][amdcgn] Add build dependency for opt"
5
6This reverts commit ab2d8f0749745663d1f029ee4c88fbc492bef00f.
7---
8 openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt b/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
12index 4765d1989e52..8fec7dc6f17d 100644
13--- a/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
14+++ b/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
15@@ -157,7 +157,7 @@ foreach(mcpu ${mcpus})
16 add_custom_command(
17 OUTPUT ${bc_libname}
18 COMMAND ${LINK_TOOL} ${bc_files} | ${OPT_TOOL} --always-inline -o ${OUTPUTDIR}/${bc_libname}
19- DEPENDS ${bc_files} opt)
20+ DEPENDS ${bc_files})
21
22 add_custom_target(lib${libname}-${mcpu} ALL DEPENDS ${bc_libname})
23
diff --git a/recipes-devtools/clang/clang/D108404.diff b/recipes-devtools/clang/clang/D108404.diff
new file mode 100644
index 0000000..68d8ebc
--- /dev/null
+++ b/recipes-devtools/clang/clang/D108404.diff
@@ -0,0 +1,58 @@
1Backported from https://reviews.llvm.org/D108404
2
3diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
4--- a/llvm/runtimes/CMakeLists.txt
5+++ b/llvm/runtimes/CMakeLists.txt
6@@ -350,15 +350,19 @@
7 # Create a runtimes target that uses this file as its top-level CMake file.
8 # The runtimes target is a configuration of all the runtime libraries
9 # together in a single CMake invocaiton.
10+ if("openmp" IN_LIST LLVM_ENABLE_RUNTIMES)
11+ message(STATUS "Adding dependencies opt llvm-link")
12+ set(extra_deps opt llvm-link)
13+ endif()
14 if(NOT LLVM_RUNTIME_TARGETS)
15 runtime_default_target(
16- DEPENDS ${deps}
17+ DEPENDS ${deps} ${extra_deps}
18 PREFIXES ${prefixes})
19 set(test_targets check-runtimes)
20 else()
21 if("default" IN_LIST LLVM_RUNTIME_TARGETS)
22 runtime_default_target(
23- DEPENDS ${deps}
24+ DEPENDS ${deps} ${extra_deps}
25 PREFIXES ${prefixes})
26 list(REMOVE_ITEM LLVM_RUNTIME_TARGETS "default")
27 else()
28diff --git a/openmp/libomptarget/DeviceRTL/CMakeLists.txt b/openmp/libomptarget/DeviceRTL/CMakeLists.txt
29--- a/openmp/libomptarget/DeviceRTL/CMakeLists.txt
30+++ b/openmp/libomptarget/DeviceRTL/CMakeLists.txt
31@@ -151,6 +151,7 @@
32
33 # Create target to build all Bitcode libraries.
34 add_custom_target(omptarget-new-nvptx-bc)
35+add_dependencies(omptarget-new-nvptx-bc opt llvm-link)
36
37 # Generate a Bitcode library for all the compute capabilities the user requested
38 foreach(sm ${nvptx_sm_list})
39@@ -197,6 +198,7 @@
40
41 add_custom_target(${bclib_target_name} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${bclib_name}_opt)
42 add_dependencies(omptarget-new-nvptx-bc ${bclib_target_name})
43+ add_dependencies(${bclib_target_name} opt llvm-link)
44
45 # Copy library to destination.
46 add_custom_command(TARGET ${bclib_target_name} POST_BUILD
47diff --git a/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt b/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
48--- a/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
49+++ b/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
50@@ -157,7 +157,7 @@
51 add_custom_command(
52 OUTPUT ${bc_libname}
53 COMMAND ${LINK_TOOL} ${bc_files} | ${OPT_TOOL} --always-inline -o ${OUTPUTDIR}/${bc_libname}
54- DEPENDS ${bc_files} opt)
55+ DEPENDS ${bc_files} llvm-link opt)
56
57 add_custom_target(lib${libname}-${mcpu} ALL DEPENDS ${bc_libname})
58
diff --git a/recipes-devtools/clang/clang/D108868.diff b/recipes-devtools/clang/clang/D108868.diff
new file mode 100644
index 0000000..a12a3eb
--- /dev/null
+++ b/recipes-devtools/clang/clang/D108868.diff
@@ -0,0 +1,47 @@
1Backported from https://reviews.llvm.org/D108868
2
3--- a/llvm/runtimes/CMakeLists.txt
4+++ b/llvm/runtimes/CMakeLists.txt
5@@ -350,9 +350,14 @@ if(runtimes)
6 # Create a runtimes target that uses this file as its top-level CMake file.
7 # The runtimes target is a configuration of all the runtime libraries
8 # together in a single CMake invocaiton.
9+ set(extra_deps "")
10 if("openmp" IN_LIST LLVM_ENABLE_RUNTIMES)
11- message(STATUS "Adding dependencies opt llvm-link")
12- set(extra_deps opt llvm-link)
13+ if(TARGET opt)
14+ list(APPEND extra_deps opt)
15+ endif()
16+ if(TARGET llvm-link)
17+ list(APPEND extra_deps llvm-link)
18+ endif()
19 endif()
20 if(NOT LLVM_RUNTIME_TARGETS)
21 runtime_default_target(
22--- a/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
23+++ b/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
24@@ -149,6 +149,14 @@ endmacro()
25
26 set(libname "omptarget-amdgcn")
27
28+set(toolchain_deps "")
29+if(TARGET llvm-link)
30+ list(APPEND toolchain_deps llvm-link)
31+endif()
32+if(TARGET opt)
33+ list(APPEND toolchain_deps opt)
34+endif()
35+
36 foreach(mcpu ${mcpus})
37 set(bc_files)
38 add_cuda_bc_library(${cuda_sources})
39@@ -157,7 +165,7 @@ foreach(mcpu ${mcpus})
40 add_custom_command(
41 OUTPUT ${bc_libname}
42 COMMAND ${LINK_TOOL} ${bc_files} | ${OPT_TOOL} --always-inline -o ${OUTPUTDIR}/${bc_libname}
43- DEPENDS ${bc_files} llvm-link opt)
44+ DEPENDS ${bc_files} ${toolchain_deps})
45
46 add_custom_target(lib${libname}-${mcpu} ALL DEPENDS ${bc_libname})
47