2

I'm trying to build a toolchain from scratch for ARM Integrator target machine. I started by building binutils and it is OK. Now I have to generate kernel headers and I don't know how to do this in the right way. Any help will be useful.

Walidix
  • 1,247
  • 5
  • 17
  • 27
  • I'm not sure you only generate the kernel headers. You configure and build an entire kernel, & the headers are part of the result. E.g. on debian `make-kpkg binary` generate both the image and the headers packages. – Basile Starynkevitch Jul 28 '12 at 18:39
  • After binutils you should build a GCC cross-compiler, then a kernel, then a GNU libc cross-library... – Basile Starynkevitch Jul 28 '12 at 21:35

1 Answers1

3

I searched a lot for this, in order to cross compile gcc.

This example involves the source of linux-3.9.

#cd to the top directory of the kernel source
cd linux-3.9
make mrproper
make ARCH=arm integrator_defconfig
make ARCH=arm headers_check
make ARCH=arm INSTALL_HDR_PATH=$SOMEWHERE headers_install

variable $SOMEWHERE is where you want it extracted.

What if you want something else than integrator? How to find out? Assuming your are still at the top directory of the kernel's source tree, here are the other _defconfig you could use:

ls /arch/arm/configs/*

Idem for other architectures.

Note: If you build a cross toolchain with newlib instead of glibc, you do not need kernel headers. Which library should you use? It depends of your needs. newlib is aimed at embedded solutions.

Sources:

http://pmc.polytechnique.fr/pagesperso/dc/arm-en.html

http://www.ifp.illinois.edu/~nakazato/tips/xgcc.html

http://www.gentoo.org/proj/en/base/embedded/handbook/?part=1&chap=2

pbarill
  • 640
  • 8
  • 16