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

Re: cross-compiling the kernel



>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.

You don't need C library include files to build the kernel.  For Linux you 
should configure the compiler as `--target=arm-linux' - this differs from 
arm-elf in various subtle ways.  For an ARM3 machine you actually want to use 
`armv2-linux' to set the default to be APCS-26.

>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.

FWIW, gcc 2.95 should be a lot better in this department when it's released.  
If you'd like to try a prerelease version let me know and I will point you to 
the sources.

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

For the ARM you do need libgcc.a, yes.  (On the SPARC the relevant routines 
are actually included in the kernel source which is how you can do without.)

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

Why did you need this?  I'm surprised you had so much trouble with the kernel 
- I typically cross compile the kernel several times a day and don't have any 
problems.

>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.)

It's bit 3.  That said I'm not sure that binutils 2.9.x actually remembers to 
set that flag when it generates APCS-26 code, so this may not help you.  The 
cross compiler is almost certainly targeting APCS-32 though unless you've told 
it otherwise.

You can override this with "-mapcs-NN" on the compiler command line.  We used 
to have this happen by default in the kernel makefiles, but I took it out 
because there is a gotcha in that you also need a matching libgcc.a, and by 
default only one version of this is built.

p.



Reply to: