FS#25798 - [avr-gcc] Missing XMEGA mcu support
Attached to Project:
Community Packages
Opened by Alex Forencich (alex.forencich) - Sunday, 28 August 2011, 06:34 GMT
Last edited by Jakob Gruber (schuay) - Saturday, 31 March 2012, 14:09 GMT
Opened by Alex Forencich (alex.forencich) - Sunday, 28 August 2011, 06:34 GMT
Last edited by Jakob Gruber (schuay) - Saturday, 31 March 2012, 14:09 GMT
|
Details
Description:
The gcc-avr package in the Arch repository is missing ALL XMEGA mcu support. Additional info: * avr-gcc 4.6.1 Steps to reproduce: avr-g++ -c -mmcu=atxmega128a3 -I. -gstabs -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wa,-adhlns=voadrv.lst -MD -MP -MF .dep/voadrv.o.d -DF_CPU=32000000L voadrv.cpp -o voadrv.o voadrv.cpp:1:0: error: unrecognized argument to -mmcu= option: 'atxmega128a3' voadrv.cpp:1:0: note: See --target-help for supported MCUs |
This task depends upon
Closed by Jakob Gruber (schuay)
Saturday, 31 March 2012, 14:09 GMT
Reason for closing: Upstream
Additional comments about closing: XMEGA support has been added in gcc 4.7.
Saturday, 31 March 2012, 14:09 GMT
Reason for closing: Upstream
Additional comments about closing: XMEGA support has been added in gcc 4.7.
binutils-avr.PKGBUILD (2.6 KiB)
gcc-avr.PKGBUILD (1.8 KiB)
versions:
avr-libc: 1.7.0
gcc-avr: 4.3.4
binutils-avr: 2.20.1
Note: the souce file on gnu.org is actually called binutils-2.20.1a.tar.bz2, necessitating a bit of a hack in the source line to get it working properly.
gcc-avr.PKGBUILD (4.5 KiB)
Versions:
avr-libc: 1.7.1
gcc-avr: 4.5.1
binutils-avr: 2.20.1
gcc-avr-4.5.1-1.PKGBUILD (4.5 KiB)
avr-libc-1.7.1-1.PKGBUILD (1.2 KiB)
Also, as far as embedded programming goes, who cares about the compiler version if it doesn't support the chip in use. I work with Atmel AVR xmega chips. If the compiler doesn't support xmega, it's worthless. I don't care how many versions I have to go back to find one that does what I need it to do. Also, look at FreeBSD, Debian, Ubuntu, etc. FreeBSD has 4.3.4. Ubuntu had 4.3.5 for a long time, now it's 4.5.3. Whoopee, Arch's version is newer. However, it's useless without the Atmel patches, so what's the point?
I can only find one bug report mentioning xmega. So these patches and bugs should go to upstream.
Basically, the bottom like is bugs that aren't related to the proper application of Atmel supplied patches go upstream, and the Atmel supplied patches must be applied as necessary by you guys when building the package for the arch repository. I said it before an I'll say it again, gcc-avr version 4.6.2 is useless to me so long as I can't compile for the chip I'm using with it. I can do that on pretty much every other linux distribution just by installing the default gcc-avr package. Not so with arch linux as I had to go hunting for the proper patches and build it myself. I just want to fix that for everyone else who wants to develop for xmega in arch linux.
Also, binutils-avr and avr-libc must also be patched. However, not all the patches need to be applied as they are for experimental Atmel chips. I'm not sure why they're distributing them. I have included all the necessary patches in the PKGBUILDs.
Additionally, note the following from the bug report you linked to:
"ATXmega is not supported by the FSF version of avr-gcc so you should either report the bug to the distributor of your toolchain or reproduce the artifact with in unpatched version of avr-gcc."
Hence, xmega bugs do not go to gcc directly, but would probably be handed off to Atmel.
I am re-reporting this as the package name has changed and it it still not fixed (old bug is #25798). The avr-gcc package in the Arch repository is missing all XMEGA mcu support as it does not contain the Atmel patches from http://distribute.atmel.no/tools/opensource/avr-gcc/ .
Good pkgbuilds for properly patched avr-gcc are available here: http://alexforencich.com/wiki/en/linux/arch_avr_gcc
Note that the patches may not apply to the bleeding edge version of GCC. The latest version the linked pkgbuilds have been tested with is 4.5.3.
Steps to reproduce:
avr-g++ -c -mmcu=atxmega128a3 -I. -gstabs -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wa,-adhlns=voadrv.lst -MD -MP -MF .dep/voadrv.o.d -DF_CPU=32000000L voadrv.cpp -o voadrv.o
voadrv.cpp:1:0: error: unrecognized argument to -mmcu= option: 'atxmega128a3'
voadrv.cpp:1:0: note: See --target-help for supported MCUs
Please post back here about any news (things like Atmel patches being ported to current gcc/binutils/... versions).
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44940 also mentions initial XMEGA support in gcc 4.7, so that might be worth watching too.
I think there is a reason that the Atmel patches are not part of the FSF version of GCC, but I am not familiar with the politics of the compiler; I just want something that works. According to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52461 , it seems that the patches constitute a fork of the compiler by Atmel. I'm not sure what the significance is, exactly, aside from the fact that the FSF version is broken (and by extension the version in the Arch community repository) while the version incorporating Atmel's patches works perfectly.
Please test and let me know how it works (especially with XMEGA).
/usr/bin/avr-ld: cannot find crtx128a3.o: No such file or directory
/usr/bin/avr-ld: skipping incompatible /usr/lib/gcc/avr/4.7.0/../../../../avr/lib/libm.a when searching for -lm
/usr/bin/avr-ld: cannot find -lm
/usr/bin/avr-ld: skipping incompatible /usr/lib/gcc/avr/4.7.0/../../../../avr/lib/libc.a when searching for -lc
/usr/bin/avr-ld: cannot find -lc
collect2: error: ld returned 1 exit status
make: *** [main.elf] Error 1
After downloading the PKGBUILD and compiling it locally, it seems to work perfectly. I confirmed that the output is good as well as I have some code built with this setup running on a dev board.
I will close this bug report if no more issues pop up in the next couple of days.