Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 99014 - PATCH for toolchain.eclass to support AVR microcontrolers g++ compiler
Summary: PATCH for toolchain.eclass to support AVR microcontrolers g++ compiler
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High minor
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 99020
  Show dependency tree
 
Reported: 2005-07-14 08:01 UTC by Ludek Stepan
Modified: 2005-07-15 15:06 UTC (History)
3 users (show)

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


Attachments
Patch for toolchain.eclass (toolchain.eclass.patch,563 bytes, patch)
2005-07-14 08:25 UTC, Ludek Stepan
Details | Diff
crossdev improvements for g++ and version locking for AVR (crossdev-avr.patch,571 bytes, patch)
2005-07-14 11:41 UTC, Gustavo Zacarias (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ludek Stepan 2005-07-14 08:01:56 UTC
/usr/portage/eclass/toolchain.eclass

GCC cannot cross-compile for language c++ with avr target because of bad .configure parameters gained prom toolchain.eclass. The bad parameter is --enable-threads=posix since avr-libc doesn't support threads.

Solution is to pass parameter --disable-threads to the .configure script for GCC in function gcc_do_configure (/usr/portage/eclass/toolchain.eclass). Then it compiles OK

Tested with gcc-3.4.4 and 4.0.1
Host platform is amd64

the PATCH for toolchain.eclass follows

--- backup/toolchain.eclass     2005-07-14 16:39:53.000000000 +0200
+++ /usr/portage/eclass/toolchain.eclass        2005-07-14 16:44:04.000000000 +0200
@@ -1088,6 +1088,8 @@
        # disable a bunch of features or gcc goes boom
        if is_crosscompile && [[ ${GCC_LANG} == "c" ]] ; then
                confgcc="${confgcc} --disable-shared --disable-threads --without-headers"
+       elif is_crosscompile && [[ ${CTARGET} == "avr" ]] ; then
+               confgcc="${confgcc} $(use_enable !static shared) --disable-threads"
        else
                confgcc="${confgcc} $(use_enable !static shared) --enable-threads=posix"
        fi
Comment 1 Ludek Stepan 2005-07-14 08:25:13 UTC
Created attachment 63400 [details, diff]
Patch for toolchain.eclass
Comment 2 SpanKY gentoo-dev 2005-07-14 08:57:50 UTC
can those who actually know something about avr review this :)
Comment 3 Gustavo Zacarias (RETIRED) gentoo-dev 2005-07-14 11:41:56 UTC
Created attachment 63411 [details, diff]
crossdev improvements for g++ and version locking for AVR

The toolchain.eclass patch is sane and things build fine.
However we'll need to enable stage3 in crossdev for this to be useful, patch
attached.
I've also locked down versions of gcc to 3.4.4 (includes the extended device
support patches i added some time ago) and binutils 2.16.1 (known good).
gcc 4.0.0 had some issues with avr, dunno if 4.0.1 was fixed, i'll try this at
a later time.
Comment 4 Ludek Stepan 2005-07-14 11:54:13 UTC
> However we'll need to enable stage3 in crossdev for this to be useful, patch
> attached.

yeah, see bug 99020

Thank You very much!
That's why I like gentoo so much :)
Comment 5 Jeremy Huddleston (RETIRED) gentoo-dev 2005-07-14 12:05:46 UTC
Uhm... is the CTARGET really just 'avr'?  Should we do this for avr-*?
Comment 6 Gustavo Zacarias (RETIRED) gentoo-dev 2005-07-14 12:11:39 UTC
You can safely go avr-*, however you won't see linux or some other big operating
system happening on one of these since they're 8-bit risc microcontrollers.
Comment 7 Scott Price 2005-07-14 12:14:05 UTC
On the GCC site they specify that the target is just 'avr'.  The longer version
may or may not work.

Scott  =)
Comment 8 Gustavo Zacarias (RETIRED) gentoo-dev 2005-07-14 12:15:34 UTC
Hmmyeah, i meant avr* :)
Comment 9 Ludek Stepan 2005-07-14 12:16:33 UTC
(In reply to comment #8)
> Hmmyeah, i meant avr* :)
> 

it should be just avr (see line 962)
Comment 10 SpanKY gentoo-dev 2005-07-14 15:58:16 UTC
yeah, 'normal' naming does not apply to avr targets ... i'll merge this patch
later tonight, thanks guys
Comment 11 SpanKY gentoo-dev 2005-07-14 20:09:17 UTC
added to toolchain.eclass, thanks all
Comment 12 Ludek Stepan 2005-07-15 07:42:36 UTC
Thanks guy, it's nice to hear that gentoo has support for avr c++ compiler :)
Should I close the bug?
Comment 13 SpanKY gentoo-dev 2005-07-15 15:06:01 UTC
the bug is closed ...