Until today I have used 3 packages to build binaries for AVR microcontrollers plus a few other supporting packages such as a debugger, simulator, and programmer. These 3 packages being avr-binutils, avr-libc, and avr-gcc. The upstream sources for these packages has varied over time as at one point the best device support was obtained by getting the source from Atmel, but since the Microchip buyout they have become increasingly unfriendly to open source and binutils, gcc, and gdb are best cross built from the GNU upstream packages.
At one time OMLx had these packages, but no longer. I asked about this on Matrix and got this reply from @bero in regards to avr-binutils:
It’s a prehistoric package that has been dropped a decade or two ago, we have a different way of building crosscompilers these days.
binutils/binutils.spec at 734d300431f08ef83bfcb067e45605f706774d3a · OpenMandrivaAssociation/binutils · GitHub – just add the architecture you want to target there and get the same binutils+patches we use for everything else (similar constructs exist in all other toolchain packages)
I had to leave for a few hours and was not able to continue this conversation in matrix. The conversations flow quickly and it isn’t conducive to a longer discussion where I need to go look at something then come back with more questions. So I’m asking again here.
How does this work? AVR gets added to the list of targets and now as
knows how to assemble for an AVR when I pass it the appropriate flag? I’m used to GCC cross compilers, but is this something new where I call gcc with an argument to tell it which architecture to compile for? Is GDB also like this? Also, what of avr-libc? This is a C library unique to AVR so I don’t see how that can be replaced.
I thought maybe I was out of touch due to being a Debian user for so long, but a quick search of Fedora shows that they too are delivering AVR specific packages for binutils, gcc, gdb, libc, etc. Fedora even has the patch for avr-size
which is a common thing to do. So how do I build an AVR binary on an OMLx system? If I’m not mistaken, OMLx does not currently supply an AVR toolchain.
I am happy to package said toolchain, but I need to understand the OMLx way first or I’ll be off trying to do what Debian and Fedora do.