0

Been doing this in 18.04. Now have 19.04 and it does not work:

ar qc file.a file.o
ar: file.a: malformed archive

Any suggestions?

0

It looks like between 18.04 and 19.04 the ar command lost some supported targets.

18.04:

ar: supported targets: elf64-x86-64 elf32-i386 elf32-iamcu elf32-x86-64 a.out-i386-linux pei-i386 pei-x86-64 elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big pe-x86-64 pe-bigobj-x86-64 pe-i386 plugin srec symbolsrec verilog tekhex binary ihex

19.04

ar: supported targets: elf64-x86-64 elf32-i386 elf32-iamcu elf32-x86-64 pei-i386 pei-x86-64 elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big pe-x86-64 pe-bigobj-x86-64 pe-i386 plugin srec symbolsrec verilog tekhex binary ihex

It's possible the archive you originally created is in one of those no-longer supported formats. So appending to it won't work. You may have to re-create the archive by unpacking and re-packing it in a supported target format.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.