ldc
ldc copied to clipboard
Implement merging of static libraries via `-lib` on Posix too
On Posix, LDC currently puts .a inputs as-is into the generated .a, which generates invalid archives. This already works on Windows however.
Seems to be a PITA on Linux: https://stackoverflow.com/questions/3821916/how-to-merge-two-ar-static-libraries-into-one
Apple: https://stackoverflow.com/questions/8170450/combine-static-libraries-on-apple/8170851#8170851
Our by-default used internal driver/archiver.cpp is based on the llvm-ar tool, but heavily stripped down (~370 lines vs. 1.5k lines in https://github.com/llvm/llvm-project/blob/main/llvm/tools/llvm-ar/llvm-ar.cpp); we probably need some extra stuff then.