From 1ec9b7d4bb0cce7a501686733565b0221ee1db69 Mon Sep 17 00:00:00 2001 From: Benda Xu Date: Tue, 19 Jan 2021 22:34:10 +0800 Subject: sys-devel/llvm-roc: replace HIP finder with Gentoo paths. remove isystem include path. Set USE=runtime as default. Suggested-by: Yiyang Wu Suggested-by: Wilfried Holzke Reference: https://github.com/justxi/rocm/issues/174#issuecomment-749479598 Package-Manager: Portage-3.0.12, Repoman-3.0.1 Signed-off-by: Benda Xu --- .../files/llvm-roc-4.0.0-hip-location.patch | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 sys-devel/llvm-roc/files/llvm-roc-4.0.0-hip-location.patch (limited to 'sys-devel/llvm-roc/files/llvm-roc-4.0.0-hip-location.patch') 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 new file mode 100644 index 000000000000..8342299f1139 --- /dev/null +++ b/sys-devel/llvm-roc/files/llvm-roc-4.0.0-hip-location.patch @@ -0,0 +1,47 @@ +replace hardcoded hip finder with Gentoo paths. + +Author: Benda Xu + +Index: llvm-project-rocm-4.0.0/clang/lib/Driver/ToolChains/AMDGPU.cpp +=================================================================== +--- llvm-project-rocm-4.0.0.orig/clang/lib/Driver/ToolChains/AMDGPU.cpp ++++ llvm-project-rocm-4.0.0/clang/lib/Driver/ToolChains/AMDGPU.cpp +@@ -116,37 +116,8 @@ RocmInstallationDetector::getInstallatio + return Candidates; + } + +- // Try to find relative to the compiler binary. +- const char *InstallDir = D.getInstalledDir(); ++ Candidates.emplace_back(D.SysRoot + "/usr/lib/hip", /*StrictChecking=*/true); + +- // Check both a normal Unix prefix position of the clang binary, as well as +- // the Windows-esque layout the ROCm packages use with the host architecture +- // subdirectory of bin. +- +- // Strip off directory (usually bin) +- StringRef ParentDir = llvm::sys::path::parent_path(InstallDir); +- StringRef ParentName = llvm::sys::path::filename(ParentDir); +- +- // Some builds use bin/{host arch}, so go up again. +- if (ParentName == "bin") { +- ParentDir = llvm::sys::path::parent_path(ParentDir); +- ParentName = llvm::sys::path::filename(ParentDir); +- } +- +- // Some versions of the rocm llvm package install to /opt/rocm/llvm/bin +- if (ParentName == "llvm") +- ParentDir = llvm::sys::path::parent_path(ParentDir); +- +- Candidates.emplace_back(ParentDir.str(), /*StrictChecking=*/true); +- +- // Device library may be installed in clang resource directory. +- Candidates.emplace_back(D.ResourceDir, /*StrictChecking=*/true); +- +- Candidates.emplace_back(D.SysRoot + "/opt/rocm", /*StrictChecking=*/true); +- if (ParentName.startswith("aomp")) { +- // Some versions of the aomp package install to /opt/rocm/aomp/bin +- Candidates.emplace_back(ParentDir.str()); +- } + return Candidates; + } + -- cgit v1.2.3-65-gdbad