https://github.com/scchan created 
https://github.com/llvm/llvm-project/pull/143792

Remove the dots in the HIP path before passing to the rpath flag

>From 4519fbaec265c0b927e235516c72869cf128aa62 Mon Sep 17 00:00:00 2001
From: Siu Chi Chan <siuchi.c...@amd.com>
Date: Wed, 11 Jun 2025 17:18:42 -0400
Subject: [PATCH] [HIP] Remove dots in HIP runtime path Remove the dots in the
 HIP path before passing to the rpath flag

---
 clang/lib/Driver/ToolChains/Linux.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Linux.cpp 
b/clang/lib/Driver/ToolChains/Linux.cpp
index 151b2bfced818..9bfe3a9346efa 100644
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
@@ -743,9 +743,12 @@ void Linux::AddHIPRuntimeLibArgs(const ArgList &Args,
       Args.MakeArgString(StringRef("-L") + RocmInstallation->getLibPath()));
 
   if (Args.hasFlag(options::OPT_frtlib_add_rpath,
-                   options::OPT_fno_rtlib_add_rpath, false))
+                   options::OPT_fno_rtlib_add_rpath, false)) {
+    SmallString<0> p = RocmInstallation->getLibPath();
+    llvm::sys::path::remove_dots(p);
     CmdArgs.append(
-        {"-rpath", Args.MakeArgString(RocmInstallation->getLibPath())});
+        {"-rpath", Args.MakeArgString(p)});
+  }
 
   CmdArgs.push_back("-lamdhip64");
 }

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to