]> granicus.if.org Git - llvm/commit
[llvm-ar] Implement the P modifier.
authorJordan Rupprecht <rupprecht@google.com>
Thu, 14 Feb 2019 18:35:13 +0000 (18:35 +0000)
committerJordan Rupprecht <rupprecht@google.com>
Thu, 14 Feb 2019 18:35:13 +0000 (18:35 +0000)
commit2c8ca87c565164d8f9554b650e0e9c7021fd88fc
tree746c029e3d5fdcbc5e20456fc8df31000710a858
parent08804a7b3694e04a44ed78ee1014622dc29dc134
[llvm-ar] Implement the P modifier.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354044 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-ar/absolute-paths.test
test/tools/llvm-ar/full-path-option.test [new file with mode: 0644]
tools/llvm-ar/llvm-ar.cpp