Fedora Linux Support Community & Resources Center
Old 9th February 2007, 01:00 AM
Pinn2 Offline
Registered User
Join Date: Oct 2006
Location: Kent
Posts: 49
Cross Compile Howto?

Hi All

I've Googled around and searched here without success so can someone possibly point me in to right direction.

I have a few old Sony Picturebook machines that are 266Mhz Pentium II based and only 64MB of RAM, while they are pretty useless for most things they have 1024x480 screens and built in cameras and are therefore extremely useful for monitoring type applications (Ethereal, SNMP etc type stuff). I've got one setup with FC4 and XFCE and while functional it's painfully slow (mainly due to thrashing).

Due to the restrictions of FC5 and FC6 requiring a minimum of 128MB to do the installation I decided to compile my own Kernel based upon 2.6.20 to install on the machine, stripping out all the drivers and modules I don't need (this should reduce the footprint quite dramatically), I'll probably also end up compiling my own XFCE version once I've done the compile on the machine.

Now while there are a few HOWTO's around on compiling the Kernel I don't intend to compile the Kernel on a 266Mhz machine when I have a perfectly good Core 2 Duo machine that'll do it in a fraction of the time. Therefore can anyone point to a good up to date Howto on cross compiling using the GCC compiler? Else can anyone give me advice on how to go about it?


Reply With Quote
Old 9th February 2007, 04:18 AM
Jman Offline
Registered User
Join Date: Mar 2004
Location: Minnesota, USA
Age: 31
Posts: 7,909
Pentium II is an i686 class processor. So, install i386 Fedora on Core 2 Duo machine and build minimal i686 kernel.

It can be done on x86_64, I forget how.
Reply With Quote
Old 7th April 2008, 03:08 AM
fakie_flip Offline
Registered User
Join Date: Dec 2006
Posts: 214
I'm having no luck with cross compiling either. The crossdev script is for Gentoo only using distcc. I'm trying to use distcc to compile enlightenment and other things on a slow Debian p2 machine from a faster x2 amd 64 Fedora 8 machine.
Reply With Quote
Old 7th April 2008, 03:14 AM
Seve Offline
Retired Community Manager
Join Date: Oct 2004
Location: The GTA, Ontario, Canada
Age: 59
Posts: 12,371
Hello :
What exactly are you trying ?
Are you trying to compile 32bit on a 64bit system etc.?

Effective cross-compiling is not neccesarily that easy do do...

You might want to consider using something like Vmware-server or VirtualBox to install the OS / with the architecture that you want and use that installation to compile the native program.

Just a thought

Registered Linux User: #384977
.................................................. ............
See the Links below for more Help and those much wanted extras ... :)
Reply With Quote
Old 7th April 2008, 03:35 AM
Posts: n/a
I've done a huge amount of cross compiling for embedded linux systems and ... I sort of agree with Seve.

You can build a cross compiler easily enough. Search for the terms "kegel" and "crosstools" and you'll have a nicely scripted cross gnu tool builder. *IF* you are developing your own code and don't need more than a compiler and host make .. then that's pretty good. *BUT* you have to be very careful about making the target code only include and link to the target include files and libraries.

The big headache is that most packages aren't written for cross compilation and the configure script is always trying to peek at the host environment when it should be looking at the target environment. These look at /usr/include or /lib of the host when instead they must look at the target environment. Many of the major packages do work properly, and there have been several partial solutions to this problem ... scratchbox.org for example.

Qemu emulates several target architectures, not just i686 & x86_64 but also PPC, PPC64, Sparc, MIPS, m68k, SH-4 and several others.
Reply With Quote
Old 7th April 2008, 04:07 AM
Posts: n/a
Sorry - I went off-topic above. If you just need to recompile a kernel to i686 on a x86_64 machine install an i686 distro under qemu-kvm ( I hope you have the vmx hardware feature). Build the kernel
and move-on.

Also fwiw the crosstools compiler will nicely produce a kernel too, since the kernel has only internal .h dependencies and no library dependencies.

I don't think you'll save as much space as you expect in a trimmed down kernel. You can just delete the excess modules and that's about it. The i686 module tree on Fedora is only 55MB and it only appears on disk (not memory) until you load a module. As a rule you only load modules you need to there is at most a ~54MB disk saving and a tiny memory saving.

The bigger problem are the mammoth libraries associated with KDE and especially Gnome. Big slow memory hogs in recent years. You're using XFCE and still having problems in 64M ! That's bad.

So perhaps you should consider installing distro aimed at a small memory profile.
Not sure but puppylinux and DSL come to mind.


Also recompiling XFCE won't help much. You have to attack the Xorg bloat ad that's a big task.

Last edited by stevea; 7th April 2008 at 04:16 AM.
Reply With Quote
Old 7th April 2008, 10:05 AM
sideways Offline
Retired User
Join Date: Oct 2004
Location: London, UK
Posts: 4,999
Seve's idea of using a virtual machine would be ideal in this senario, you can even download a ready made fedora vmware image from here (although it would be better to create your own from the fedora install disk using vmware server, that way you ensure all development packages etc are loaded)

I've cross-compiled for arm based systems on a fedora machine using a scratchbox sandbox environment (nice howto here, and a bugfix for fedora) but that is more complicated to set up and unnecessary in this case

Last edited by sideways; 7th April 2008 at 10:17 AM.
Reply With Quote
Old 7th April 2008, 08:59 PM
akrao Offline
Registered User
Join Date: Mar 2008
Posts: 1
how to install pythan
Reply With Quote
Old 8th April 2008, 09:46 AM
fakie_flip Offline
Registered User
Join Date: Dec 2006
Posts: 214
Can I run a 32 bit kernel in Userspace Mode Linux? I think that would work to compile the most effiecient using resouces. VMware will take away a lot of my resources to run it.
Reply With Quote

compile, cross, howto

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
cross-compile kernel on F8 phe Using Fedora 4 15th September 2008 06:42 PM
Cross compile source RPM package xholer Using Fedora 8 14th July 2007 06:02 PM
Cross-Compile The_Jaymz Programming & Packaging 2 12th October 2006 10:31 PM

Current GMT-time: 08:51 (Thursday, 24-08-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat