Skip to content

Commit 5b56e40

Browse files
committed
[clang-linker-wrapper] Pass on --cuda-path to child clang processes
When using clang-linker-wrapper with --cuda-path, it does not get passed on to the child device linking processes. This causes it to fail when cuda linking is involved and nvlink is not in $PATH. This patch lets the child linking process find nvlink through --cuda-path.
1 parent 6ac286c commit 5b56e40

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,8 @@ Expected<StringRef> clang(ArrayRef<StringRef> InputFiles, const ArgList &Args,
567567
CmdArgs.append({"-Xlinker", Args.MakeArgString(Arg)});
568568
for (StringRef Arg : Args.getAllArgValues(OPT_compiler_arg_EQ))
569569
CmdArgs.push_back(Args.MakeArgString(Arg));
570+
for (StringRef Arg : Args.getAllArgValues(OPT_cuda_path_EQ))
571+
CmdArgs.push_back(Args.MakeArgString("--cuda-path=" + Arg));
570572

571573
if (Error Err = executeCommands(*ClangPath, CmdArgs))
572574
return std::move(Err);

0 commit comments

Comments
 (0)