ARM cross-compiling howto

Sunday, August 28. 2005

ARM cross-compiling howto

This small howto will explain how to build a cross compiling toolchain for the ARM platform and how to cross compile various programs and libraries. I've written this howto during my endeavours creating my own linux distribution for the Compaq iPAQ H3600 which is powered by a StrongARM 1100 processor. My host platform is x86 compatible (An Intel Pentium III to be accurate) but maybe this howto is also valid for other host platforms.

Note: I'm currently no longer active in cross-compiling. I can't guarantee that this howto will work for you and I can't give you any support for it and I'm most likely not going to update this howto anymore. If you are currently fiddling with cross-compiling you already have more know-how than I have now. If you are new to cross-compiling you definetly want to take a look at Dan Kegel's crosstool.

Building cross-compiling toolchain
Required sources

I suppose you have no access to any precompiled ARM software so I'll explain how to build a cross compiling toolchain from the ground up, including glibc.

You need the following source packages to go on:

Package Used version Download
Linux Kernel 2.4.17 ftp.kernel.org
ARM Kernel patch 2.4.17-rmk4 ftp.arm.linux.org
binutils 2.11.2 ftp.gnu.org
gcc 2.95.3 ftp.gnu.org
glibc 2.2.4 ftp.gnu.org
glibc linuxthreads add-on 2.2.4 ftp.gnu.org
binutils

Unpack the binutils tarball into a temporary directory, change to the unpacked binutils directory and run the following commands:

# ./configure --target=arm-linux
# make
# make install

You have now some arm-linux-* binaries in /usr/local/bin. These are the binutils used by the cross-compiling toolchain. And you'll find the new directory /usr/local/arm-linux/. This is where the cross-compiling toolchain will be installed.

You can check if the binutils are compiled correctly by calling arm-linux-ar. This tool outputs the supported targets in its command line help. You should find targets like elf32-littlearm there.

Linux Kernel header files

To compile gcc we need some header files from the linux kernel source. Unpack the kernel source code in a temporary directory and change to the unpacked source directory. You'll need to patch the kernel with the ARM kernel patch. You do this by running this command:

# zcat path-to-arm-patch/patch-2.4.17-rmk4.gz | patch -p1

Now you need to configure the kernel by calling this command:

# make menuconfig ARCH=arm

Notice that you need to specify ARCH=arm otherwise you are going to configure the kernel for your host architecture which maybe a x86 machine.

You don't need to do a complete configuration unless you want to compile the kernel now. Up to now you don't have a cross compiler so you can't compile it anyway. All you need to do is to select the correct processer type. In my case I have selected SA1100-based in ARM system type and Compaq iPAQ H3600/H3700 in SA11x0 Implementations. Now save the configuration and call the following command to finish the kernel configuration:

# make dep

Now copy the include files from the kernel source to the toolchain directory:

# mkdir /usr/local/arm-linux/include
# cp -dR include/asm-arm /usr/local/arm-linux/include/asm
# cp -dR include/linux /usr/local/arm-linux/include/linux

Finally change to the toolchain directory and create a symbolic link from include to sys-include:

# cd /usr/local/arm-linux/
# ln -s include sys-linux

gcc, which we will compile now, is searching for the include files in sys-linux by default. You can use the --with-headers configure-option to specify an other directory but this results in copying the specifed directory to sys-linux. So I think it's better to create a symbolic link to avoid redundant files.

gcc

Unpack the gcc source code and change to the unpacked source directory. We currently don't have a running glibc so we can't compile the whole compiler suite. But for now it is enough to compile only the C compiler. Later we can compile the glibc with this cross compiler and after that we can compile the whole compiler suite.

It may be necessary to modify the gcc source a little bit. I have done this because otherwise I was not able to compile, I got these error messages:

./libgcc2.c:41: stdlib.h: No such file or directory
./libgcc2.c:42: unistd.h: No such file or directory
.make[3]: *** [libgcc2.a] Error 1

There are rumors that it is not always needed. If you think (or know, or learn) that you need it, edit the file gcc/config/arm/t-linux, search this line:

TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC

