diff options
Diffstat (limited to 'Documentation/kbuild')
-rw-r--r-- | Documentation/kbuild/makefiles.txt | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index d567a7cc552b..764f5991a3fc 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt | |||
@@ -23,11 +23,10 @@ This document describes the Linux kernel Makefiles. | |||
23 | === 4 Host Program support | 23 | === 4 Host Program support |
24 | --- 4.1 Simple Host Program | 24 | --- 4.1 Simple Host Program |
25 | --- 4.2 Composite Host Programs | 25 | --- 4.2 Composite Host Programs |
26 | --- 4.3 Defining shared libraries | 26 | --- 4.3 Using C++ for host programs |
27 | --- 4.4 Using C++ for host programs | 27 | --- 4.4 Controlling compiler options for host programs |
28 | --- 4.5 Controlling compiler options for host programs | 28 | --- 4.5 When host programs are actually built |
29 | --- 4.6 When host programs are actually built | 29 | --- 4.6 Using hostprogs-$(CONFIG_FOO) |
30 | --- 4.7 Using hostprogs-$(CONFIG_FOO) | ||
31 | 30 | ||
32 | === 5 Kbuild clean infrastructure | 31 | === 5 Kbuild clean infrastructure |
33 | 32 | ||
@@ -643,29 +642,7 @@ Both possibilities are described in the following. | |||
643 | Finally, the two .o files are linked to the executable, lxdialog. | 642 | Finally, the two .o files are linked to the executable, lxdialog. |
644 | Note: The syntax <executable>-y is not permitted for host-programs. | 643 | Note: The syntax <executable>-y is not permitted for host-programs. |
645 | 644 | ||
646 | --- 4.3 Defining shared libraries | 645 | --- 4.3 Using C++ for host programs |
647 | |||
648 | Objects with extension .so are considered shared libraries, and | ||
649 | will be compiled as position independent objects. | ||
650 | Kbuild provides support for shared libraries, but the usage | ||
651 | shall be restricted. | ||
652 | In the following example the libkconfig.so shared library is used | ||
653 | to link the executable conf. | ||
654 | |||
655 | Example: | ||
656 | #scripts/kconfig/Makefile | ||
657 | hostprogs-y := conf | ||
658 | conf-objs := conf.o libkconfig.so | ||
659 | libkconfig-objs := expr.o type.o | ||
660 | |||
661 | Shared libraries always require a corresponding -objs line, and | ||
662 | in the example above the shared library libkconfig is composed by | ||
663 | the two objects expr.o and type.o. | ||
664 | expr.o and type.o will be built as position independent code and | ||
665 | linked as a shared library libkconfig.so. C++ is not supported for | ||
666 | shared libraries. | ||
667 | |||
668 | --- 4.4 Using C++ for host programs | ||
669 | 646 | ||
670 | kbuild offers support for host programs written in C++. This was | 647 | kbuild offers support for host programs written in C++. This was |
671 | introduced solely to support kconfig, and is not recommended | 648 | introduced solely to support kconfig, and is not recommended |
@@ -688,7 +665,7 @@ Both possibilities are described in the following. | |||
688 | qconf-cxxobjs := qconf.o | 665 | qconf-cxxobjs := qconf.o |
689 | qconf-objs := check.o | 666 | qconf-objs := check.o |
690 | 667 | ||
691 | --- 4.5 Controlling compiler options for host programs | 668 | --- 4.4 Controlling compiler options for host programs |
692 | 669 | ||
693 | When compiling host programs, it is possible to set specific flags. | 670 | When compiling host programs, it is possible to set specific flags. |
694 | The programs will always be compiled utilising $(HOSTCC) passed | 671 | The programs will always be compiled utilising $(HOSTCC) passed |
@@ -716,7 +693,7 @@ Both possibilities are described in the following. | |||
716 | When linking qconf, it will be passed the extra option | 693 | When linking qconf, it will be passed the extra option |
717 | "-L$(QTDIR)/lib". | 694 | "-L$(QTDIR)/lib". |
718 | 695 | ||
719 | --- 4.6 When host programs are actually built | 696 | --- 4.5 When host programs are actually built |
720 | 697 | ||
721 | Kbuild will only build host-programs when they are referenced | 698 | Kbuild will only build host-programs when they are referenced |
722 | as a prerequisite. | 699 | as a prerequisite. |
@@ -747,7 +724,7 @@ Both possibilities are described in the following. | |||
747 | This will tell kbuild to build lxdialog even if not referenced in | 724 | This will tell kbuild to build lxdialog even if not referenced in |
748 | any rule. | 725 | any rule. |
749 | 726 | ||
750 | --- 4.7 Using hostprogs-$(CONFIG_FOO) | 727 | --- 4.6 Using hostprogs-$(CONFIG_FOO) |
751 | 728 | ||
752 | A typical pattern in a Kbuild file looks like this: | 729 | A typical pattern in a Kbuild file looks like this: |
753 | 730 | ||
@@ -1171,7 +1148,7 @@ When kbuild executes, the following steps are followed (roughly): | |||
1171 | obvious reason. | 1148 | obvious reason. |
1172 | 1149 | ||
1173 | dtc | 1150 | dtc |
1174 | Create flattend device tree blob object suitable for linking | 1151 | Create flattened device tree blob object suitable for linking |
1175 | into vmlinux. Device tree blobs linked into vmlinux are placed | 1152 | into vmlinux. Device tree blobs linked into vmlinux are placed |
1176 | in an init section in the image. Platform code *must* copy the | 1153 | in an init section in the image. Platform code *must* copy the |
1177 | blob to non-init memory prior to calling unflatten_device_tree(). | 1154 | blob to non-init memory prior to calling unflatten_device_tree(). |