[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

cross-compiling the kernel



Although I haven't yet got the machine to run it on (ladder to the
loft's gone missing) I just tried cross-compiling a kernel for ARM.

I built the cross compiler using egcs-1.1.2-arm-diff-990325 and
binutils-2.9.1.0.19a-arm-diff-981230 (diffs from
ftp://ftp.netwinder.org/users/p/philb/).

I took the include files from the libc-5.4.46 source. (Is that the
right place to get them from?) And I configured egcs with
--target=arm-elf.

There were the usual problems with "make cross": it keeps stopping
with errors and I have to install bits by hand or put them on the PATH
to make it continue.

As an interesting extra, I had to do the last part of the build, but
not the first bit, with -D__STRICT_ANSI__ to stop __loff_t (__)?llseek
from giving errors in unistd.h.

When "make cross" has got far enough - it doesn't actually finish - I
install 9 programs and the library libgcc.a by hand.

Is libgcc.a supposed to be an ingredient to the kernel? I built the
kernel for SPARC without using any libraries, I think.

ARMed (ha, ha) with my cross-compiler I attempt to compile
linux-2.2.8-rmk1: make ARCH=arm CROSS_COMPILE=/whatever config, etc,
but I needed a few hacks:

In include/coda.h I added a typedef for u_quad_t. (There are several
there already, but the #ifdefs miss them out.)

In include/string.h I removed the prototypes for memset and a few
other mem-functions that the compiler thinks are built in.

I supplied -DSEGMENT_SIZE=1024. But what is the _correct_ value?

My general questions, to anyone who wants to help me, are:

Is there a better way of doing any of this?

Is my cross-compiler generating code for 26-bit or 32-bit versions of
ARM, or both? Which is the relevant bit in e_flags? (From objdump -x I
get 0x11 on the *.o files and 0x112 on vmlinux.)

Edmund


Reply to: