View previous topic :: View next topic |
Author |
Message |
cctsurf Tux's lil' helper
Joined: 12 Oct 2006 Posts: 123
|
Posted: Sat May 04, 2013 1:08 am Post subject: Building Crossdev Binary Packages |
|
|
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 |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Sat May 04, 2013 4:45 am Post subject: |
|
|
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 |
|
|
cwr Veteran
Joined: 17 Dec 2005 Posts: 1969
|
Posted: Sun May 05, 2013 10:47 am Post subject: |
|
|
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 |
|
|
cctsurf Tux's lil' helper
Joined: 12 Oct 2006 Posts: 123
|
Posted: Thu May 09, 2013 4:18 am Post subject: |
|
|
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 |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Thu May 09, 2013 7:11 am Post subject: |
|
|
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 |
|
|
cctsurf Tux's lil' helper
Joined: 12 Oct 2006 Posts: 123
|
Posted: Thu May 09, 2013 7:44 pm Post subject: |
|
|
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 |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54234 Location: 56N 3W
|
Posted: Thu May 09, 2013 8:04 pm Post subject: |
|
|
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 |
|
|
cctsurf Tux's lil' helper
Joined: 12 Oct 2006 Posts: 123
|
Posted: Thu May 09, 2013 8:19 pm Post subject: |
|
|
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 |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Thu May 09, 2013 10:48 pm Post subject: |
|
|
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 |
|
|
cctsurf Tux's lil' helper
Joined: 12 Oct 2006 Posts: 123
|
Posted: Fri May 10, 2013 3:08 am Post subject: |
|
|
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 |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Fri May 10, 2013 10:38 am Post subject: |
|
|
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 |
|
|
|