And change it to this:

TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC -Dinhibit_libc -D__gthr_posix_h

Now configure the source code, compile and install:

# ./configure --target=arm-linux --disable-threads --enable-languages=c
# make
# make install

You have now a running cross compiler (/usr/local/bin/arm-linux-gcc) but without glibc it is not really useful. So let's cross-compile that beast.

glibc

Unpack the glibc tarball in a temporary directory as usual. Then switch to the unpacked source directory and unpack the linuxthreads add-on into it:

# tar xvfz glibc-2.2.4.tar.gz
# cd glibc-2.2.4
# tar xvfz ../glibc-linuxthreads-2.2.4.tar.gz

Now set the environment variable CC to arm-linux-gcc because we want the glibc to be cross-compiled for the ARM platform. Then configure, compile and install the beast:

# export CC=arm-linux-gcc
# ./configure arm-linux --target=arm-linux --prefix=/usr/local/arm-linux --enable-add-ons
# make
# make install

Be sure you use the --prefix parameter correctly, otherwise you mess up your hosts glibc installation.

You'll now find a lot of new files and directories in /usr/local/arm-linux. These are the glibc headers, libraries and utitilies.

Notice that you can't use this compiled glibc on the target machine because of the specified prefix. If you want to compile a glibc which you can copy to your target machine, use an empty prefix (--prefix=) instead and use the install_root parameter to specify the installation directory:

# make install install_root=/path/to/target/root

Finally, make sure you unset the CC environment variable (with unset CC), because in the next step we are going to recompile the cross compiler and we don't want to cross-compile the cross-compiler. ;-)

gcc (Second try)

Now we have a cross compiled glibc so we can now go on and compile the whole gcc compiler suite.

You can use the already unpacked source code of gcc but you have to remove the changes you have made and you should call make distclean to clean up the source. To be sure to do it right I suggest you delete the old source directory and unpack the gcc sources again. Whatever, after you have a clean gcc source directory, change into it, configure the source, compile and install it:

# ./configure --target=arm-linux
# make
# make install

If compilation fails because PATH_MAX is undeclared in basicio.c then add the following line to the file libchill/basicio.c somewhere between all the other includes at the top of the file:

#include <linux/limits.h>

Call make again and it should compile fine now.

That's it. You should now have a working cross-compile toolchain for the ARM platform. If you want to cross-compile a program just set the CC environment-variable to arm-linux-gcc and compile the program as usual.

Cross-compiling various libraries
Cross-compiling Berkeley DB

Used version: db-4.0.14.tar.gz

After you have unpacked the sources change to the directory build_unix:

# cd db-4.0.14/build-unix

Now the source code needs to be configured. The Berkeley DB uses autoconf and uses compiled programs to test various things. This won't work during cross compile so these checks has to be overridden. That's what all the environment variables in the following command are doing:

# db_cv_sprintf_count=yes \
db_cv_fcntl_f_setfd=yes \
db_cv_mutex="no" \
db_cv_alignp_t="unsigned long" \
CC=arm-linux-gcc \
../dist/configure --host=arm-linux --prefix=/usr

This configures the sources to cross-compile for the ARM platform and to use /usr as install prefix. Note: If you are going to use this library in your cross-compiling toolchain and not on the target machine you have to specify the prefix /usr/local/arm-linux or wherever your toolchain is installed.

To compile the sources, just type:

# make

Now install the binaries:

# make install prefix=<root-directory> strip=arm-linux-strip

If you are going to use this library in your cross-compiling toolchain you don't need to specify prefix because the configured one is already the right one.

Cross-compiling ncurses

Used version: ncurses-5.2.tar.gz

After you have unpacked the sources change to the source directory:

# cd ncurses-5.2

Now configure the source:

# CC=arm-linux-gcc \
./configure arm-linux --target=arm-linux --with-shared --prefix=/usr

Note: If you are going to use this library in your cross-compiling toolchain and not on the target machine you have to specify the prefix /usr/local/arm-linux or wherever your toolchain is installed.

To compile the sources type this:

# make HOSTCC=gcc CXX=arm-linux-c++

