summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-ar
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-ar] Implement the P modifier.Jordan Rupprecht2019-02-142-2/+118
| | | | | | | | | | | | | | | | | | | Summary: GNU ar has a `P` modifier that changes filename comparisons to use full paths instead of the basename. As noted in the GNU docs, regular archives are not created with full path names, so P is used to deal with archives created by other archive programs (e.g. see the updated `absolute-paths.test` test case). Since thin archives use full path names -- paths are relative to the archive -- it seems very error prone to not imply P when dealing with thin archives, so P is implied in those cases. (I think this is a deviation from GNU ar that makes sense). This fixes PR37436 via https://github.com/ClangBuiltLinux/linux/issues/33. Reviewers: mstorsjo, pcc, ruiu, davide, david2050, rnk Subscribers: tpimh, llvm-commits, nickdesaulniers Tags: #llvm Differential Revision: https://reviews.llvm.org/D57927 llvm-svn: 354044
* [llvm-ar][libObject] Fix relative paths when nesting thin archives.Jordan Rupprecht2019-02-132-1/+16
| | | | | | | | | | | | | | | | | | | | | Summary: When adding one thin archive to another, we currently chop off the relative path to the flattened members. For instance, when adding `foo/child.a` (which contains `x.txt`) to `parent.a`, when flattening it we should add it as `foo/x.txt` (which exists) instead of `x.txt` (which does not exist). As a note, this also undoes the `IsNew` parameter of handling relative paths in r288280. The unit test there still passes. This was reported as part of testing the kernel build with llvm-ar: https://patchwork.kernel.org/patch/10767545/ (see the second point). Reviewers: mstorsjo, pcc, ruiu, davide, david2050, inglorion Reviewed By: ruiu Subscribers: void, jdoerfert, tpimh, mgorny, hans, nickdesaulniers, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D57842 llvm-svn: 353995
* Revert r353424 "[llvm-ar][libObject] Fix relative paths when nesting thin ↵Hans Wennborg2019-02-082-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | archives." This broke the Chromium build on Windows, see https://crbug.com/930058 > Summary: > When adding one thin archive to another, we currently chop off the relative path to the flattened members. For instance, when adding `foo/child.a` (which contains `x.txt`) to `parent.a`, whe > lattening it we should add it as `foo/x.txt` (which exists) instead of `x.txt` (which does not exist). > > As a note, this also undoes the `IsNew` parameter of handling relative paths in r288280. The unit test there still passes. > > This was reported as part of testing the kernel build with llvm-ar: https://patchwork.kernel.org/patch/10767545/ (see the second point). > > Reviewers: mstorsjo, pcc, ruiu, davide, david2050 > > Subscribers: hiraditya, llvm-commits > > Tags: #llvm > > Differential Revision: https://reviews.llvm.org/D57842 This reverts commit bf990ab5aab03aa0aac53c9ef47ef264307804ed. llvm-svn: 353507
* [llvm-ar][libObject] Fix relative paths when nesting thin archives.Jordan Rupprecht2019-02-072-1/+16
| | | | | | | | | | | | | | | | | | | Summary: When adding one thin archive to another, we currently chop off the relative path to the flattened members. For instance, when adding `foo/child.a` (which contains `x.txt`) to `parent.a`, when flattening it we should add it as `foo/x.txt` (which exists) instead of `x.txt` (which does not exist). As a note, this also undoes the `IsNew` parameter of handling relative paths in r288280. The unit test there still passes. This was reported as part of testing the kernel build with llvm-ar: https://patchwork.kernel.org/patch/10767545/ (see the second point). Reviewers: mstorsjo, pcc, ruiu, davide, david2050 Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D57842 llvm-svn: 353424
* [llvm-ar] Remove leading slash when printing thin archive membersJordan Rupprecht2019-02-061-0/+10
| | | | | | | | | | | | Reviewers: ruiu Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D57845 llvm-svn: 353347
* [llvm-ar] Resubmit recursive thin archive test with fix for full path names ↵Jordan Rupprecht2019-01-151-0/+13
| | | | | | and better error messages llvm-svn: 351256
* [llvm-ar] Temporarily remove failing test which is breaking buildbotsJordan Rupprecht2019-01-141-13/+0
| | | | llvm-svn: 351126
* [llvm-ar] Flatten thin archives.Jordan Rupprecht2019-01-148-0/+48
| | | | | | | | | | | | | | | | | | | | | | Summary: Normal behavior for GNU ar is to flatten thin archives when adding them to another thin archive, i.e. add the members directly instead of nesting the archive. Some refactoring done as part of this patch to ease things: - Consolidate `addMember`/`addLibMember` methods - Rename `addMember` to `addChildMember` to make it more visibly different at the call site that an archive child is passed instead of a regular member - Pass in a separate vector and splice it back into position instead of passing a vector + optional Pos (which makes expanding libs tricky) This fixes PR37530 as raised by https://github.com/ClangBuiltLinux/linux/issues/279. Reviewers: mstorsjo, pcc, ruiu Reviewed By: mstorsjo Subscribers: llvm-commits, tpimh, nickdesaulniers Differential Revision: https://reviews.llvm.org/D56508 llvm-svn: 351120
* [llvm-ar] Access ADDLIB in llvm-ar via command lineOwen Reynolds2018-10-264-0/+133
| | | | | | | | | | ADDLIB is called to add the contents of an archive to another archive. Previously this was only accessible through the use of an MRI script. With the use of a new "L" modifier, archive files can treated in the manner above when using quick append. llvm-svn: 345383
* [llvm-ar] Use POSIX-specified timestamps for 'tv'.Jordan Rupprecht2018-10-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The POSIX spec says: ``` If the −t option is used with the −v option, the standard output format shall be: "%s %u/%u %u %s %d %d:%d %d %s\n", <member mode>, <user ID>, <group ID>, <number of bytes in member>, <abbreviated month>, <day-of-month>, <hour>, <minute>, <year>, <file> where: ... <abbreviated month> Equivalent to the format of the %b conversion specification format in date. <day-of-month> Equivalent to the format of the %e conversion specification format in date. <hour> Equivalent to the format of the %H conversion specification format in date. <minute> Equivalent to the format of the %M conversion specification format in date. <year> Equivalent to the format of the %Y conversion specification format in date. ``` This actually used to be the format printed by llvm-ar. It was apparently accidentally changed (see r207385 followed by comments in r207387). This makes it conform to GNU ar for easier replacement. Reviewers: MaskRay Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52940 llvm-svn: 343901
* [llvm-ar] Support * as comment char in MRI scriptsMartin Storsjo2018-09-061-3/+9
| | | | | | | | | | | | MRI scripts have two comment chars, * and ;, but only the latter was supported before. Also allow leading spaces before comment chars (and before any command string), and allow comments after a command. Differential Revision: https://reviews.llvm.org/D51338 llvm-svn: 341571
* [llvm-ar] Fix help text test. NFC.Ben Dunbobbin2018-08-021-1/+1
| | | | | | Missed from @338703 llvm-svn: 338709
* [COFF] Adjust how we flag weak externalsMartin Storsjo2018-07-201-0/+53
| | | | | | | | | | This fixes PR36096. Originally based on a patch by Martell Malone. Differential Revision: https://reviews.llvm.org/D44357 llvm-svn: 337613
* [llvm-ar] Temporarily make the tool case detection test Windows-only to fix ↵Alexandre Ganea2018-04-101-0/+1
| | | | | | the build (introduced in r329658) llvm-svn: 329683
* [llvm-ar] Fix lib.exe detection when running within MSVC toolchainAlexandre Ganea2018-04-101-0/+11
| | | | | | Differential Revision: https://reviews.llvm.org/D44808 llvm-svn: 329658
* [llvm-ar] Support multiple dashed optionsPeter Collingbourne2018-03-281-0/+16
| | | | | | | | | | | | | | | This allows syntax like: $ llvm-ar -c -r -u file.a file.o This is in addition to the other formats that are already supported: $ llvm-ar cru file.a file.o $ llvm-ar -cru file.a file.o Patch by Tom Anderson! Differential Revision: https://reviews.llvm.org/D44452 llvm-svn: 328716
* On Windows expansion of regex file name patterns is the responsibility of eachDmitry Mikulin2018-03-051-0/+7
| | | | | | | | tool. Fix ar to do that. Differential Revision: https://reviews.llvm.org/D43987 llvm-svn: 326734
* Implementation of MRI "delete" command.Dmitry Mikulin2018-03-021-0/+14
| | | | | | Differential Revision: https://reviews.llvm.org/D43989 llvm-svn: 326636
* [llvm-ar] Support an options string that start with a dashMartin Storsjo2017-11-031-1/+2
| | | | | | | | Some projects call $AR like "$AR -crs output input1 input2". Differential Revision: https://reviews.llvm.org/D39538 llvm-svn: 317358
* Don't call exit from cl::PrintHelpMessage.Rafael Espindola2017-09-071-0/+1
| | | | | | | | | Most callers were not expecting the exit(0) and trying to exit with a different value. This also adds back the call to cl::PrintHelpMessage in llvm-ar. llvm-svn: 312761
* llvm-ar: exit with 1 if there is an error.Rafael Espindola2017-09-071-0/+4
| | | | | | This is pr34396. llvm-svn: 312752
* Fix binary static archive that got mangled by patchReid Kleckner2017-03-311-0/+0
| | | | llvm-svn: 299265
* [llvm-ar] Extract objects to their basename in the CWDReid Kleckner2017-03-312-0/+20
| | | | | | | This is helpful when extracting objects from archives produced by MSVC's lib.exe, which users absolute paths to describe the archive members. llvm-svn: 299264
* test: relax the match on the timestampSaleem Abdulrasool2016-07-051-1/+1
| | | | llvm-svn: 274529
* Object: support empty UID/GID fieldsSaleem Abdulrasool2016-07-052-0/+5
| | | | | | | | | Normal archives do not have empty UID/GID fields. However, the Microsoft Import library format is a customized archive (it just uses an alternate symbol index format). When the import library is constructed by lib.exe, the UID and GID fields are left empty. Do not abort on such an input. llvm-svn: 274528
* [yaml2obj] Remove --format option in favor of YAML tagsChris Bieneman2016-06-277-8/+8
| | | | | | | | | | | | | | | | | | | | | | Summary: Our YAML library's handling of tags isn't perfect, but it is good enough to get rid of the need for the --format argument to yaml2obj. This patch does exactly that. Instead of requiring --format, it infers the format based on the tags found in the object file. The supported tags are: !ELF !COFF !mach-o !fat-mach-o I have a corresponding patch that is quite large that fixes up all the in-tree test cases. Reviewers: rafael, Bigcheese, compnerd, silvas Subscribers: compnerd, llvm-commits Differential Revision: http://reviews.llvm.org/D21711 llvm-svn: 273915
* llvm-ar: add some tests for llvm-ar default selectionSaleem Abdulrasool2016-06-258-0/+179
This adds some tests for the smarter llvm-ar selection mode as well as some additional tests as per Rafael's post commit review comments. llvm-svn: 273768
OpenPOWER on IntegriCloud