homebrew-avr: New tiny (atxmega3 core) such as ATtiny817 seem to be missing

Since AVR-GCC 8, the new tiny are supported: https://gcc.gnu.org/gcc-8/changes.html If I do a find /usr/local/Cellar/avr-gcc -iname "*attiny817*" I do get the following:

/usr/local/Cellar/avr-gcc/9.2.0_1/lib/avr-gcc/9/gcc/avr/9.2.0/device-specs/specs-attiny817

That specs file refers to a crtattiny817.o which seems to be missing. If I instead search e.g. for the “ATxmega64a3u”, I get

/usr/local/Cellar/avr-gcc/9.2.0_1/avr/lib/avrxmega4/libatxmega64a3u.a
/usr/local/Cellar/avr-gcc/9.2.0_1/avr/lib/avrxmega4/crtatxmega64a3u.o
/usr/local/Cellar/avr-gcc/9.2.0_1/lib/avr-gcc/9/gcc/avr/9.2.0/device-specs/specs-atxmega64a3u

In fact, /usr/local/Cellar/avr-gcc/9.2.0_1/avr/lib/avrxmega3 seems to be completely missing.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

Hey @metropt, thank you for your answer! Could you nonetheless please post the exact full command-line that did work for you?

Note that the -B flag does not actually set device specs, but rather it prepends a number of directories to the compiler’s search paths in the various build passes - including when looking for specs.

I was able to download the device pack from atmel from packs.download.atmel.com. With that, I was able to compile my source with a command-line as follows:

avr-g++ -Batmel-DFP/gcc/dev/attiny817 -Iatmel-DFP/include  -Os -save-temps -g -gdwarf-3 -gstrict-dwarf -fno-exceptions   -mmcu=attiny817 -std=gnu++17 -o main.cpp.obj -c main.cpp

However, this does only compile (-c flag), so it will never show the link problems I posted above. If I try

avr-g++ -Batmel-DFP/gcc/dev/attiny817 -Iatmel-DFP/include  -Os -save-temps -g -gdwarf-3 -gstrict-dwarf -fno-exceptions   -mmcu=attiny817 -std=gnu++17 -o main.elf main.cpp

instead, the missing crtattiny817.o and libattiny817 are indeed found, but I still get skipping incompatible ... for -lm and -lc.

Indeed, gcc tries to locate libm.a and libc.a in the usual way, and only finds those for other architectures (because avrxmega3 is currently missing from avr-libc). Of course, within atmel’s gcc 5.4 download, there are also libm.a and libc.a for avrxmega3. Maybe these are the ones your build found? In any case, the approach here is re-using binaries downloaded from unknown origin (atmel) - it might very well not work together with our version of gcc and lead to silently and fatally failing code.