mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-24 04:26:07 +00:00
[ELF] openAuxiliaryFile: open /dev/null if disableOutput and filename is "-"
So that LLD_IN_TEST=2 ld.lld --print-archive-stats=- a.o (and -Map -) only writes the output once.
This commit is contained in:
parent
6b87f01aaa
commit
a9e92beb25
@ -105,6 +105,13 @@ llvm::raw_fd_ostream Ctx::openAuxiliaryFile(llvm::StringRef filename,
|
||||
using namespace llvm::sys::fs;
|
||||
OpenFlags flags =
|
||||
auxiliaryFiles.insert(filename).second ? OF_None : OF_Append;
|
||||
if (e.disableOutput && filename == "-") {
|
||||
#ifdef _WIN32
|
||||
filename = "NUL";
|
||||
#else
|
||||
filename = "/dev/null";
|
||||
#endif
|
||||
}
|
||||
return {filename, ec, flags};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user