HOSTCC is needed because some tools needs to be compiled for the host system. The documentation says this variable has the name BUILD_CC but this is wrong. Never trust documenations ;-)

Now install the files:

# make install DESTDIR=<root-directory>

If you are going to use this library in your cross-compiling toolchain you don't need to specify prefix because the configured one is already the right one.

Cross-compiling Linux-PAM

Used version: Linux-PAM-0.75.tar.gz

After you have unpacked the sources change to the source directory:

# cd Linux-PAM-0.75

The configure script of Linux-PAM seems to be realy ugly. Some commands are hardcoded and it seems not to be possible to override them. So you have to modify the configure script a little bit. Here is the mapping from which you can see what you need to search and with what you have to replace it:

Search for Replace with
GCC=gcc GCC=arm-linux-gcc
LD=ld LD=arm-linux-ld
LD_D="gcc -shared -Xlinker -x" LD_D="$CC -shared -Xlinker -x"

Now you can configure the source for cross-compiling:

# ./configure arm-linux --target=arm-linux --prefix=/usr

Note: If you are going to use this library in your cross-compiling toolchain and not on the target machine you have to specify the prefix /usr/local/arm-linux or wherever your toolchain is installed. Additionaly you need to specify the following parameter, otherwise some include files are installed in the wrong place:

--enable-includedir=/usr/local/arm-linux/include

To compile the sources, just type:

# make

Now install the files:

# make install FAKEROOT=<root-directory>

If you are going to use this library in your cross-compiling toolchain you have to use this command to install the files:

# make install \
DOCDIR=/usr/local/arm-linux/share/doc/Linux-PAM \
MANDIR=/usr/local/arm-linux/share/man

Note that the binaries are not stripped automatically so you have to do this manually if needed.

Cross-compiling zlib

Used version: zlib-1.1.4.tar.gz

After you have unpacked the sources change to the source directory:

# cd zlib-1.1.4

Now the source code needs to be configured. If you want to compile a static version of this library use this configure command:

# CC=arm-linux-gcc \
./configure --prefix=/usr

Building a shared version is a little bit more complicated:

# CC=arm-linux-gcc \
LDSHARED="arm-linux-gcc -shared -Wl,-soname,libz.so.1" \
./configure --shared --prefix=/usr

Note: If you are going to use this library in your cross-compiling toolchain and not on the target machine you have to specify the prefix /usr/local/arm-linux or wherever your toolchain is installed.

To compile the sources, just type:

# make

Now install the binaries:

# make install prefix=<root-directory>

If you are going to use this library in your cross-compiling toolchain you don't need to specify prefix because the configured one is already the right one.

Note that the binaries are not stripped automatically so you have to do this manually if needed.

Cross-compiling various programs
Cross-compiling bash

Used version: bash-2.05a.tar.gz

After you have unpacked the sources change to the source directory:

# cd bash-2.05a

There is a small bug in the Makefile template that prevents cross-compiling. To fix it edit the file Makefile.in and search for this part:

bashversion$(EXEEXT): patchlevel.h conftypes.h version.h version.o $(SUPPORT_SRC)bashversion.c
$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) $(CPPFLAGS) -o $@ $(SUPPORT_SRC)bashversion.c version.o

Now replace the two occurences of version.o with version.c so it looks like this:

bashversion$(EXEEXT): patchlevel.h conftypes.h version.h version.c $(SUPPORT_SRC)bashversion.c
$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) $(CPPFLAGS) -o $@ $(SUPPORT_SRC)bashversion.c version.c

The reason behind this is: The binary bashversion needs to be compiled for the build platform. But version.o is been compiled for the target platform so it can't be linked. So we simply replace the object file with the source file. In this case the source file is compiled again but this time for the correct platform.

Now the source code needs to be configured. Bash uses autoconf and uses compiled programs to test various things. This won't work during cross compile so these checks has to be overridden. That's what all the environment variables in the following command are doing:

# ac_cv_sys_restartable_syscalls=yes \
ac_cv_func_setvbuf_reversed=yes \
./configure --build=i386-linux --host=arm-linux --enable-readline --prefix=/

