diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-14 13:14:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-14 13:14:29 -0400 |
commit | 899552d6e84babd24611fd36ac7051068cb1eb2d (patch) | |
tree | 9a02d66b74a0a9267bbf6637765517f5e8558497 /Documentation/kbuild | |
parent | 3b7b3e6ec5f56118046594d3c62469e7d1d0aadd (diff) | |
parent | 5a5da78b3a48120d942c8a18ecc645f6acdf7da6 (diff) |
Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull misc kbuild updates from Michal Marek:
"This is the non-critical part of kbuild for 3.17-rc1:
- make help hint to use make -s with make kernelrelease et al.
- moved a kbuild document to Documentation/kbuild where it belongs
- four new Coccinelle scripts, one dropped and one fixed
- new make kselftest target to run various tests on the kernel"
* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
kbuild: kselftest - new make target to build and run kernel selftests
Coccinelle: Script to replace if and BUG with BUG_ON
Coccinelle: Script to detect incorrect argument to sizeof
Coccinelle: Script to use ARRAY_SIZE instead of division of two sizeofs
Coccinelle: Script to detect cast after memory allocation
coccinelle/null: solve parse error
Documentation: headers_install.txt is part of kbuild
kbuild: make -s should be used with kernelrelease/kernelversion/image_name
Diffstat (limited to 'Documentation/kbuild')
-rw-r--r-- | Documentation/kbuild/00-INDEX | 2 | ||||
-rw-r--r-- | Documentation/kbuild/headers_install.txt | 47 |
2 files changed, 49 insertions, 0 deletions
diff --git a/Documentation/kbuild/00-INDEX b/Documentation/kbuild/00-INDEX index e8d2b6d83a3d..8c5e6aa78004 100644 --- a/Documentation/kbuild/00-INDEX +++ b/Documentation/kbuild/00-INDEX | |||
@@ -1,5 +1,7 @@ | |||
1 | 00-INDEX | 1 | 00-INDEX |
2 | - this file: info on the kernel build process | 2 | - this file: info on the kernel build process |
3 | headers_install.txt | ||
4 | - how to export Linux headers for use by userspace | ||
3 | kbuild.txt | 5 | kbuild.txt |
4 | - developer information on kbuild | 6 | - developer information on kbuild |
5 | kconfig.txt | 7 | kconfig.txt |
diff --git a/Documentation/kbuild/headers_install.txt b/Documentation/kbuild/headers_install.txt new file mode 100644 index 000000000000..951eb9f1e040 --- /dev/null +++ b/Documentation/kbuild/headers_install.txt | |||
@@ -0,0 +1,47 @@ | |||
1 | Exporting kernel headers for use by userspace | ||
2 | ============================================= | ||
3 | |||
4 | The "make headers_install" command exports the kernel's header files in a | ||
5 | form suitable for use by userspace programs. | ||
6 | |||
7 | The linux kernel's exported header files describe the API for user space | ||
8 | programs attempting to use kernel services. These kernel header files are | ||
9 | used by the system's C library (such as glibc or uClibc) to define available | ||
10 | system calls, as well as constants and structures to be used with these | ||
11 | system calls. The C library's header files include the kernel header files | ||
12 | from the "linux" subdirectory. The system's libc headers are usually | ||
13 | installed at the default location /usr/include and the kernel headers in | ||
14 | subdirectories under that (most notably /usr/include/linux and | ||
15 | /usr/include/asm). | ||
16 | |||
17 | Kernel headers are backwards compatible, but not forwards compatible. This | ||
18 | means that a program built against a C library using older kernel headers | ||
19 | should run on a newer kernel (although it may not have access to new | ||
20 | features), but a program built against newer kernel headers may not work on an | ||
21 | older kernel. | ||
22 | |||
23 | The "make headers_install" command can be run in the top level directory of the | ||
24 | kernel source code (or using a standard out-of-tree build). It takes two | ||
25 | optional arguments: | ||
26 | |||
27 | make headers_install ARCH=i386 INSTALL_HDR_PATH=/usr/include | ||
28 | |||
29 | ARCH indicates which architecture to produce headers for, and defaults to the | ||
30 | current architecture. The linux/asm directory of the exported kernel headers | ||
31 | is platform-specific, to see a complete list of supported architectures use | ||
32 | the command: | ||
33 | |||
34 | ls -d include/asm-* | sed 's/.*-//' | ||
35 | |||
36 | INSTALL_HDR_PATH indicates where to install the headers. It defaults to | ||
37 | "./usr/include". | ||
38 | |||
39 | The command "make headers_install_all" exports headers for all architectures | ||
40 | simultaneously. (This is mostly of interest to distribution maintainers, | ||
41 | who create an architecture-independent tarball from the resulting include | ||
42 | directory.) You also can use HDR_ARCH_LIST to specify list of architectures. | ||
43 | Remember to provide the appropriate linux/asm directory via "mv" or "ln -s" | ||
44 | before building a C library with headers exported this way. | ||
45 | |||
46 | The kernel header export infrastructure is maintained by David Woodhouse | ||
47 | <dwmw2@infradead.org>. | ||