I am trying to build an AVR toolchain with crossdev. There are a number of bugs that have to be worked around that are present in gentoo(http://en.gentoo-wiki.com/wiki/Crossdev) but there also seem to be some Funtoo specific ones.
The first problem I ran into seems to be Portage and overlay related. Crossdev failed at stage one with lots of lines such as:
Missing digest for '/usr/local/portage/cross-avr/gcc/gcc-4.6.2.ebuild'
cross-avr/gcc-4.6.2::Local (masked by: corruption)
The fix for this was to use FEATURES=digest before the crossdev command. Is this a reasonable way to do it and how can we fix this problem so people don't need the workaround? Am I correct that this is funtoo specific(been a while since I used crossdev on gentoo)? Should we create our own crossdev ebuild that contains a fix or does the problem really live elsewhere?
The second problem I ran into was that when trying to build libc crossdev couldn't find avr-gcc. When I ran gcc-config it was not selected:
# gcc-config -l
 i686-pc-linux-gnu-4.6.2 *
`gcc-config 1` fixed this problem for me. I couldn't find any other references to it online so I am assuming it is also funtoo specific.
The rest of the bugs are also present on gentoo and the fixes are outlined in the link above so I wont bore you with the details. I now have a built toolchain but haven't tested it yet.
Crossdev relies on some eclasses badly broken for some arches like sparc64 In the case of that later, I was never be able to geta working cross-compilation toolchain so far but never took the time to fix the eclass yet.
Well I got crossdev to build me an avr toolchain and it seems to work well. A patch and a number of hacks were involved though. One for a bug that was reported 6 years ago that still hasn't been fixed in crossdev despite it completely breaking the avr toolchain and people commenting on the bug often. Can we fork our own crossdev for funtoo so that atleast some toolchains can work out of the box on funtoo?
Any idea on the proper fix for the lack of manifests I mention above? I haven't dug into the crossdev script yet.
Yes, we can fork crossdev. Can you point me to the patch that needs to be added? Thanks
This is the patch that fixes the biggest issue: https://bugs.gentoo.org/attachment.cgi?id=285901 from https://bugs.gentoo.org/show_bug.cgi?id=378387 but there is also a link that needs to be created: https://bugs.gentoo.org/show_bug.cgi?id=147155 and it needs to be changed to correctly specify the cxx use flag. Plus the two issues I mentioned above. I will try to throw together some patches to solve all of the problems so we can have a crossdev that will work out of the box for building an avr toolchain.
I updated the instructions at http://en.gentoo-wiki.com/wiki/Crossdev … chitecture with a list of the steps necessary to get it to work in its current form if anyone is interested. I also have a new ebuild updating arduino to 1.0. Will be submitting it to the gentoo bugzilla soon.
OK, please let me know when you have all patches assembled and the new ebuild and I can fork and add it to funtoo until gentoo catches up.
Jess, I Just ran into the same issue and I'm following your steps right now
many thanks for this post and for updating the wiki !
I'm a total avr n00b but at least I will let you know if I manage the toolchain to work
I use funtoo linux and thanks for this.
In funtoo or gentoo is very dificult to install avr toolset and arduino, but I did with layman/luksans-arduino
With this I have errors compilation in arduino (sanguino).
/home/florin/arduino-0023/hardware/arduino/cores/arduino/HardwareSerial.cpp:145:15: error: attempt to use poisoned "SIG_USART1_RECV" make: *** [.build/arduino/HardwareSerial.d] Error 1
Then I downloaded the arduino-0023 from arduino.cc site and I got (copy) the toolset from wiring (tools directory) http://wiring.org.co/ and I put the toolset in arduino-0023 in hardware folder.
The I modified Sconstruct from http://code.google.com/p/arscons/ with new toolset path and I make compilation without errors.
Last edited by florin.tanasa (2012-02-10 20:37:15)
So adding FEATURES=digest like I recommended before messes up your portage tree requiring you fix it with git. That made me figure out what the real problem is and it seems that when funtoo went to a thin-manifest portage tree it broke crossdev for anyone whose local portage wasn't setup with the mini manifest option(crossdev links one tree to the other). Crossdev already tries to manage metadata/layout.conf so a simple patch to crossdev to enable thin-manifests fixes the problem. I will submit a patch along with a new ebuild soon.
Last edited by JessH (2012-02-17 05:46:32)
Current crossdev is compiling for me if you select gcc 4.4.5 and specific version of other stuff (binutils etc...)
Is your local portage tree setup to use thin-manifests? That is not the default and if it isn't setup then crossdev will fail to build anything(there could be some other settings that could make it work as well but none of them are the default).
Are you building an AVR toolchain? Even if it compiles it will not work correctly with all avr targets without the multilib patch.
Here is an updated ebuild that includes patches to enable thin-manifest support on the local overlay and enables multilib for the avr target.
The thin-manifest patch should allow crossdev to work as on gentoo and the avr multilib patch allows it to build a working avr toolchain without applying any patches(which is not the case on gentoo). The other extra steps outlined at http://en.gentoo-wiki.com/wiki/Crossdev … chitecture are still necessary atleast with current gcc, binutils, etc... (gcc 4.6.2, binutils 2.21.1)
I currently have a working avr toolchain using this ebuild and the extra steps outline in the link above.
Upstream responded to my bug report and the latest crossdev now has thin manifest support. AVR support is still broken without the multilib patch but this means funtoo is now back to having a working crossdev out of the box for other targets.
i wonder how thin-manifest impacts toolchain or any other packages, it's just stripped metadata (Changelog, metada.xml), has nothing to do with ebuilds itself, i.e
only distfile checksum in Manifest saved.
I recently tried to get a working cross toolchain, and I was getting errors about missing digests. When I looked in the portage directory, I found that there is no Manifest file in some of the directories (for example dev-util/w32api ). So the lack of thin-manifest support was only affecting toolchain components indirectly. After upgrading to the latest version of crossdev with thin-manifest support, I no longer got those error messages. That's not to say everything worked perfectly. I had to pick and choose versions like an older 4.4.5 version gcc and such, but at least the missing digest error which was a showstopper ended.