llvm-ar silently converts a thin archive to a regular archive when you specify a modification operation (e.g. 'r') without the 'T' modifier. This is probably not what is normally intended, since it would be very easy to forget the modifier. If a user is trying to convert between thin and full archives then they can explicitly use the 'L' command to create a new archive.
Details
Diff Detail
Event Timeline
I believe Gnu-ar commands without T on thin archives do not auto convert to "full" archives:
- Move and Delete work as intended
- Replace and Quick Append errors
I think a consistent approach would be best, so I'm happy to just go with an error if that is preferred.
May be worth stating that GNU ar rejects 'r' and 'q' for a thin archive if 'T'/--thin is not specified.
% ar r a.a b.o ar: Cannot convert existing thin library a.a to normal format
I do not have a strong opinion whether llvm-ar 'r' and 'q' should report a similar error.
Supporting the operation in the absence of explicit 'T'/--thin seems useful.
llvm/test/tools/llvm-ar/full-to-thin-archive.test | ||
---|---|---|
12 | Prefer two-dash long options for FileCheck. And you already used the form for --check-prefixes:) | |
llvm/test/tools/llvm-ar/thin-to-full-archive.test | ||
6 | ditto | |
26 | If a positive pattern can serve the same purpose as a negative pattern. I'd use the positive one since a negative one may go stale without being noticed. | |
llvm/tools/llvm-ar/llvm-ar.cpp | ||
655 |
llvm/test/tools/llvm-ar/full-to-thin-archive.test | ||
---|---|---|
10 |