6.8. Linux-2.4.34.5 API Headers

The Linux API Headers expose the kernel's API for use by libc.

User Notes: http://wiki.linuxfromscratch.org/hlfs/wiki/linux-kernel

6.8.1. Installation of Linux API Headers

The Linux kernel needs to expose an Application Programming Interface (API) for the system's C library to utilize. This is done by way of sanitizing various C header files that are shipped in the Linux kernel source tarball.

This patch modifies the asm-i386/unistd.h header to use position independent assembly code if the compiler defines __PIC__. This is needed so that software which uses this header will be PIC. This header was deemed obsolete and was removed from the 2.6.19 series Linux kernel, so this issue will never be corrected upstream. Apply this patch with the following command:

patch --no-backup-if-mismatch -Np1 -i \
    ../linux-2.4.34.5-unistd_x86_PIC-1.patch

The meaning of the command option:

--no-backup-if-mismatch

The option tells patch not to create backup files so that we do not copy them to /tools/include when we install the kernel headers in the next step.

Install the header files:

make mrproper
make include/linux/version.h
make symlinks
cp -vHR include/asm /usr/include
cp -vR include/asm-generic /usr/include
cp -vR include/linux /usr/include
touch /usr/include/linux/autoconf.h

6.8.2. Contents of Linux API Headers

Installed headers: /usr/include/{asm,linux}/*.h

Short Descriptions

/usr/include/{asm,linux}/*.h

The Linux API headers