1 |
commit: 1f254242a3cbefe3f657384c06de728191633a28 |
2 |
Author: Benda Xu <heroxbd <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Feb 6 17:24:02 2021 +0000 |
4 |
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Feb 6 17:26:15 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f254242 |
7 |
|
8 |
sys-devel/llvm-roc: set default device-libs. |
9 |
|
10 |
Disable HIP runtime check, it is not needed for Gentoo. |
11 |
|
12 |
Only the patch is updated, directly move 4.0.0-r1 to -r2. |
13 |
|
14 |
Closes: https://bugs.gentoo.org/769005 |
15 |
Package-Manager: Portage-3.0.12, Repoman-3.0.1 |
16 |
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org> |
17 |
|
18 |
.../files/llvm-roc-4.0.0-hip-location.patch | 39 +++++++++++++++++++++- |
19 |
...oc-4.0.0-r1.ebuild => llvm-roc-4.0.0-r2.ebuild} | 0 |
20 |
2 files changed, 38 insertions(+), 1 deletion(-) |
21 |
|
22 |
diff --git a/sys-devel/llvm-roc/files/llvm-roc-4.0.0-hip-location.patch b/sys-devel/llvm-roc/files/llvm-roc-4.0.0-hip-location.patch |
23 |
index 8342299f113..225adc70966 100644 |
24 |
--- a/sys-devel/llvm-roc/files/llvm-roc-4.0.0-hip-location.patch |
25 |
+++ b/sys-devel/llvm-roc/files/llvm-roc-4.0.0-hip-location.patch |
26 |
@@ -1,5 +1,7 @@ |
27 |
replace hardcoded hip finder with Gentoo paths. |
28 |
|
29 |
+It is not necessary to check HIP runtime each time. |
30 |
+ |
31 |
Author: Benda Xu <heroxbd@g.o> |
32 |
|
33 |
Index: llvm-project-rocm-4.0.0/clang/lib/Driver/ToolChains/AMDGPU.cpp |
34 |
@@ -12,7 +14,7 @@ Index: llvm-project-rocm-4.0.0/clang/lib/Driver/ToolChains/AMDGPU.cpp |
35 |
|
36 |
- // Try to find relative to the compiler binary. |
37 |
- const char *InstallDir = D.getInstalledDir(); |
38 |
-+ Candidates.emplace_back(D.SysRoot + "/usr/lib/hip", /*StrictChecking=*/true); |
39 |
++ Candidates.emplace_back(D.SysRoot + "/usr", /*StrictChecking=*/true); |
40 |
|
41 |
- // Check both a normal Unix prefix position of the clang binary, as well as |
42 |
- // the Windows-esque layout the ROCm packages use with the host architecture |
43 |
@@ -45,3 +47,38 @@ Index: llvm-project-rocm-4.0.0/clang/lib/Driver/ToolChains/AMDGPU.cpp |
44 |
return Candidates; |
45 |
} |
46 |
|
47 |
+@@ -273,33 +244,7 @@ void RocmInstallationDetector::detectDev |
48 |
+ } |
49 |
+ |
50 |
+ void RocmInstallationDetector::detectHIPRuntime() { |
51 |
+- auto Candidates = getInstallationPathCandidates(); |
52 |
+- auto &FS = D.getVFS(); |
53 |
+- |
54 |
+- for (const auto &Candidate : Candidates) { |
55 |
+- InstallPath = Candidate.Path; |
56 |
+- if (InstallPath.empty() || !FS.exists(InstallPath)) |
57 |
+- continue; |
58 |
+- |
59 |
+- BinPath = InstallPath; |
60 |
+- llvm::sys::path::append(BinPath, "bin"); |
61 |
+- IncludePath = InstallPath; |
62 |
+- llvm::sys::path::append(IncludePath, "include"); |
63 |
+- LibPath = InstallPath; |
64 |
+- llvm::sys::path::append(LibPath, "lib"); |
65 |
+- |
66 |
+- llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> VersionFile = |
67 |
+- FS.getBufferForFile(BinPath + "/.hipVersion"); |
68 |
+- if (!VersionFile && Candidate.StrictChecking) |
69 |
+- continue; |
70 |
+- |
71 |
+- if (HIPVersionArg.empty() && VersionFile) |
72 |
+- ParseHIPVersionFile((*VersionFile)->getBuffer()); |
73 |
+- |
74 |
+- HasHIPRuntime = true; |
75 |
+- return; |
76 |
+- } |
77 |
+- HasHIPRuntime = false; |
78 |
++ HasHIPRuntime = true; |
79 |
+ } |
80 |
+ |
81 |
+ void RocmInstallationDetector::print(raw_ostream &OS) const { |
82 |
|
83 |
diff --git a/sys-devel/llvm-roc/llvm-roc-4.0.0-r1.ebuild b/sys-devel/llvm-roc/llvm-roc-4.0.0-r2.ebuild |
84 |
similarity index 100% |
85 |
rename from sys-devel/llvm-roc/llvm-roc-4.0.0-r1.ebuild |
86 |
rename to sys-devel/llvm-roc/llvm-roc-4.0.0-r2.ebuild |