[clang] [LinkerWrapper] Use the correct empty file on Windows (PR #84322)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 7 05:50:42 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Joseph Huber (jhuber6)
<details>
<summary>Changes</summary>
Summary:
The clang-offload-bundler uses an empty file to control the bundles made
for embedding. Previously this still used `/dev/null` by mistake even on
Windows.
---
Full diff: https://github.com/llvm/llvm-project/pull/84322.diff
1 Files Affected:
- (modified) clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp (+4-1)
``````````diff
diff --git a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
index 576e8f2cd7f8fd..849b12e1e8c6fc 100644
--- a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+++ b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
@@ -410,7 +410,10 @@ fatbinary(ArrayRef<std::pair<StringRef, StringRef>> InputFiles,
Targets.push_back(Saver.save("hipv4-amdgcn-amd-amdhsa--" + Arch));
CmdArgs.push_back(Saver.save(llvm::join(Targets, ",")));
- CmdArgs.push_back("-input=/dev/null");
+ if (Triple.isOSWindows())
+ CmdArgs.push_back("-input=NUL");
+ else
+ CmdArgs.push_back("-input=/dev/null");
for (const auto &[File, Arch] : InputFiles)
CmdArgs.push_back(Saver.save("-input=" + File));
``````````
</details>
https://github.com/llvm/llvm-project/pull/84322
More information about the cfe-commits
mailing list