You are not logged in.

#1 2012-01-02 05:51:13

JessH
New member
Registered: 2012-01-02
Posts: 7
Website

Making crossdev work

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'
and
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
[1] avr-4.6.2

[2] 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.

~Jess

Offline

#2 2012-01-02 16:28:47

404_Error
Core Team Member
From: Quebec city, Quebec, Canada
Registered: 2010-10-08
Posts: 458

Re: Making crossdev work

Crossdev relies on some eclasses  badly broken for some arches like sparc64 sad  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.

Offline

#3 2012-01-02 20:03:59

JessH
New member
Registered: 2012-01-02
Posts: 7
Website

Re: Making crossdev work

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.

~Jess

Offline

#4 2012-01-02 21:23:46

drobbins
Head Honcho
From: Albuquerque, NM, USA
Registered: 2010-10-04
Posts: 334
Website

Re: Making crossdev work

Yes, we can fork crossdev. Can you point me to the patch that needs to be added? Thanks wink

Offline

#5 2012-01-02 23:30:09

JessH
New member
Registered: 2012-01-02
Posts: 7
Website

Re: Making crossdev work

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.

~Jess

Offline

#6 2012-01-03 02:42:28

drobbins
Head Honcho
From: Albuquerque, NM, USA
Registered: 2010-10-04
Posts: 334
Website

Re: Making crossdev work

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.

Offline

#7 2012-01-09 15:13:55

ghedamat
New member
Registered: 2012-01-09
Posts: 1

Re: Making crossdev work

Jess, I Just ran into the same issue and I'm following your steps right now smile

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 smile

Offline

#8 2012-02-10 20:34:24

florin.tanasa
New member
Registered: 2012-02-10
Posts: 1

Re: Making crossdev work

Hello,
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)

Offline

#9 2012-02-15 22:14:01

JessH
New member
Registered: 2012-01-02
Posts: 7
Website

Re: Making crossdev work

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.

~Jess

Last edited by JessH (2012-02-17 05:46:32)

Offline

#10 2012-02-16 04:15:06

Cndy
Member
Registered: 2010-10-08
Posts: 155

Re: Making crossdev work

Current crossdev is compiling for me if you select gcc 4.4.5 and specific version of other stuff (binutils etc...)


Coffee, which sticks to the spoon and dries up there is the most delicious thing in the world.

Offline

#11 2012-02-17 05:57:38

JessH
New member
Registered: 2012-01-02
Posts: 7
Website

Re: Making crossdev work

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.

Offline

#12 2012-02-17 06:02:24

JessH
New member
Registered: 2012-01-02
Posts: 7
Website

Re: Making crossdev work

Here is an updated ebuild that includes patches to enable thin-manifest support on the local overlay and enables multilib for the avr target.

http://jesshaas.com/funtoo/crossdev-20120214-r1.ebuild
http://jesshaas.com/funtoo/crossdev-201 … ilib.patch 
http://jesshaas.com/funtoo/crossdev-thinManifests.patch

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.

~Jess Haas

Offline

#13 2012-03-02 23:35:02

JessH
New member
Registered: 2012-01-02
Posts: 7
Website

Re: Making crossdev work

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.

~Jess

Offline

#14 2012-03-03 02:49:10

angry_vincent
Staff
From: Ukraine
Registered: 2010-10-07
Posts: 594

Re: Making crossdev work

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.

Offline

#15 2012-03-05 09:07:52

PaddyMac
Member
From: Alabama, USA
Registered: 2011-08-20
Posts: 110

Re: Making crossdev work

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.

Offline

Board footer

Powered by FluxBB