-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[HIP] Remove dots in HIP runtime path #143792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: Siu Chi Chan (scchan) ChangesRemove the dots in the HIP path before passing to the rpath flag Full diff: https://github.com/llvm/llvm-project/pull/143792.diff 1 Files Affected:
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");
}
|
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
4519fba to
9c60ee7
Compare
Remove the dots in the HIP path before passing to the rpath flag
9c60ee7 to
62e627e
Compare
| {"-rpath", Args.MakeArgString(RocmInstallation->getLibPath())}); | ||
| options::OPT_fno_rtlib_add_rpath, false)) { | ||
| SmallString<0> p = RocmInstallation->getLibPath(); | ||
| llvm::sys::path::remove_dots(p, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so far the preferred style is like remove_dots(p, /*remove_dot_dot=*/ true);
Remove the dots in the HIP path before passing to the rpath flag
Remove the dots in the HIP path before passing to the rpath flag