[PATCH] D57927: [llvm-ar] Implement the P modifier.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 7 14:37:42 PST 2019


ruiu added a comment.

I played with ar and found that the following behavior is pretty odd.

Create an archive
=================

$ mkdir x
$ echo 123 > x/foo.txt
$ ar rcS archive.a x/foo.txt

Directory name is not stored to archive.a
=========================================

$ cat archive.a
!<arch>
foo.txt/        0           0     0     644     4         `
123

But you can extract foo.txt with any directory name
===================================================

$ ar x archive.a bar/foo.txt
$ cat foo.txt
123

If I understand correctly, `ar` by default ignores directory names in many situations like the above, and "P" flag is to make it to not ignore directory names in a pathname. It looks like the default behavior is broken. Is that important for compatibility? I wonder if there's a chance to make "P" the default behavior.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57927/new/

https://reviews.llvm.org/D57927





More information about the llvm-commits mailing list