This configures the sources to cross-compile for the ARM platform and to use / as install prefix. You'll see some warnings, that's because some checks fail and default values are used. I think these default values are ok so I don't override them like the other two ac-options above.

To compile the sources, just type:

# make

Now install the files:

# make install prefix=<root-directory>

Note that the root-directory must be an absolute path. Relative paths will not work.

If you get the error message unknown option --dir-file your texinfo installation is pretty old. This may happen if you are running Debian GNU/Linux. If you can't (or don't want to) update your texinfo installation you can do this: Edit the file doc/Makefile.in and search for this part:

install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/bash.info; \

And modify it so it looks like this:

install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/bash.info; \

Now you need to add a dummy dir-file file if it's not already present:

# echo 1 > <root-directory>/info/dir

Now run the above configure command again so the Makefile is regenerated. Now the call to make install should work like a charm.

Note that the installed binaries are not stripped automatically so you have to do it manually by using arm-linux-strip.

Cross-compiling BusyBox

Used version: busybox-0.60.2.tar.gz

After you have unpacked the sources change to the source directory:

# cd busybox-0.60.2

To compile the sources type this:

# make CROSS=arm-linux-

Now install the files:

# make install PREFIX=<root-directory>

Cross-compiling flex

Used version: flex-2.5.4a.tar.gz

After you have unpacked the sources change to the source directory:

# cd flex-2.5.4

Now configure the source:

# CC=arm-linux-gcc \
RANLIB=arm-linux-ranlib \
./configure arm-linux --target=arm-linux --prefix=/usr

Note: If you are going to use this program (or better: the included libfl) in your cross-compiling toolchain and not on the target machine you have to specify the prefix /usr/local/arm-linux or wherever your toolchain is installed.

To compile the sources type this:

# make AR=arm-linux-ar

Now install the files:

# make install prefix=<root-directory>/usr

Note that you need to add /usr to the root-directory.

If you are going to use this program in your cross-compiling toolchain you don't need to specify prefix because the configured one is already the right one.

Cross-compiling Python

Used version: Python-2.2.1.tgz

Cross compiling Python is tricky because:

  • The compiled python binary is used to compile and install the modules.
  • The parser generator which is linked to some Python libraries is executed during compilation.
  • The compiled modules are checked if they can be imported. But they can't be imported because they are not running on the host system. These modules are automatically removed which is bad.

I found no way to cross compile Python without modifiying the source code. I created a patch which can be downloaded here. This patch needs to be applied directly after you have unpacked the sources:

# cat python-cross-compiling.diff | patch -p0

Now change to the patched source code directory:

# cd Python-2.2.1

Two programs (python and Parser/pgen) are executed during the cross compilation so we need them to be compiled for the host system. To do this type this:

# ./configure
# make python Parser/pgen

Now rename these two binaries, otherwise they are deleted in the next step:

# mv python hostpython
# mv Parser/pgen Parser/hostpgen

Because we are now going to cross-compile python, clean up the source code first:

# make distclean

To configure the source code for cross-compilation type this:

# CXX=arm-linux-g++ \
CC=arm-linux-gcc \
AR=arm-linux-ar \
RANLIB=arm-linux-ranlib \
./configure arm-linux --target=arm-linux --prefix=/usr

Now comes the tricky part which needs the patch you have applied before. The patch introduces the environment variables HOSTPYTHON and HOSTPGEN so the host-compiled versions of python and Parser/pgen can be executed.

# make HOSTPYTHON=./hostpython \
HOSTPGEN=./Parser/hostpgen \
BLDSHARED="arm-linux-gcc -shared"

This compilation can take some time. Watch out for errors. Maybe some modules are not compiled because your cross-compiling toolchain is missing some libraries like OpenSSL or expat.

The installation of Python also requires to execute the python binary. And during the installation of the python modules a python script checks if the modules can be imported. If not, they are removed. That's bad because all modules can't be imported because they are compiled for the target system. The patch fixes this behaviour by introducing the variable CROSS_COMPILE. If set to yes the modules are not removed if they can't be imported.

To install python type this:

