Files
gentoo/dev-libs/rocm-comgr/files/rocm-comgr-6.4.1-bypass-device-libs-copy.patch
Sv. Lockal 8acc0557b2 dev-libs/rocm-comgr: add 6.4.1
Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/42554
Signed-off-by: Sam James <sam@gentoo.org>
2025-06-14 23:36:57 +01:00

45 lines
1.6 KiB
Diff

comgr does unnecessary heavy-lifting trying to fill `--rocm-path=` with something.
However default value is already good, and custom code searches clang in a wrong directory.
--- a/src/comgr-compiler.cpp
+++ b/src/comgr-compiler.cpp
@@ -1060,39 +1060,6 @@ amd_comgr_status_t AMDGPUCompiler::addCompilationFlags() {
amd_comgr_status_t AMDGPUCompiler::addDeviceLibraries() {
NoGpuLib = false;
-
- SmallString<256> ClangBinaryPath(env::getLLVMPath());
- sys::path::append(ClangBinaryPath, "bin", "clang");
-
- std::string ClangResourceDir = Driver::GetResourcesPath(ClangBinaryPath);
-
- SmallString<256> DeviceLibPath(ClangResourceDir);
- sys::path::append(DeviceLibPath, "lib");
-
- SmallString<256> DeviceCodeDir(DeviceLibPath);
- sys::path::append(DeviceCodeDir, "amdgcn", "bitcode");
-
- if (llvm::sys::fs::exists(DeviceCodeDir)) {
- Args.push_back(Saver.save(Twine("--rocm-path=") + DeviceLibPath).data());
- } else {
- llvm::SmallString<128> FakeRocmDir = TmpDir;
- path::append(FakeRocmDir, "rocm");
- llvm::SmallString<128> DeviceLibsDir = FakeRocmDir;
- path::append(DeviceLibsDir, "amdgcn", "bitcode");
- if (fs::create_directory(InputDir)) {
- return AMD_COMGR_STATUS_ERROR;
- }
- Args.push_back(Saver.save(Twine("--rocm-path=") + FakeRocmDir).data());
-
- for (auto DeviceLib : getDeviceLibraries()) {
- llvm::SmallString<128> DeviceLibPath = DeviceLibsDir;
- path::append(DeviceLibPath, std::get<0>(DeviceLib));
- if (auto Status = outputToFile(std::get<1>(DeviceLib), DeviceLibPath)) {
- return Status;
- }
- }
- }
-
return AMD_COMGR_STATUS_SUCCESS;
}