• Uncategorized

About linux : usrbinld-libbackenda-error-adding-symbols-malformed-archive

Question Detail

Building gcc with Buildroot in a Multipass Ubuntu-VM on macOS results in:

cc1: note: self-tests are not enabled in this build
echo timestamp > s-selftest-c
/usr/bin/ld: libbackend.a: error adding symbols: malformed archive
collect2: error: ld returned 1 exit status
make[2]: *** [../../gcc/lto/Make-lang.in:88: lto1] Error 1
/usrmake[2]: *** Waiting for unfinished jobs....
/bin/ld: libbackend.a: error adding symbols: malformed archive
collect2: error: ld returned 1 exit status
make[2]: *** [../../gcc/lto/Make-lang.in:92: lto-dump] Error 1
make[2]: Leaving directory '/home/ubuntu/Home/Downloads/buildroot-2021.11/output/build/host-gcc-initial-10.3.0/build/gcc'
make[1]: *** [Makefile:4376: all-gcc] Error 2
make[1]: Leaving directory '/home/ubuntu/Home/Downloads/buildroot-2021.11/output/build/host-gcc-initial-10.3.0/build'
make: *** [package/pkg-generic.mk:295: /home/ubuntu/Home/Downloads/buildroot-2021.11/output/build/host-gcc-initial-10.3.0/.stamp_built] Error 2

Anyone here who knows how to fix this?

Question Answer

Happened to me while compiling qt-5.15.3 on Slackware 14.2 i686, using its “unsupported” intermediate gcc-9.2.0 version (it originally comes with gcc-5.5.0, which is a real pain in 2022, especially with anything C++). I found the simple fix here: ulimit -n 4096 (my default ulimit -n is 1024). So the problem wasn’t actually the .a archive itself, but the compiler/linker running out of filedescriptors, and the actual error message was a bit misleading.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.