In binutils, ar -s and randlib don't convert a thin archive to a regular one.
This behavior makes sense and this patch ports the behavior.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
If D116979 is accepted, I'd like to use --thin for new tests.
Unrelated to this patch:
% rm -f x.a && fllvm-ar rcT x.a a.o b.o % ar q x.a c.o # q or r ar: Cannot convert existing thin library x.a to normal format
Do we want such a diagnostic? llvm-ar current behavior is to convert the thin archive to a regular one (untested, though).
The opposite has a diagnostic, like GNU ar. The diagnostic makes sense to me because it is difficult to ensure the filesystem has the listed files.
% 'rm' -f x.a && fllvm-ar rc x.a a.o b.o % fllvm-ar rT x.a c.o /tmp/RelA/bin/llvm-ar: error: cannot convert a regular archive to a thin one
Comment Actions
So looks like this may miss the 14.0.0 branch point (https://llvm.discourse.group/t/llvm-14-0-0-release-schedule/5846). I'll hope that 14.0.0 includes this.
Comment Actions
Hi @MaskRay, apologies for the wait in this review. The change LGTM. Regarding the implicit conversion from thin to full archives I think there is a problem there, I've created https://reviews.llvm.org/D118693 to discuss it further.