# make install prefix=<Root-directory>/usr \
HOSTPYTHON=./hostpython \
BLDSHARED="arm-linux-gcc -shared" \
CROSS_COMPILE=yes

Notice that you have to specify /usr behind the path to the targets root-directory.

You are done. You should now have a complete working cross-compiled Python suite. Copy it to your target machine and be happy.

Posted in Linux | Comments (38)
Egon at 2007-10-29 11:02
Hi,
thank you very much for your howto. It's a good introduction in this complex area and saved me hours!
Thanks,
Egon
Shashi at 2010-12-22 16:14
Really nice article. Many thanks to you.
vishal at 2008-04-22 08:37
hey thanks for the how to. can u please help me. i'm trying to install udev to edb 9302 board. when i "make" using cross compile i get 3 binary images. i dono how to add the dependant files.. which it looks for...like rules.d etc...
i wanted procedure to install packages to board...


thanks in advance
reza at 2009-03-24 21:51
thank you for this useful web page. it's help me very well to complete my rootfs on rm9200 processor.
best regards
reza
snev at 2009-05-13 15:55
thanks
Quakeboy at 2009-08-13 07:16
Thanks for this awesome tutorial.. You should write more.. please
Harikesh at 2009-08-17 17:14
Hi,
Thanks for this awesome tutorial..
anand at 2009-09-09 12:43
Hi,
I need to do cross compile Python 3.1 in Linux environment. I couldn’t find any patch for Python3.1. Do you have patch for Python3.1?

Thanks & Regards,
Anand
Paul Gibson at 2011-02-17 12:38
A Python 3.1 patch is here:
http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html
dsv at 2009-09-23 16:09
K, Thanks for the excellent page. Please write more.
Amélie at 2009-10-13 12:09
Hi!

I have a question, I search a solution to install Linux Kernel header files

When I write this instruction: # zcat path-to-arm-patch/patch-2.4.17-rmk4.gz | patch -p1

He tell me:
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urN orig/Documentation/Configure.help linux/Documentation/Configure.help
|--- orig/Documentation/Configure.help Thu Dec 20 11:03:46 2001
|+++ linux/Documentation/Configure.help Fri Dec 28 17:39:51 2001
--------------------------
File to patch:

I'm soory but I'm new in Linux and I don't understand.

Thank you for your howto.
Thanks and Regards
Andrea at 2010-02-15 16:35
Hi,
not all linux distro (see Ubuntu) gets the patch command, you can get it by typing apt-get patch
Debabrata Pradhan at 2009-12-14 10:45
I want to cross compile iproute2 package to work on montaVista that is running on TMS320DM6446 davinci processor. Help me out.

I have added the files. when I am running the makefile by changing the gcc to arm-linux-gcc some binary files are not getting executed. the error is like this way::
make[1]: Leaving directory `/root/debabrata/iproute2-2.6.11-050330/misc'
make[1]: Entering directory `/root/debabrata/iproute2-2.6.11-050330/netem'
arm-linux-gcc -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I../include -DRESOLVE_HOSTNAMES -o pareto pareto.c -lm
./pareto >pareto.dist
/bin/sh: ./pareto: cannot execute binary file
make[1]: ** [pareto.dist] Error 126
make[1]: Leaving directory `/root/debabrata/iproute2-2.6.11-050330/netem'
make: **
[all] Error 2
Simon at 2010-01-27 11:31
Thanks - great "HowTo" on cross-compiling libz - saved me a lot of time :)
Yayati at 2010-03-06 07:34
hi!!!Its awesome information....
Please write more.....

Can you tell me how to cross compile an application on Linux x86 platform (as host) and Linux embedded on ARM architecture processor based device (as terget)??
sam at 2010-03-16 10:22
thanks for this information..
but when I compiled the GCC before glibc as per above steps than I got the following error..
./config/arm/arm.c: In function ‘arm_override_options’:
./config/arm/arm.c:286: warning: assignment discards qualifiers from pointer target type
./config/arm/arm.c:530: error: lvalue required as left operand of assignment
make[1]: ** [arm.o] Error 1
make[1]: Leaving directory `/home/anu/Documents/tool-chain-arm/package/gcc-2.95.3/gcc'
make: **
[all-gcc] Error 2



