ldc icon indicating copy to clipboard operation
ldc copied to clipboard

Implement merging of static libraries via `-lib` on Posix too

Open kinke opened this issue 1 year ago • 0 comments

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.

kinke avatar Aug 11 '24 16:08 kinke