Jump to content
funtoo forums
  • 0
Sign in to follow this  
iwoloschin

Setting up Cross Compiler for ARMv7?

Question

I'm exploring Funtoo for both a desktop (x86_64) as well as my Beaglebone Black (armv7).  I've got it working great on my desktop but I'm struggling to get a cross compiler set up on my desktop since I obviously don't want to be compiling a bunch of stuff on a small ARM system.  I know I technically can get away with just the armv7 stage 3 and the kernel from BBB, but I'd like to be able to re-create everything on my own.

 

For what it's worth, I'm doing something similar at work on an Ubuntu 12.04 system and it was pretty easy to get a functioning cross compiler.  I realize this might not be a major goal for Funtoo, but I'd like to try to get this working since everything else about Funtoo has been great!

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I have set up a cross compiler successfully in the past, but I've been having trouble lately myself. In fact, I recently had to downgrade crossdev to version 20140729 because I kept getting errors with the newest crossdev (see http://forums.gentoo.org/viewtopic-t-1003288-highlight-crossdev.html ). So that might be the first thing to try. If you still have problems after downgrading to a working crossdev, post the errors you're getting.

 

In case you need it, here's the Funtoo crossdev guide: http://www.funtoo.org/Cross-compiling_with_Crossdev

 

Oh, and in the interest of full disclosure, I'm currently using gcc ebuilds from the toolchain overlay and not the Funtoo-provided gcc ebuilds, so it's possible that any issues I may experience with gcc and/or crossdev may not be representative of what would occur if using all Funtoo-provided ebuilds. I started using the toolchain overlay primarily because the early Funtoo-specific gcc ebuilds omitted some features which I use (such as graphite), but those appear to have been added back. So I may switch back eventually.

Share this post


Link to post
Share on other sites
  • 0

You'll find it's quite easy in Funtoo also if you follow the guide that paddymac linked to.  I use cross-compiling environments extensively here, works great for a couple of years.

It's interesting what paddymac has to say about the gcc builds, as the guide points out, you cannot use funtoo gcc ebuilds per angry vincent and my own experience.  The features may have been added back, but you still won't get them to work with crossdev.  But the info about the toolchain overlay is new to me, I may have to try that.

I also find 20140729 to be the latest working crossdev as per that bug report.

 

 

I'm exploring Funtoo for both a desktop (x86_64) as well as my Beaglebone Black (armv7).  I've got it working great on my desktop but I'm struggling to get a cross compiler set up on my desktop since I obviously don't want to be compiling a bunch of stuff on a small ARM system.

I make my own ARM flattened device tree kernels from vanilla-sources on my x86_64, no problem, < 1/2 hour.  Heh, my dockstar has just hit hour 25 compiling sys-devel/gcc-4.8.3.  It'll do it though.  It's the one tough thing, gcc, but not as tough for your beaglebone, the dockstar only has 118M memory so it's swapping alot.  Fortunately the toolchain doesn't get updated that often.  You can cheat by making a qemu ARM environment, downloading the latest stage3 and repackaging the gcc from it.

Share this post


Link to post
Share on other sites
  • 0

Awesome, thanks guys.  I'm definitely spoiled by getting cross compiling working so easily on Ubuntu, but that's ok.

 

 

 

I make my own ARM flattened device tree kernels from vanilla-sources on my x86_64, no problem, < 1/2 hour.  Heh, my dockstar has just hit hour 25 compiling sys-devel/gcc-4.8.3.  It'll do it though.  It's the one tough thing, gcc, but not as tough for your beaglebone, the dockstar only has 118M memory so it's swapping alot.  Fortunately the toolchain doesn't get updated that often.  You can cheat by making a qemu ARM environment, downloading the latest stage3 and repackaging the gcc from it.

 

Have you tried doing anything with distcc?  This was my thought, basically set up Funtoo on the BBB but not let it compile anything itself, rather make sure the desktop is on and let my desktop do the heavy lifting.  I've never tried cross-compiling via distcc, though I imagine it should work (provided you've got the correct cross compiler set up!).

 

I should have time in a couple of days to give this a shot, so we'll see if I can get it working.

Share this post


Link to post
Share on other sites
  • 0

Oh yes, distcc IS my primary purpose in setting up the cross-compilers.  I have two x86_64 machines, they do all the work, the ARMs, I use pump emerge with -j8 or 10.  Making kernels is just icing on top.

I actually have a dockstar and then got a pogoplug mobile a few months ago when they were blowing them out for $7/shipped.  So it is the compile workhorse, the dockstar just emerges packages from it, essentially the same machine.  Works well.  I depend heavily on the dockstar, asterisk server, etc., so it's all a win-win, it's just coasting all the time.

Only gcc is tough, seems like last time it took the pogoplug 23 hours, I can live with that LATEST UPDATE: 43 hours & still going (but near the end I think)  :lol:

I'll have to give the qemu chroot another try.  Tried it once, it seemed slower on the x86_64 then it was on the ARM, and it's my daily user, didn't want it tied up.  But now I have a spare x86_64, so...I don't know, nothing could be worse than this swap hell.  Although, it's the only thing the pogoplug has to do, so I guess not a big deal.

Most of gcc will not use distcc and I suspect it's locked to make -j1, that's where the problem lies.  And I've never gotten the cross-compiler to make it.  The cheat I mentioned above works, but I'd like to solve this and not depend upon that.

But you won't have a problem with that 1G onboard ram, I've got free -s 30|tee <file> going, it's never used more than 500M swap on this emerge.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...