/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
Created attachment 63400 [details, diff] Patch for toolchain.eclass
can those who actually know something about avr review this :)
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.
> 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 :)
Uhm... is the CTARGET really just 'avr'? Should we do this for avr-*?
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.
On the GCC site they specify that the target is just 'avr'. The longer version may or may not work. Scott =)
Hmmyeah, i meant avr* :)
(In reply to comment #8) > Hmmyeah, i meant avr* :) > it should be just avr (see line 962)
yeah, 'normal' naming does not apply to avr targets ... i'll merge this patch later tonight, thanks guys
added to toolchain.eclass, thanks all
Thanks guy, it's nice to hear that gentoo has support for avr c++ compiler :) Should I close the bug?
the bug is closed ...