[lld] [lld][COFF] Add /linkreprofullpathrsp flag (PR #165449)
David Truby via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 18 07:14:18 PST 2025
================
@@ -318,11 +318,31 @@ void LinkerDriver::addBuffer(std::unique_ptr<MemoryBuffer> mb,
}
}
-void LinkerDriver::enqueuePath(StringRef path, bool wholeArchive, bool lazy) {
+void LinkerDriver::handleReproFile(StringRef path, InputType inputType) {
+ if (!reproFile)
+ return;
+
+ *reproFile << '"';
+ if (inputType == InputType::DefaultLib)
+ *reproFile << "/defaultlib:";
+ else if (inputType == InputType::WholeArchive)
+ *reproFile << "/wholearchive:";
+
+ SmallString<128> absPath = path;
+ std::error_code ec = sys::fs::make_absolute(absPath);
+ if (ec)
+ Err(ctx) << "cannot find absolute path for reproFile for " << absPath
+ << ": " << ec.message();
+ sys::path::remove_dots(absPath, true);
+ *reproFile << absPath << "\"\n";
+ reproFile->flush();
----------------
DavidTruby wrote:
This flush appears to be necessary on Windows, for some reason. I can't really work out why, as the raw_fd_ostream should be flushed in its destructor anyway. Does anyone have any insight on this?
https://github.com/llvm/llvm-project/pull/165449
More information about the llvm-commits
mailing list