Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 173328 - add support for avr-gcc-4.1.x
Summary: add support for avr-gcc-4.1.x
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-04 11:13 UTC by Stefan Salewski
Modified: 2007-10-07 02:00 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
AVR patches for binutils 2.17 (binutils-2.17-avr-patches.tar.bz2,18.04 KB, application/octet-stream)
2007-05-21 15:28 UTC, Gustavo Zacarias (RETIRED)
Details
AVR patches for gcc 4.1.2 (gcc-4.1.2-avr-patches.tar.bz2,6.08 KB, application/octet-stream)
2007-05-21 15:30 UTC, Gustavo Zacarias (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Salewski 2007-04-04 11:13:54 UTC
For Gentoo-Linux there is still only avr-gcc 3.4.6 available, while avr-gcc 4.1.1 or greater is working fine with other distros or compiled from source. (there was a question in gentoo forum about a way to get a version > 3.4.6 some days ago, but no response.)

It would be great to have avr-gcc 4.1.1 or greater in Gentoo-Linux!

Thank you all for your great work.

Stefan Salewski


Reproducible: Always

Steps to Reproduce:
1. crossdev -t avr
2. crossdev -t avr --gcc 4.1.1
3.

Actual Results:  
avr-gcc 3.4.6 is build

Expected Results:  
avr-gcc 4.1.1 or greater is build
Comment 1 SpanKY gentoo-dev 2007-04-04 22:18:34 UTC
that's for the AVR guys to decide ... they asked i force gcc-3.4.6
Comment 2 Stefan Salewski 2007-04-05 12:32:03 UTC
(In reply to comment #1)
> that's for the AVR guys to decide ... they asked i force gcc-3.4.6
> 
Forcing avr-gcc 3.4.6 was wise until october 2006.
After this date working patches for avr-gcc 4.1.1 are available, see
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=42631

Personally I think advantages of avr-gcc 4.1.1 are not to big, but today
most people (here in germany) are using avr-gcc 4.1.1.

I hope you can integrate necessary patches, so that Gentoo-users can 
decide if the like to use 3.4.6 or 4.1.1 or newer.

Thanks

Stefan Salewski
Comment 3 Renato Caldas 2007-04-05 19:01:09 UTC
I really believe upgrading to gcc 4 is a good thing. I've noticed it corrected a weird bug in a program of mine where optimization led to a strange behavior in a switch block. With gcc 4 I could turn size optimization on and still have the code behaving correctly.

I did this with an overlay build of crossdev, without any additional patches to gcc. Indeed something bad could have happened, but it didn't..

Now that it is safer to use gcc-4, I see no reason to hard-limit the gcc version. If you still don't like it you could print a warning stating that it's done at our own risk..
Comment 4 SpanKY gentoo-dev 2007-04-07 11:43:30 UTC
i dont use avr at all ... if you want something updated in gcc, post a tarball of patches that i can simply unpack into the existing gcc patchset with relevant documentation as to where each patch came from

note that i mean the patch has to be compatible with epatch naming schema
Comment 5 Stefan Salewski 2007-04-08 21:13:04 UTC
(In reply to comment #4)
> i dont use avr at all ... if you want something updated in gcc, post a tarball
> of patches that i can simply unpack into the existing gcc patchset with
> relevant documentation as to where each patch came from
> 
> note that i mean the patch has to be compatible with epatch naming schema
> 

Seems that no special patches are necessary for avr-gcc 4.x.x today!
I have done some google search about this topic and put a question about necessary patches to avr-gcc mailing-list yesterday (no response).
There is a detailed internet page about avr-gcc installation on linux at

http://avrwiki.com/wiki/index.php/Building_AVR_GCC

There are some remarks about necessary or not working options, but patched
are not mentioned. I can not test it with an overlay on my box because I am not familar with crossdev now, sorry.

Best regards

Stefan Salewski
Comment 6 Gustavo Zacarias (RETIRED) gentoo-dev 2007-04-09 12:40:12 UTC
Stefan: technically speaking gcc 3.4.6 also works out of the box for AVR.
It's a matter of device support, if you stick with mainstream gcc and binutils you'll only have a handsome of devices supported and these won't be the newest.
Vanilla gcc 4.1.1 will support more devices than vanilla gcc 3.4.6, but gentoo's gcc 3.4.6 + patches supports more devices than vanilla gcc 4.1.1, so basically it'd be a regression.
Basically what we do and spanky wants is the needed split patches to support most devices (not the just-released, lightly tested and "you can't get that chip yet" ones). This are usually announced in the avr-libc-dev mailing list as "Add new device support: XXX", which is usually a binutils patch, a gcc patch and an avr-libc patch (i stick with the "until a new avr-libc is released which supports said device isn't shipped i won't patch binutils/gcc" mantra).
Also sometimes some work needs to be done to get all these patches to work nice together (hand patching) so as to get a unified patch to spanky - just linking a ton of URLs won't do.
I'm not against getting gcc-4.1.x into AVR-niceness but vanilla just won't cut it and i personally lack the time at the moment to do so and test it.
Comment 7 Gustavo Zacarias (RETIRED) gentoo-dev 2007-05-21 15:28:45 UTC
Created attachment 119887 [details]
AVR patches for binutils 2.17

AVR patches for binutils 2.17 from http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/avr-binutils/files/
Comment 8 Gustavo Zacarias (RETIRED) gentoo-dev 2007-05-21 15:30:17 UTC
Created attachment 119888 [details]
AVR patches for gcc 4.1.2

AVR patches for gcc 4.1.2 from http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/avr-gcc/files/
Comment 9 Gustavo Zacarias (RETIRED) gentoo-dev 2007-05-21 15:37:36 UTC
@toolchain please add patches to gcc-4.1.2 and binutils-2.17, crossdev can then be changed to recommend these versions afterwards, thanks.
Comment 10 SpanKY gentoo-dev 2007-06-18 02:56:43 UTC
ive added the binutils patches as those are pretty much just backports from current cvs ...

gcc is also all backports except for this:
58_all_gcc4-avr-atmega256x-r1.1.patch

which comes from:
http://gcc.gnu.org/ml/gcc-patches/2006-05/msg00534.html

which hasnt been commented on let alone merged ... do you actually need this, or you just adding it because it's in FreeBSD ? ;)
Comment 11 Gustavo Zacarias (RETIRED) gentoo-dev 2007-06-19 12:52:54 UTC
The mega256* devices are a new kind of AVR ISA (avr6 iirc) which has extended memory addressing and gcc completely lacks support for yet.
I don't use them but maybe some user wants to. If they're too intrusive for your liking just leave them out.
Comment 12 Gustavo Zacarias (RETIRED) gentoo-dev 2007-06-19 12:53:37 UTC
BTW the mega256* patch is shipped in WinAVR so it's in production use.
Comment 13 SpanKY gentoo-dev 2007-06-22 01:12:48 UTC
ok, i'd prefer to not merge it, but since it only modifies avr files, i cant complain that it'll screw with other ports ;)

added the stuff to our patchset, it'll prob be part of gcc-4.1.2-r1
Comment 14 Stefan Salewski 2007-08-25 17:25:44 UTC
Is it possible to install avr-gcc > 3.4.6 now?

I need at least avr-gcc 4.1 to ensure that my USB firmware developed with version  3.4.6 is compatible with newer avr-gcc releases (which most people use now)

I was not successful to ask crossdev to install avr-gcc > 3.4.6.

Thanks

Stefan Saleswki
Comment 15 Stefan Salewski 2007-08-29 22:25:43 UTC
Tried again to install avr-gcc 4.x:

crossdev --target avr --gcc 4.1.2 --binutils 2.17

now works, but it builds version 3.4.6 too, so we have to use
gcc-config avr-4.1.2
source /etc/profile

before we can use version 4.1.2

avr-gcc --target-help lists at90usb1287, but
avr-gcc -mmcu=at90usb1287 test.c gives
unknown MCU 'at90usb1287' specified
test.c:1: Fehler: MCU »at90usb1287« nur für Assemblierung unterstützt

Seems that a "New-Devices" patch is missing.
Currently I do not know which patch this is, or where to insert it.

Regards

Stefan Salewski


Comment 16 Stefan Salewski 2007-09-07 12:55:06 UTC
Some days ago I found a script for installing avr-gcc 4.1.2 (including patches for new devices)) in a german microcontroller forum:

http://www.mikrocontroller.net/topic/77150#new

Script is an appendix of the first (and in a modified version to the last) posting of this thread. This script installs avr-gcc to /usr/local -- if you start it without being root, root-password is asked a few times. I have tested the installation with AT90USB1287 device, seems to work.
Comment 17 SpanKY gentoo-dev 2007-10-07 02:00:39 UTC
crossdev allows any gcc version to be installed now for avr