[llvm-ar] Add --thin for creating a thin archive
authorFangrui Song <i@maskray.me>
Tue, 1 Feb 2022 17:56:50 +0000 (09:56 -0800)
committerFangrui Song <i@maskray.me>
Tue, 1 Feb 2022 17:56:50 +0000 (09:56 -0800)
commitdd6e7e0d5722d6396f8a0e94146f0b5e50dfa028
treefac188368c3dd63dcfdcfd5ea890c680334a406b
parent83620bd2ad867f706c699d0f2b8be10e43d9f3d7
[llvm-ar] Add --thin for creating a thin archive

In GNU ar (since 2008), the modifier 'T' means creating a thin archive.
In many other ar implementations (FreeBSD, macOS, elfutils, etc), -T
means "allow filename truncation of extracted files", as specified by
X/Open System Interface.

For portability, 'T' with thin archive semantics should be avoided.

See https://sourceware.org/bugzilla/show_bug.cgi?id=28759 binutils 2.38
will deprecate 'T' (without diagnostic) and add --thin.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D116979
llvm/docs/CommandGuide/llvm-ar.rst
llvm/test/tools/llvm-ar/thin-archive.test
llvm/tools/llvm-ar/llvm-ar.cpp