mirror of
https://git.proxmox.com/git/llvm-toolchain
synced 2025-08-07 08:01:02 +00:00
Add Debian paths for rocm-device-libs to search list
This commit is contained in:
parent
020513f616
commit
8bbef94305
3
debian/changelog
vendored
3
debian/changelog
vendored
@ -14,7 +14,8 @@ llvm-toolchain-15 (1:15.0.7-2) UNRELEASED; urgency=medium
|
|||||||
* Don't run chrpath for libclang on powerpc and powerpcspe
|
* Don't run chrpath for libclang on powerpc and powerpcspe
|
||||||
|
|
||||||
[ Cordell Bloor ]
|
[ Cordell Bloor ]
|
||||||
* Backport support for HIP in /usr
|
* Backport support for HIP in /usr and add Debian paths
|
||||||
|
for rocm-device-libs to search list (Closes: #1031808)
|
||||||
|
|
||||||
-- Sylvestre Ledru <sylvestre@debian.org> Sun, 15 Jan 2023 10:54:41 +0100
|
-- Sylvestre Ledru <sylvestre@debian.org> Sun, 15 Jan 2023 10:54:41 +0100
|
||||||
|
|
||||||
|
60
debian/patches/amdgpu-bitcode-multiarch.patch
vendored
Normal file
60
debian/patches/amdgpu-bitcode-multiarch.patch
vendored
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
From efa9394d72968e0c84c2c9283476c70807f60b80 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Cordell Bloor <cgmb@slerp.xyz>
|
||||||
|
Date: Wed, 8 Mar 2023 02:57:51 -0700
|
||||||
|
Subject: [PATCH] Search for the bitcode libraries in a multiarch directory
|
||||||
|
|
||||||
|
The Debian path for the rocm-device-libs is
|
||||||
|
/usr/lib/$(DEB_HOST_MULTIARCH)/amdgcn/bitcode
|
||||||
|
|
||||||
|
Forwarded: not-needed
|
||||||
|
---
|
||||||
|
clang/lib/Driver/ToolChains/AMDGPU.cpp | 19 +++++++++++++------
|
||||||
|
1 file changed, 13 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/clang/lib/Driver/ToolChains/AMDGPU.cpp b/clang/lib/Driver/ToolChains/AMDGPU.cpp
|
||||||
|
index f20b28a66c67..2e8e56b39ff6 100644
|
||||||
|
--- a/clang/lib/Driver/ToolChains/AMDGPU.cpp
|
||||||
|
+++ b/clang/lib/Driver/ToolChains/AMDGPU.cpp
|
||||||
|
@@ -14,9 +14,11 @@
|
||||||
|
#include "clang/Driver/DriverDiagnostic.h"
|
||||||
|
#include "clang/Driver/InputInfo.h"
|
||||||
|
#include "clang/Driver/Options.h"
|
||||||
|
+#include "llvm/ADT/Triple.h"
|
||||||
|
#include "llvm/Option/ArgList.h"
|
||||||
|
#include "llvm/Support/Error.h"
|
||||||
|
#include "llvm/Support/FileUtilities.h"
|
||||||
|
+#include "llvm/Support/Host.h"
|
||||||
|
#include "llvm/Support/LineIterator.h"
|
||||||
|
#include "llvm/Support/Path.h"
|
||||||
|
#include "llvm/Support/VirtualFileSystem.h"
|
||||||
|
@@ -422,16 +424,21 @@ void RocmInstallationDetector::detectDeviceLibrary() {
|
||||||
|
// The possible structures are:
|
||||||
|
// - ${ROCM_ROOT}/amdgcn/bitcode/*
|
||||||
|
// - ${ROCM_ROOT}/lib/*
|
||||||
|
+ // - ${ROCM_ROOT}/lib/<multiarch>/amdgcn/bitcode/*
|
||||||
|
// - ${ROCM_ROOT}/lib/bitcode/*
|
||||||
|
- // so try to detect these layouts.
|
||||||
|
- static constexpr std::array<const char *, 2> SubDirsList[] = {
|
||||||
|
- {"amdgcn", "bitcode"},
|
||||||
|
- {"lib", ""},
|
||||||
|
- {"lib", "bitcode"},
|
||||||
|
+ // so try to detect these layouts. Note that bitcode is associated with the
|
||||||
|
+ // compiler that built it (not the target architecture).
|
||||||
|
+ llvm::Triple HostTriple(llvm::sys::getProcessTriple());
|
||||||
|
+ std::string Multiarch = Twine(HostTriple.getArchName() + "-linux-gnu").str();
|
||||||
|
+ static const std::array<std::string, 4> SubDirsList[] = {
|
||||||
|
+ {"amdgcn", "bitcode", "", ""},
|
||||||
|
+ {"lib", "", "", ""},
|
||||||
|
+ {"lib", Multiarch, "amdgcn", "bitcode"},
|
||||||
|
+ {"lib", "bitcode", "", ""},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Make a path by appending sub-directories to InstallPath.
|
||||||
|
- auto MakePath = [&](const llvm::ArrayRef<const char *> &SubDirs) {
|
||||||
|
+ auto MakePath = [&](const llvm::ArrayRef<std::string> &SubDirs) {
|
||||||
|
auto Path = CandidatePath;
|
||||||
|
for (auto SubDir : SubDirs)
|
||||||
|
llvm::sys::path::append(Path, SubDir);
|
||||||
|
--
|
||||||
|
2.39.2
|
||||||
|
|
1
debian/patches/series
vendored
1
debian/patches/series
vendored
@ -161,3 +161,4 @@ link-grpc.diff
|
|||||||
|
|
||||||
amdgpu-nonlinux.patch
|
amdgpu-nonlinux.patch
|
||||||
amdgpu-usr-search-paths.patch
|
amdgpu-usr-search-paths.patch
|
||||||
|
amdgpu-bitcode-multiarch.patch
|
||||||
|
Loading…
Reference in New Issue
Block a user