Description
Arduino recently upgraded the AVR toolchain in the macOS version from 32 bit 5.4.0 to 64 bit 7.3.0 in order to support macOs Catalina, which is 64 bit only. However, the 7.3.0 toolchain has an odd problem when trying to link code compiled for the attiny10 series of microcontrollers. To investigate this, I downloaded the Mac version of the toolchain from:
http://downloads.arduino.cc/tools/avr-gcc-7.3.0-atmel3.6.1-arduino5-x86_64-apple-darwin14.tar.bz2
And used it to compile this simple test program:
#include <avr/io.h>
int main () {
DDRB |= (1 << PB0);
while (true) {
PORTB |= (1 << PB0);
PORTB &= ~(1 << PB0);
}
}
I can use the 7.3.0 toolchain to compile and link this code for the attiny85, like this:
./avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -mmcu=attiny85 -I ./ test.cpp -o test.cpp.o
./avr/bin/avr-gcc -w -Os -g -mmcu=attiny85 -o test.elf test.cpp.o -L ./ -lm
and it works just fine. But, if i change the -mmcu switch from attiny85 to attiny10, the compile seems to work fine, but the command to link the code (2nd line) spews out the following errors:
/Users/wholder/Desktop/temp/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld: cannot find crtattiny10.o: No such file or directory
/Users/wholder/Desktop/temp/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld: skipping incompatible /Users/wholder/Desktop/temp/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/lib/libm.a when searching for -lm
/Users/wholder/Desktop/temp/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld: cannot find -lm
/Users/wholder/Desktop/temp/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld: skipping incompatible /Users/wholder/Desktop/temp/avr/bin/../lib/gcc/avr/7.3.0/libgcc.a when searching for -lgcc
/Users/wholder/Desktop/temp/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld: cannot find -lgcc
/Users/wholder/Desktop/temp/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld: skipping incompatible /Users/wholder/Desktop/temp/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/lib/libm.a when searching for -lm
/Users/wholder/Desktop/temp/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld: cannot find -lm
/Users/wholder/Desktop/temp/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld: skipping incompatible /Users/wholder/Desktop/temp/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/lib/libc.a when searching for -lc
/Users/wholder/Desktop/temp/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld: cannot find -lc
/Users/wholder/Desktop/temp/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld: cannot find -lattiny10
collect2: error: ld returned 1 exit status
Curiously, the file crtattiny10.o is available in the toolchain at path: ./avr/lib/avrtiny/crtattiny10.o
Can anyone help me figure out what's going on here?
Wayne