[llvm-ar] Fix MRI ADDLIB command when used with thin archives
authorgbreynoo <Owen.Reynolds@sony.com>
Mon, 27 Jun 2022 16:10:11 +0000 (17:10 +0100)
committergbreynoo <Owen.Reynolds@sony.com>
Mon, 27 Jun 2022 16:10:11 +0000 (17:10 +0100)
commit6a1e5f5a7111ce07a3beb8be366b63ea10fa56f4
tree2fb3464de71ff53ba9660778958e37dcd8b580b1
parent9878e17624d811965f46661a095d6a8b1fc8e110
[llvm-ar] Fix MRI ADDLIB command when used with thin archives

We did not properly handle using CREATETHIN in an MRI script and
attempting to use ADDLIB to add the contents of a regular archive. This
fix outputs a meaningful error message in this case and provides some
more testing.

Differential Revision: https://reviews.llvm.org/D128067
llvm/test/tools/llvm-ar/mri-thin-archive.test
llvm/tools/llvm-ar/llvm-ar.cpp