I'm having trouble building the gcc toolchain for avr on linux (Fedora).
First I build binutils (2.32) and all is fine.
Then I build gcc (9.1.0) with
configure --prefix=/usr/local/avr --enable-languages=c,c++ --disable-nls --disable-libssp --disable-libada --with-dwarf2 --disable-shared --enable-static --enable-mingw-wildcard--host=avr
Running "make" builds libiberty OK but then things crash with
gcc -g -O2 -o fixincl fixincl.o fixtests.o fixfixes.o server.o procopen.o fixlib.o fixopts.o ../libiberty/libiberty.a
/bin/ld: ../libiberty/libiberty.a: error adding symbols: archive has no index; run ranlib to add one
Looking further up the output I see
I can run this avr-ranlib command again but it still doesn't like it when I run make again.
If I run ranlib (not the avr- version) on libiberty.a then running make again proceeds further until it next needs a .a file. Again running ranlib explicitly on the archive file allows compilation to continue.
It looks like avr-ranlib just isn't working.
Anyone else seen this or any ideas? I've build avr gcc many times in the past but not seen this before. Should it even be running avr-ranlib as opposed to ranlib to compile gcc??