so can you please tell what should I do now. I have taken the packages from the above table.
thanks
gid at 2010-04-08 02:14
I have the same problem. Do anybody know a solution. Im working on ubuntu 9.10 64
Marty at 2010-08-13 08:36
Me too on Debian Lenny Kernel 2.6.26-2-686
andres at 2010-05-25 17:44
i having problem when i put the last code:
it is apearing me this:

Root-directory: No existe el fichero ó directorio

thanks
ajoy at 2010-08-22 16:05
in line 530 file arm.c (/gcc/config/arm) with

arm_prgmode = TARGET_APCS_32 ? PROG_MODE_PROG32 : PROG_MODE_PROG26;

to solve the problem
murat at 2011-01-12 12:09
Hi Klaus,
Do you have experience on how to cross-compile MESA libraries for OpenGL? I want to run an OpenGL program on friendlyarm (mini2440). I think I need to cross compile MESA libraries, however I found no complete article on web on how to do it. If you have any experience or idea how to that, could you please post here?
Thanks
murat
Klaus Reimer at 2011-01-12 14:03
Nope, sorry. Please note that this article is more than 5 years old. I haven't cross-compiled anything since then so I'm afraid I can't help.
murat at 2011-01-12 14:06
No problem, thanks.
Nice article by the way.
bhushan at 2011-03-14 09:01
Do you know how to cross compile Valgrind package for ARMv6?
Fabio at 2011-03-02 17:04
Hi Klaus,

very helpful page (much more than other similar ones around the net), at least for a starter like me with this subject.

I'm using this guide to build up a toolchain for the WonderMedia WMT WM8505 2.6.29 Kernel (for a cheap Android netbook device). My host is a Red Hat (RHEL5) Linux.

But, I need your help for a few points:

1) During the "make dep" step I get:

make: arm-linux-gcc: Command not found

Indeed this is BEFORE we even compile the cross-compiler...

Is this step actually needed right now or I can postpone it?

2) I can't apply the arm patch to my kernel, because of this:

zcat /root/tmp/patch-2.4.17-rmk4.gz | patch -p1
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urN orig/Documentation/Configure.help linux/Documentation/Configure.help
|--- orig/Documentation/Configure.help Thu Dec 20 11:03:46 2001
|+++ linux/Documentation/Configure.help Fri Dec 28 17:39:51 2001

What is the patch for? Does it impact the following step?

3) During gcc compile I get one of the errors you mentioned:

libgcc1.S:438: asm/unistd.h: No such file or directory
make[1]: *** [libgcc1-asm.a] Error 1

but your suggested solution didn't work for me.

Indeed, looking for unistd.h in my kernel include/ I can find it under different directories:

find . -name unistd.h
./asm-mn10300/unistd.h
./linux/unistd.h
./asm-m32r/unistd.h
./asm-frv/unistd.h

but our asm/ (linked to asm-arm/) is missing this file.

I found several people hitting the same error around the world, but no solution worked (I skipped the chinese pages... many of them actually). Any idea about how to fix this?

Thanks in advance and sorry for the long post...
Dexter at 2011-07-05 05:39
I'm running Ubuntu 11.04 on a desktop with an AMD Athlon X2 processor.

I'm trying to build a cross compile toolchain for a GlobalScale GuruPlug Server Plus, running linux kernel 2.6.32.7, in order to compile a driver for and EasyCap usb device, so I can connect a video camera to it.

The linux driver for the EasyCap says I need kernel headers to compile with, and there are none on the GuruPlug.

I tried to follow your directions, but the at the part where I try to apply the patch, well, I get miles and miles of "WTF" sort of output, questions about "assume -R", "apply anyway". Hunks failing right and left.

What am I doing wrong? I'm way out of my comfort zone here, and I could use a little help.
Sraddha at 2011-12-30 15:35
I had these errors/ warnings rather. I did a lil search as to what these warnings are .
1) ISO C does not permit named variadic macros
2)ISO C90 does not support 'long long'

