Sorry for being off topic, but I could really use some help.
Arduino 1.8.10 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. However, the 7.3.0 toolchain has an odd problem when trying to compile and link code for the attiny10 series of micro controllers. To demonstrate this, I extracted the toolchain from the Mac version of Arduino 1.8.10 and then ran it from the command line to compile and link a simple test program, such as:
#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 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 relative path: ./avr/lib/avrtiny/crtattiny10.o
Can anyone help me figure out what's going on here? It looks like something got broken in the 7.3.0 toolchain that previously worked in the 5.4.0 toolchain, as I've successfully used 5.4.0 to compile and link attiny10 code for some time.
Wayne
cannot find crtattiny10.o: No such file or directory
the file crtattiny10.o is available in the toolchain at relative path: ./avr/lib/avrtiny/crtattiny10.o
It seemed like good guess… :-(
skipping incompatible /Users/wholder/Desktop/toolchain problem/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/lib/libm.a
Can you also confirm that the link phase also fails with the following MCUs?
avrtiny: attiny4, attiny5, attiny9avrxmega7: atxmega128a1, atxmega128a1u, atxmega128a4u