WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Crosscompile for Raspberry Pi on x86 LINUX  (Read 4890 times)

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Crosscompile for Raspberry Pi on x86 LINUX
« on: September 30, 2012, 10:23:58 AM »
Hi,

while compiling applications on Raspberry Pi works, for bigger programs, like ncurces, glib2, kernel, etc. it can be painful taking half or a full day just to find at the end a missing compile option, etc. In such case cross compilation on x86 may help. It is cca. 10 times faster, so it can be an alternative.

For sure there can be many different way, I found far the best and easiest to use crosstool-ng This is really a great tool. easy to install from source, no need for a tcz package. After starting you can specify which compiler, library and other tools you want to work with than it will download necessary sources, compile and install them automatically. It is really great! For piCore, compiler itself is not critical, as C library choose eglibc 1.13

In general programs with configure can be compiled on the same way as in native environmanet, just add --host=arm-unknown-linux-gnueabi and --with-sysroot... if it has dependencies (and install those deps dev's of course in sysroot).

In most cases it works. You will find packages need special care. Read INSTALL or other related file in the source or Google for solution.

Use following compiler options for Raspberry Pi:

-march=armv6
-mfpu=vfp
-mfloat-abi=hard

P.S: It is not Raspberry Pi specific, except compiler options and library installed. It works for other architectures too.
« Last Edit: September 30, 2012, 10:29:00 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: Crosscompile for Raspberry Pi on x86 LINUX
« Reply #1 on: November 15, 2012, 12:50:33 PM »
There are *lots* of options in that crosstool menuconfig. I don't know what to choose there?

How do you guys cross-compile your kernels?
Any .tcz available to simplify this?