This is a fix for Bugzilla 28579.
The problem is that in --reproduce links the file path in -o option is copied verbatim. When "lld @response.txt" link is run against the extracted test case, if -o contains anything other that a plain file name, the link will likely fail because the target directory in -o may not exists. Stripping the directory path will create the output file in the top level test directory.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Please upload this patch with context git diff -U9999999 (or the equivalent svn command).
Comment Actions
I think this is the right direction. The alternative would be to create the intermediate directories in the archive we're building, but that seems more complicated for pretty much no additional benefit.
Rui, what do you think? Also, make sure this works on Windows (it should just fine, but better making sure to avoid failures on the bots).
Comment Actions
This bit me a few times, so I think this is a good addition. Thank you for doing this!
ELF/DriverUtils.cpp | ||
---|---|---|
139 | Since we know it is "-o", OS << "-o " << is more straightforward. Please add a comment why you are stripping directory parts from a path. // If an output path contains directories, "lld @response.txt" will likely // to fail because the archive we are creating doesn't contain empty // directories for the output path (-o doesn't create directories). // Strip directories to prevent the issue. |
Since we know it is "-o", OS << "-o " << is more straightforward.
Please add a comment why you are stripping directory parts from a path.