[clang] a213df5 - [LinkerWrapper] Use the correct empty file on Windows (#84322)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 7 07:45:19 PST 2024
Author: Joseph Huber
Date: 2024-03-07T09:45:14-06:00
New Revision: a213df5d3895f323ef0d2d9affc1020414576caa
URL: https://github.com/llvm/llvm-project/commit/a213df5d3895f323ef0d2d9affc1020414576caa
DIFF: https://github.com/llvm/llvm-project/commit/a213df5d3895f323ef0d2d9affc1020414576caa.diff
LOG: [LinkerWrapper] Use the correct empty file on Windows (#84322)
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.
Added:
Modified:
clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
Removed:
################################################################################
diff --git a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
index 576e8f2cd7f8fd..0a783db8962ba7 100644
--- a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+++ b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
@@ -410,7 +410,11 @@ 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, ",")));
+#ifdef _WIN32
+ CmdArgs.push_back("-input=NUL");
+#else
CmdArgs.push_back("-input=/dev/null");
+#endif
for (const auto &[File, Arch] : InputFiles)
CmdArgs.push_back(Saver.save("-input=" + File));
More information about the cfe-commits
mailing list