summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/TarWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* TarWriter: Fix a bug in Ustar header.Rui Ueyama2017-01-091-1/+1
| | | | | | | | | | If we split a filename into `Name` and `Prefix`, `Prefix` is at most 145 bytes. We had a bug that didn't split a path correctly. This bug was pointed out by Rafael in the post commit review. This patch adds a unit test for TarWriter to verify the fix. llvm-svn: 291494
* TarWriter: Set "00" to Ustar version field.Rui Ueyama2017-01-091-5/+10
| | | | | | | | Most (maybe all?) tar commands can handle tar archives with blank version fields, but POSIX requires "00" to be set to the field, so doing it is good for compliance. llvm-svn: 291479
* Define sys::path::convert_to_slashRui Ueyama2017-01-091-10/+2
| | | | | | | | This patch moves convertToUnixPathSeparator from LLD to LLVM. Differential Revision: https://reviews.llvm.org/D28444 llvm-svn: 291414
* TarWriter: Use fitsInUstar function.Rui Ueyama2017-01-071-2/+2
| | | | | | This change should have been commit as part of r291340. llvm-svn: 291341
* TarWriter: Use Ustar header's "prefix" field to store long filenames.Rui Ueyama2017-01-071-1/+27
| | | | | | | | | | | | Tar's Ustar header has the "prefix" field to store a directory part of a filename. It is not as flexible as the PAX-extended filename because there's still a limitation on the maximum filename size, but it mitigates the situation. This patch should unbreak some Windows buildbots that uses very old tar command. llvm-svn: 291340
* Use %z for size_t and avoid deprecated string functionsReid Kleckner2017-01-061-4/+4
| | | | | | | | This usage of strcpy and snprintf was certainly safe, but using them sets off various deprecation and lint warnings. Easier to just write the belt and suspenders version. llvm-svn: 291256
* TarWriter: Emit PAX headers only when needed.Rui Ueyama2017-01-061-23/+20
| | | | | | | | We use PAX headers to store long filenames (>= 100 bytes). It is not needed to emit PAX headers if filenames fit in the Ustar header. This patch implements that optimization. llvm-svn: 291215
* Add a class to create a tar archive file.Rui Ueyama2017-01-061-0/+169
In LLD, we create cpio archive files for --reproduce command. cpio was not a bad choice because it is very easy to create, but it was sometimes hard to use because people are not familiar with cpio command. I noticed that creating a tar archive isn't as hard as I thought. So I implemented it in this patch. Differential Revision: https://reviews.llvm.org/D28091 llvm-svn: 291209
OpenPOWER on IntegriCloud