Close

AVR-GCC Compiler Issues

A project log for Stubby the (Teaching) Hexapod

100% open source robot platform with accessability and affordability in mind: teaching children of all ages about robots & programming

the-big-oneThe Big One 09/10/2014 at 22:390 Comments

A few days ago I received an email from someone who is building their own version of Stubby.  He reported that my code didn't compile.  The error he was getting was a very strange one, including a bunch of lines with things like this:

/usr/lib/gcc/avr/4.7.2/../../../avr/lib/avr51/libm.a(atan2.o):../../../libm/fplib/atan2.S:140: relocation truncated to fit: R_AVR_13_PCREL against symbol `__addsf3' 
defined in .text section in /usr/lib/gcc/avr/4.7.2/avr51/libgcc.a(_addsub_sf.o)

I found some sites which suggested adding -lm to the command to work around a bug in AVR-GCC 4.7, but that didn't work either.

In the end, he upgraded to AVR-GCC 4.8.1 (the same version which I am using), and it compiled fine.  I am still not sure what caused the errors, but whatever it is, it works on the latest versions.  So, if you are trying to compile Stubby code, and are getting errors like this, try upgrading your compiler.

Cheers

Discussions