How can I generate kernel headers for an “unknown” embedded ARM system?

拜拜、爱过 提交于 2019-11-30 23:44:43

untar the kernel.

make mrproper

make ARCH=${arch} headers_check

e.g make ARCH=arm headers_check

make ARCH=${CLFS_ARCH} INSTALL_HDR_PATH=dest headers_install

This are the steps to get headers from kernel.

The purpose of kernel headers is -->C library and compiled programs needs to interact with the kernel i.e for Available system calls and their numbers, Constant definitions, Data structures, etc. Therefore, compiling the C library requires kernel headers, and many applications also require them.

do I need the header files of the specific kernel?

The kernel-to-userspace ABI is backward compatible

--> 1)Binaries generated with a toolchain using kernel headers older than the running kernel will work without problem, but won't be able to use the new system calls, data structures, etc.

-->2)Binaries generated with a toolchain using kernel headers newer than the running kernel might work on if they don't use the recent features, otherwise they will break.

--->3)Using the latest kernel headers is not necessary, unless access to the new kernel features is needed

So in your case kernel version is "Linux version 2.6.20.7"

You can use kernel headers of Linux kernel version 2.6.20 or 2.6.21 from kernel.org.

does not create any problem in this case.

That should be fine if you're using the headers to build a libc

You should probably run make ARCH=arm headers_check beforehand too.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!