avr-ranlib problem when building gcc

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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 

avr-ranlib ./libiberty.a

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??

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have no idea, but I am wondering about --enable-mingw-wildcard? Is that needed to do a Canadian cross for windows?

 

Last Edited: Mon. Jan 6, 2020 - 06:14 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Host is the system where the compiler just being built is supposed to run. This is not AVR. avr is the target, i.e. --target=avr.
.
configure is not supported in srcdir. Read the install documentation again.
.
You wildcard option indicates you want a canadian cross, i.e. Windos as host?
.
You must sudo for install. If you dont know 100% what you are doing, better use prefix in home for example. That way you wont mess up your system.

avrfreaks does not support Opera. Profile inactive.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the suggestions. The mingw stuff was a bit of a red herring - it was one of many things I'd tried.

It looks like I had a polluted PATH that was running some obscure version of something at some point. Setting it to /bin:/usr/bin fixed things.