My querry is , will my compiler which is throwing these warnings generate a code which is good and runs without bugs / problems/ errors unseen to the eye. if My compiler is following these standards right . ISO C and ISO C90 , and I may ignore the warnings the code runs fine too . but still not satisfied.

Any answers , explanations you have .
Regards
imxiaozhu at 2012-01-26 10:57
Just want to say thanks for this good article (even though you are not maintaining it anymore).
nikit at 2012-02-08 06:08
i want to know how to compile rtos code in linux through gcc. any software to install for compiling rtos code?
Tine at 2012-03-17 23:03
cc1 is the preprocessor. (gcc ivenkos it automatically)There was an old bug where if you had a folder that started with include when installing gcc you wouldn't get the standard include files in /usr/local. check /usr/local for a folder starting with include back it up and try reinstalling gcc.If you KNOW where the include files are, you can check where cc1 is actually looking with:`gcc -print-prog-name=cc1` -v
rajanikanth at 2012-04-18 05:48
hai, i am using ubuntu 11.10.i had installed the arm cross compiler which is avalible in ubuntu software center. now i want to compile a simple c code for the arm linux on hawk board....
will you people help to how to compile ....asap plz...
rajanikanth at 2012-04-18 15:00
hai, i am using ubuntu 11.10.i had installed the arm cross compiler which is avalible in ubuntu software center. now i want to compile a simple c code for the arm linux on hawk board....
will you people help to how to compile ....asap plz...
j.a.rajanikanth@gmail.com
rashi at 2012-06-14 08:11
hey klaus
I am trying running this command
# zcat path-to-arm-patch/patch-2.4.17-rmk4.gz | patch -p1
but i am getting error
its saying Hunk failed #1 and many other lines
Also it is saying
patching files drivers/ssi/
patching files include/
but everytime is saying
hunk failed
1 out of 1 hunk failed and so on
I am not able to correct this problem.
Also i am trying to go to further step and run
sudo make menuconfig ARCH=arm but its giving error may be due to these hunks failure.
Plzz help me thru this

Thanks
Bob at 2012-09-22 23:51
i am getting this error when trying to run this command make menuconfig ARCH=arm ::


root@ititan:/home/boss/Desktop/ARM/linux# make menuconfig ARCH=arm
rm -f include/asm-arm/arch include/asm-arm/proc
(cd include/asm-arm; ln -sf arch- arch; ln -sf proc- proc)
rm -f include/asm
( cd include ; ln -sf asm-arm asm)
make -C scripts/lxdialog all
make[1]: Entering directory `/home/boss/Desktop/ARM/linux/scripts/lxdialog'
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
-e
>> Unable to find the Ncurses libraries.
>>
>> You must have Ncurses installed in order
>> to use 'make menuconfig'

make[1]: ** [ncurses] Error 1
make[1]: Leaving directory `/home/boss/Desktop/ARM/linux/scripts/lxdialog'
make: **
[menuconfig] Error 2


i am trying to to setup on Ubuntu 12.01.. please help
sadegh at 2013-02-12 13:30
thank for your help
i install this config and its work es but for compiling my program i need gnu99 but this cross compiler dont support thus can use gcc 3.3 or not how this work?
Educational purposes at 2013-03-18 14:54
I understand that the approach described here is good for educational purposes, but if you are lazy and want to build cross-compiler toolchain fast andi without trouble, visit:

http://buildroot.uclibc.org/
AB at 2013-03-30 22:13
I want to cross-compile Python for a embedded system. The target is a PPC but DOES NOT run linux. Instead it runs a lesser known though capable embedded OS and I was wondering if anyone has attempted porting Python to a non-*nix platform before.

I have the cross compilation tool chain installed on a linux machine so I should be able to run the configure script pointing to the target OS/compiler headers and libraries. Also it seems that the Python configure script does not support options such as –with-headers, –with-binutils that would allow me to point it to the correct headers.

Has anybody done a port like this?
dhanesh arole at 2013-05-06 21:03
Can you please little bit about cross-compiling from i386 to ARM based raspberry pi.