Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Building Crossdev Binary Packages
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
cctsurf
n00b
n00b


Joined: 12 Oct 2006
Posts: 70

PostPosted: Sat May 04, 2013 1:08 am    Post subject: Building Crossdev Binary Packages Reply with quote

I'm working on arduino programming, I have a desktop that I normally use as my binary package build host. However, I enjoy using my significantly lower powered laptop on trips etc. I have used that computer to do compiling for my arduino under ubuntu in the past. I am wondering if there is a way for me to use my desktop to build binary packages for the cross-avr toolchain?
Thanks in Advance.
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 3791
Location: The Peanut Gallery

PostPosted: Sat May 04, 2013 4:45 am    Post subject: Reply with quote

Sure: have a read of this first (treat it like the handbook for the install, so you need to read it a couple of times and find out answers to your questions before you go ahead):
http://www.gentoo.org/proj/en/base/embedded/handbook/

This is also a good site and what I'd use if I weren't on Gentoo. Excellent material:
http://crosstool-ng.org/
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1809

PostPosted: Sun May 05, 2013 10:47 am    Post subject: Reply with quote

Or build the packages (using crossdev) on the laptop - it'll take a while, but
you only have to do it once.

Will
Back to top
View user's profile Send private message
cctsurf
n00b
n00b


Joined: 12 Oct 2006
Posts: 70

PostPosted: Thu May 09, 2013 4:18 am    Post subject: Reply with quote

stevel: I do not see anything on that page which addresses building the toolkit on my buildhost (desktop), for use to build arduino binaries on my laptop.
cwr: That's what I did, but from a certain position, it seems a bit of an oversight that we cannot build binary packages for this purpose on our build hosts. Perhaps I'm not realizing the complexity of binary packages for this.
Thanks all,
James
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 3791
Location: The Peanut Gallery

PostPosted: Thu May 09, 2013 7:11 am    Post subject: Reply with quote

cctsurf wrote:
stevel: I do not see anything on that page which addresses building the toolkit on my buildhost (desktop), for use to build arduino binaries on my laptop.

That's what crossdev is. See this guide to using Arduino Uno. Be sure to read it all and check the wiki page mentioned.
_________________
creaker wrote:
systemd. It is a really ass pain

update - "a most excellent portage wrapper"

#friendly-coders -- We're still here for you™ ;)
Back to top
View user's profile Send private message
cctsurf
n00b
n00b


Joined: 12 Oct 2006
Posts: 70

PostPosted: Thu May 09, 2013 7:44 pm    Post subject: Reply with quote

Stevel, crossdev makes a compiler for the local computer so that on that computer I can build binaries for another hardware, I was using distcc with crossdev back in 2004, however, my problem is that I cannot build a binary package of the toolkit for arduino on my desktop for installation on my laptop so that I can compile arduino binaries on the laptop. At least that was my question, how do I do this? I essentially followed that post in preparation to use my desktop for arduino compilation, and I have now done the same for my laptop as well, however, I was not looking to compile binutils, gcc, etc on my laptop because its processor is quite slow in comparison to my desktop. (yet sufficient to compile small arduino binaries) I wanted to build the cross-avr/gcc, binutils, etc into binary packages on my desktop and then install them on my laptop as I do with all of my other gentoo ebuilds.
What I do is I have a chroot in which I do all of my compiling for my other computers on my desktop and build binaries into a /portage/packages directory dedicated to that architecture. I can then install them using emerge --usepkgonly on those other computers. I am missing this functionality for crossdev.
If you have a way in which to do this, I am wide open to it. This, in my experience is not a normal function of crossdev, I could perhaps be wrong, but I have not seen it in the normal howtos...
Thank You,
James
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 33617
Location: 56N 3W

PostPosted: Thu May 09, 2013 8:04 pm    Post subject: Reply with quote

cctsurf,

What you want is to build binaries on your build host that will run on another target to emit code for your arduino.
Its called a Canadian cross. I'm fairly sure crossdev supports this, see 1.c. Environment Variables but I've never needed it.

That last link does not cover a Canadian cross but from the environmental variables, it looks like its supported.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
cctsurf
n00b
n00b


Joined: 12 Oct 2006
Posts: 70

PostPosted: Thu May 09, 2013 8:19 pm    Post subject: Reply with quote

At least I have a name for it now! THANKS! :)
I'm sure I'm going to have to work it out a bit to get it to work but I can now search for the correct info!
Thanks again,
James
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 3791
Location: The Peanut Gallery

PostPosted: Thu May 09, 2013 10:48 pm    Post subject: Reply with quote

Yeah what Neddy said: this is the only time where it's valid to use CTARGET (or rather, to set it differently than CHOST.)

Just always bear in mind: CBUILD = your desktop, CHOST = laptop and CTARGET = arduino but only when you're building binutils (ie toolchain stuff.) The rest of the time, ie for every other package, CBUILD = desktop or laptop, and CHOST = CTARGET = arduino.

So long as you understand the difference between CHOST and CTARGET, and more importantly why neither is CBUILD, you'll be fine. People get mixed up because embedded folk tend to just talk about host = build-host (CBUILD) and target board. Just remember embedded 'target' is CHOST whenever you build a package to run on it, and don't ever mess with CTARGET except for Canadian-cross.

So desktop: CBUILD = desktop, CHOST = laptop, CTARGET = arduino -- for toolchain, otherwise CHOST = arduino (if you're building packages for the arduino.)
on laptop: CBUILD = laptop, CHOST = arduino, CTARGET = arduino

CBUILD should be set for you by portage; CTARGET defaults to the same as CHOST. All are mentioned in man make.conf, though the description of CHOST is a bit misleading.
Back to top
View user's profile Send private message
cctsurf
n00b
n00b


Joined: 12 Oct 2006
Posts: 70

PostPosted: Fri May 10, 2013 3:08 am    Post subject: Reply with quote

What I'm still looking for is how to install what I build on my buildhost (desktop), on my laptop. With normal ebuilds, it's easy to make a binary package to install, is there a way to do this using crossdev? I pretty much understand the CBUILD, CHOST, CTARGET stuff, but even when I set buildpkg as the emerge option, I don't get packages out of it.
Thanks again,
James
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 3791
Location: The Peanut Gallery

PostPosted: Fri May 10, 2013 10:38 am    Post subject: Reply with quote

I take it you're using ROOT for the chroot for the laptop? Along with PORTAGE_CONFIGROOT as well: the latter is not so well-known apparently, but it's vital to the whole process. See man emerge: it's got a --config-root option as well, which I'll have to add to update (it's respected both of those for years, but not the switches, though they would get passed through to portage.)

Anyhow once you've setup your toolchain, it should be in place on the build-machine to use as target-triplet-cc et al, for the emerge process using CONFIGROOT whose make.conf tells it what CHOST and so on.

I'm not sure how you install the crossdev built toolchain on the laptop. Can I ask why you don't just compile the toolchain on the laptop, given that it's sufficient to build packages for the arduino?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum