diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-24 16:31:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-24 16:31:37 -0400 |
commit | 2bb732cdb48d271ff7a910260ffb851fb4bc8a28 (patch) | |
tree | 580bf68eb1e52b4e6915588d61423347ae09c318 | |
parent | f50d1d9e8d964fdd3b4cedfbca8843d1bc5916c1 (diff) | |
parent | c4d5ee13984f57b2f881635c49045151679f5e8a (diff) |
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
kbuild: make KBUILD_NOCMDDEP=1 handle empty built-in.o
scripts/kallsyms.c: fix potential segfault
scripts/gen_initramfs_list.sh: Convert to a /bin/sh script
kbuild: Fix GNU make v3.80 compatibility
kbuild: Fix passing -Wno-* options to gcc 4.4+
kbuild: move scripts/basic/docproc.c to scripts/docproc.c
kbuild: Fix Makefile.asm-generic for um
kbuild: Allow to combine multiple W= levels
kbuild: Disable -Wunused-but-set-variable for gcc 4.6.0
Fix handling of backlash character in LINUX_COMPILE_BY name
kbuild: asm-generic support
kbuild: implement several W= levels
kbuild: Fix build with binutils <= 2.19
initramfs: Use KBUILD_BUILD_TIMESTAMP for generated entries
kbuild: Allow to override LINUX_COMPILE_BY and LINUX_COMPILE_HOST macros
kbuild: Drop unused LINUX_COMPILE_TIME and LINUX_COMPILE_DOMAIN macros
kbuild: Use the deterministic mode of ar
kbuild: Call gzip with -n
kbuild: move KALLSYMS_EXTRA_PASS from Kconfig to Makefile
Kconfig: improve KALLSYMS_ALL documentation
Fix up trivial conflict in Makefile
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Documentation/DocBook/Makefile | 2 | ||||
-rw-r--r-- | Documentation/kbuild/kbuild.txt | 13 | ||||
-rw-r--r-- | Documentation/kbuild/makefiles.txt | 53 | ||||
-rw-r--r-- | Makefile | 50 | ||||
-rw-r--r-- | init/Kconfig | 30 | ||||
-rw-r--r-- | scripts/.gitignore | 1 | ||||
-rw-r--r-- | scripts/Kbuild.include | 12 | ||||
-rw-r--r-- | scripts/Makefile | 7 | ||||
-rw-r--r-- | scripts/Makefile.asm-generic | 23 | ||||
-rw-r--r-- | scripts/Makefile.build | 74 | ||||
-rw-r--r-- | scripts/Makefile.headersinst | 10 | ||||
-rw-r--r-- | scripts/Makefile.lib | 2 | ||||
-rw-r--r-- | scripts/basic/.gitignore | 2 | ||||
-rw-r--r-- | scripts/basic/Makefile | 3 | ||||
-rw-r--r-- | scripts/docproc.c (renamed from scripts/basic/docproc.c) | 0 | ||||
-rw-r--r-- | scripts/gen_initramfs_list.sh | 27 | ||||
-rw-r--r-- | scripts/kallsyms.c | 2 | ||||
-rwxr-xr-x | scripts/mkcompile_h | 30 | ||||
-rw-r--r-- | usr/gen_init_cpio.c | 53 |
20 files changed, 287 insertions, 108 deletions
diff --git a/.gitignore b/.gitignore index 5d56a3fd0de6..9dacde0a4b2d 100644 --- a/.gitignore +++ b/.gitignore | |||
@@ -57,6 +57,7 @@ modules.builtin | |||
57 | include/config | 57 | include/config |
58 | include/linux/version.h | 58 | include/linux/version.h |
59 | include/generated | 59 | include/generated |
60 | arch/*/include/generated | ||
60 | 61 | ||
61 | # stgit generated dirs | 62 | # stgit generated dirs |
62 | patches-* | 63 | patches-* |
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index 8436b018c289..3cebfa0d1611 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile | |||
@@ -73,7 +73,7 @@ installmandocs: mandocs | |||
73 | ### | 73 | ### |
74 | #External programs used | 74 | #External programs used |
75 | KERNELDOC = $(srctree)/scripts/kernel-doc | 75 | KERNELDOC = $(srctree)/scripts/kernel-doc |
76 | DOCPROC = $(objtree)/scripts/basic/docproc | 76 | DOCPROC = $(objtree)/scripts/docproc |
77 | 77 | ||
78 | XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl | 78 | XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl |
79 | XMLTOFLAGS += --skip-validation | 79 | XMLTOFLAGS += --skip-validation |
diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt index 7c2a89ba674c..68e32bb6bd80 100644 --- a/Documentation/kbuild/kbuild.txt +++ b/Documentation/kbuild/kbuild.txt | |||
@@ -201,3 +201,16 @@ KBUILD_ENABLE_EXTRA_GCC_CHECKS | |||
201 | -------------------------------------------------- | 201 | -------------------------------------------------- |
202 | If enabled over the make command line with "W=1", it turns on additional | 202 | If enabled over the make command line with "W=1", it turns on additional |
203 | gcc -W... options for more extensive build-time checking. | 203 | gcc -W... options for more extensive build-time checking. |
204 | |||
205 | KBUILD_BUILD_TIMESTAMP | ||
206 | -------------------------------------------------- | ||
207 | Setting this to a date string overrides the timestamp used in the | ||
208 | UTS_VERSION definition (uname -v in the running kernel). The value has to | ||
209 | be a string that can be passed to date -d. The default value | ||
210 | is the output of the date command at one point during build. | ||
211 | |||
212 | KBUILD_BUILD_USER, KBUILD_BUILD_HOST | ||
213 | -------------------------------------------------- | ||
214 | These two variables allow to override the user@host string displayed during | ||
215 | boot and in /proc/version. The default value is the output of the commands | ||
216 | whoami and host, respectively. | ||
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index 5d145bb443c0..47435e56c5da 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt | |||
@@ -40,11 +40,13 @@ This document describes the Linux kernel Makefiles. | |||
40 | --- 6.6 Commands useful for building a boot image | 40 | --- 6.6 Commands useful for building a boot image |
41 | --- 6.7 Custom kbuild commands | 41 | --- 6.7 Custom kbuild commands |
42 | --- 6.8 Preprocessing linker scripts | 42 | --- 6.8 Preprocessing linker scripts |
43 | --- 6.9 Generic header files | ||
43 | 44 | ||
44 | === 7 Kbuild syntax for exported headers | 45 | === 7 Kbuild syntax for exported headers |
45 | --- 7.1 header-y | 46 | --- 7.1 header-y |
46 | --- 7.2 objhdr-y | 47 | --- 7.2 objhdr-y |
47 | --- 7.3 destination-y | 48 | --- 7.3 destination-y |
49 | --- 7.4 generic-y | ||
48 | 50 | ||
49 | === 8 Kbuild Variables | 51 | === 8 Kbuild Variables |
50 | === 9 Makefile language | 52 | === 9 Makefile language |
@@ -499,6 +501,18 @@ more details, with real examples. | |||
499 | gcc >= 3.00. For gcc < 3.00, -malign-functions=4 is used. | 501 | gcc >= 3.00. For gcc < 3.00, -malign-functions=4 is used. |
500 | Note: cc-option-align uses KBUILD_CFLAGS for $(CC) options | 502 | Note: cc-option-align uses KBUILD_CFLAGS for $(CC) options |
501 | 503 | ||
504 | cc-disable-warning | ||
505 | cc-disable-warning checks if gcc supports a given warning and returns | ||
506 | the commandline switch to disable it. This special function is needed, | ||
507 | because gcc 4.4 and later accept any unknown -Wno-* option and only | ||
508 | warn about it if there is another warning in the source file. | ||
509 | |||
510 | Example: | ||
511 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) | ||
512 | |||
513 | In the above example, -Wno-unused-but-set-variable will be added to | ||
514 | KBUILD_CFLAGS only if gcc really accepts it. | ||
515 | |||
502 | cc-version | 516 | cc-version |
503 | cc-version returns a numerical version of the $(CC) compiler version. | 517 | cc-version returns a numerical version of the $(CC) compiler version. |
504 | The format is <major><minor> where both are two digits. So for example | 518 | The format is <major><minor> where both are two digits. So for example |
@@ -955,6 +969,11 @@ When kbuild executes, the following steps are followed (roughly): | |||
955 | used when linking modules. This is often a linker script. | 969 | used when linking modules. This is often a linker script. |
956 | From commandline LDFLAGS_MODULE shall be used (see kbuild.txt). | 970 | From commandline LDFLAGS_MODULE shall be used (see kbuild.txt). |
957 | 971 | ||
972 | KBUILD_ARFLAGS Options for $(AR) when creating archives | ||
973 | |||
974 | $(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic | ||
975 | mode) if this option is supported by $(AR). | ||
976 | |||
958 | --- 6.2 Add prerequisites to archprepare: | 977 | --- 6.2 Add prerequisites to archprepare: |
959 | 978 | ||
960 | The archprepare: rule is used to list prerequisites that need to be | 979 | The archprepare: rule is used to list prerequisites that need to be |
@@ -1209,6 +1228,14 @@ When kbuild executes, the following steps are followed (roughly): | |||
1209 | The kbuild infrastructure for *lds file are used in several | 1228 | The kbuild infrastructure for *lds file are used in several |
1210 | architecture-specific files. | 1229 | architecture-specific files. |
1211 | 1230 | ||
1231 | --- 6.9 Generic header files | ||
1232 | |||
1233 | The directory include/asm-generic contains the header files | ||
1234 | that may be shared between individual architectures. | ||
1235 | The recommended approach how to use a generic header file is | ||
1236 | to list the file in the Kbuild file. | ||
1237 | See "7.4 generic-y" for further info on syntax etc. | ||
1238 | |||
1212 | === 7 Kbuild syntax for exported headers | 1239 | === 7 Kbuild syntax for exported headers |
1213 | 1240 | ||
1214 | The kernel include a set of headers that is exported to userspace. | 1241 | The kernel include a set of headers that is exported to userspace. |
@@ -1265,6 +1292,32 @@ See subsequent chapter for the syntax of the Kbuild file. | |||
1265 | In the example above all exported headers in the Kbuild file | 1292 | In the example above all exported headers in the Kbuild file |
1266 | will be located in the directory "include/linux" when exported. | 1293 | will be located in the directory "include/linux" when exported. |
1267 | 1294 | ||
1295 | --- 7.4 generic-y | ||
1296 | |||
1297 | If an architecture uses a verbatim copy of a header from | ||
1298 | include/asm-generic then this is listed in the file | ||
1299 | arch/$(ARCH)/include/asm/Kbuild like this: | ||
1300 | |||
1301 | Example: | ||
1302 | #arch/x86/include/asm/Kbuild | ||
1303 | generic-y += termios.h | ||
1304 | generic-y += rtc.h | ||
1305 | |||
1306 | During the prepare phase of the build a wrapper include | ||
1307 | file is generated in the directory: | ||
1308 | |||
1309 | arch/$(ARCH)/include/generated/asm | ||
1310 | |||
1311 | When a header is exported where the architecture uses | ||
1312 | the generic header a similar wrapper is generated as part | ||
1313 | of the set of exported headers in the directory: | ||
1314 | |||
1315 | usr/include/asm | ||
1316 | |||
1317 | The generated wrapper will in both cases look like the following: | ||
1318 | |||
1319 | Example: termios.h | ||
1320 | #include <asm-generic/termios.h> | ||
1268 | 1321 | ||
1269 | === 8 Kbuild Variables | 1322 | === 8 Kbuild Variables |
1270 | 1323 | ||
@@ -103,7 +103,7 @@ ifeq ("$(origin O)", "command line") | |||
103 | endif | 103 | endif |
104 | 104 | ||
105 | ifeq ("$(origin W)", "command line") | 105 | ifeq ("$(origin W)", "command line") |
106 | export KBUILD_ENABLE_EXTRA_GCC_CHECKS := 1 | 106 | export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W) |
107 | endif | 107 | endif |
108 | 108 | ||
109 | # That's our default target when none is given on the command line | 109 | # That's our default target when none is given on the command line |
@@ -349,7 +349,8 @@ CFLAGS_GCOV = -fprofile-arcs -ftest-coverage | |||
349 | 349 | ||
350 | # Use LINUXINCLUDE when you must reference the include/ directory. | 350 | # Use LINUXINCLUDE when you must reference the include/ directory. |
351 | # Needed to be compatible with the O= option | 351 | # Needed to be compatible with the O= option |
352 | LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include -Iinclude \ | 352 | LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include \ |
353 | -Iarch/$(hdr-arch)/include/generated -Iinclude \ | ||
353 | $(if $(KBUILD_SRC), -I$(srctree)/include) \ | 354 | $(if $(KBUILD_SRC), -I$(srctree)/include) \ |
354 | -include include/generated/autoconf.h | 355 | -include include/generated/autoconf.h |
355 | 356 | ||
@@ -382,6 +383,7 @@ export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV | |||
382 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE | 383 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE |
383 | export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE | 384 | export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE |
384 | export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL | 385 | export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL |
386 | export KBUILD_ARFLAGS | ||
385 | 387 | ||
386 | # When compiling out-of-tree modules, put MODVERDIR in the module | 388 | # When compiling out-of-tree modules, put MODVERDIR in the module |
387 | # tree rather than in the kernel tree. The kernel tree might | 389 | # tree rather than in the kernel tree. The kernel tree might |
@@ -416,6 +418,12 @@ ifneq ($(KBUILD_SRC),) | |||
416 | $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) | 418 | $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) |
417 | endif | 419 | endif |
418 | 420 | ||
421 | # Support for using generic headers in asm-generic | ||
422 | PHONY += asm-generic | ||
423 | asm-generic: | ||
424 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \ | ||
425 | obj=arch/$(SRCARCH)/include/generated/asm | ||
426 | |||
419 | # To make sure we do not include .config for any of the *config targets | 427 | # To make sure we do not include .config for any of the *config targets |
420 | # catch them early, and hand them over to scripts/kconfig/Makefile | 428 | # catch them early, and hand them over to scripts/kconfig/Makefile |
421 | # It is allowed to specify more targets when calling make, including | 429 | # It is allowed to specify more targets when calling make, including |
@@ -559,6 +567,10 @@ ifndef CONFIG_CC_STACKPROTECTOR | |||
559 | KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector) | 567 | KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector) |
560 | endif | 568 | endif |
561 | 569 | ||
570 | # This warning generated too much noise in a regular build. | ||
571 | # Use make W=1 to enable this warning (see scripts/Makefile.build) | ||
572 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) | ||
573 | |||
562 | ifdef CONFIG_FRAME_POINTER | 574 | ifdef CONFIG_FRAME_POINTER |
563 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls | 575 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls |
564 | else | 576 | else |
@@ -604,7 +616,7 @@ CHECKFLAGS += $(NOSTDINC_FLAGS) | |||
604 | KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) | 616 | KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) |
605 | 617 | ||
606 | # disable pointer signed / unsigned warnings in gcc 4.0 | 618 | # disable pointer signed / unsigned warnings in gcc 4.0 |
607 | KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) | 619 | KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign) |
608 | 620 | ||
609 | # disable invalid "can't wrap" optimizations for signed / pointers | 621 | # disable invalid "can't wrap" optimizations for signed / pointers |
610 | KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) | 622 | KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) |
@@ -612,6 +624,9 @@ KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) | |||
612 | # conserve stack if available | 624 | # conserve stack if available |
613 | KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) | 625 | KBUILD_CFLAGS += $(call cc-option,-fconserve-stack) |
614 | 626 | ||
627 | # use the deterministic mode of AR if available | ||
628 | KBUILD_ARFLAGS := $(call ar-option,D) | ||
629 | |||
615 | # check for 'asm goto' | 630 | # check for 'asm goto' |
616 | ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y) | 631 | ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y) |
617 | KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO | 632 | KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO |
@@ -797,15 +812,17 @@ ifdef CONFIG_KALLSYMS | |||
797 | # o The correct .tmp_kallsyms2.o is linked into the final vmlinux. | 812 | # o The correct .tmp_kallsyms2.o is linked into the final vmlinux. |
798 | # o Verify that the System.map from vmlinux matches the map from | 813 | # o Verify that the System.map from vmlinux matches the map from |
799 | # .tmp_vmlinux2, just in case we did not generate kallsyms correctly. | 814 | # .tmp_vmlinux2, just in case we did not generate kallsyms correctly. |
800 | # o If CONFIG_KALLSYMS_EXTRA_PASS is set, do an extra pass using | 815 | # o If 'make KALLSYMS_EXTRA_PASS=1" was used, do an extra pass using |
801 | # .tmp_vmlinux3 and .tmp_kallsyms3.o. This is only meant as a | 816 | # .tmp_vmlinux3 and .tmp_kallsyms3.o. This is only meant as a |
802 | # temporary bypass to allow the kernel to be built while the | 817 | # temporary bypass to allow the kernel to be built while the |
803 | # maintainers work out what went wrong with kallsyms. | 818 | # maintainers work out what went wrong with kallsyms. |
804 | 819 | ||
805 | ifdef CONFIG_KALLSYMS_EXTRA_PASS | ||
806 | last_kallsyms := 3 | ||
807 | else | ||
808 | last_kallsyms := 2 | 820 | last_kallsyms := 2 |
821 | |||
822 | ifdef KALLSYMS_EXTRA_PASS | ||
823 | ifneq ($(KALLSYMS_EXTRA_PASS),0) | ||
824 | last_kallsyms := 3 | ||
825 | endif | ||
809 | endif | 826 | endif |
810 | 827 | ||
811 | kallsyms.o := .tmp_kallsyms$(last_kallsyms).o | 828 | kallsyms.o := .tmp_kallsyms$(last_kallsyms).o |
@@ -816,7 +833,8 @@ define verify_kallsyms | |||
816 | $(cmd_sysmap) .tmp_vmlinux$(last_kallsyms) .tmp_System.map | 833 | $(cmd_sysmap) .tmp_vmlinux$(last_kallsyms) .tmp_System.map |
817 | $(Q)cmp -s System.map .tmp_System.map || \ | 834 | $(Q)cmp -s System.map .tmp_System.map || \ |
818 | (echo Inconsistent kallsyms data; \ | 835 | (echo Inconsistent kallsyms data; \ |
819 | echo Try setting CONFIG_KALLSYMS_EXTRA_PASS; \ | 836 | echo This is a bug - please report about it; \ |
837 | echo Try "make KALLSYMS_EXTRA_PASS=1" as a workaround; \ | ||
820 | rm .tmp_kallsyms* ; /bin/false ) | 838 | rm .tmp_kallsyms* ; /bin/false ) |
821 | endef | 839 | endef |
822 | 840 | ||
@@ -947,7 +965,7 @@ ifneq ($(KBUILD_SRC),) | |||
947 | endif | 965 | endif |
948 | 966 | ||
949 | # prepare2 creates a makefile if using a separate output directory | 967 | # prepare2 creates a makefile if using a separate output directory |
950 | prepare2: prepare3 outputmakefile | 968 | prepare2: prepare3 outputmakefile asm-generic |
951 | 969 | ||
952 | prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \ | 970 | prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \ |
953 | include/config/auto.conf | 971 | include/config/auto.conf |
@@ -1021,7 +1039,7 @@ hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj | |||
1021 | hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) | 1039 | hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) |
1022 | 1040 | ||
1023 | PHONY += __headers | 1041 | PHONY += __headers |
1024 | __headers: include/linux/version.h scripts_basic FORCE | 1042 | __headers: include/linux/version.h scripts_basic asm-generic FORCE |
1025 | $(Q)$(MAKE) $(build)=scripts build_unifdef | 1043 | $(Q)$(MAKE) $(build)=scripts build_unifdef |
1026 | 1044 | ||
1027 | PHONY += headers_install_all | 1045 | PHONY += headers_install_all |
@@ -1136,7 +1154,8 @@ CLEAN_FILES += vmlinux System.map \ | |||
1136 | .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map | 1154 | .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map |
1137 | 1155 | ||
1138 | # Directories & files removed with 'make mrproper' | 1156 | # Directories & files removed with 'make mrproper' |
1139 | MRPROPER_DIRS += include/config usr/include include/generated | 1157 | MRPROPER_DIRS += include/config usr/include include/generated \ |
1158 | arch/*/include/generated | ||
1140 | MRPROPER_FILES += .config .config.old .version .old_version \ | 1159 | MRPROPER_FILES += .config .config.old .version .old_version \ |
1141 | include/linux/version.h \ | 1160 | include/linux/version.h \ |
1142 | Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS | 1161 | Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS |
@@ -1267,7 +1286,11 @@ help: | |||
1267 | @echo ' make O=dir [targets] Locate all output files in "dir", including .config' | 1286 | @echo ' make O=dir [targets] Locate all output files in "dir", including .config' |
1268 | @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)' | 1287 | @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)' |
1269 | @echo ' make C=2 [targets] Force check of all c source with $$CHECK' | 1288 | @echo ' make C=2 [targets] Force check of all c source with $$CHECK' |
1270 | @echo ' make W=1 [targets] Enable extra gcc checks' | 1289 | @echo ' make W=n [targets] Enable extra gcc checks, n=1,2,3 where' |
1290 | @echo ' 1: warnings which may be relevant and do not occur too often' | ||
1291 | @echo ' 2: warnings which occur quite often but may still be relevant' | ||
1292 | @echo ' 3: more obscure warnings, can most likely be ignored' | ||
1293 | @echo ' Multiple levels can be combined with W=12 or W=123' | ||
1271 | @echo ' make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections' | 1294 | @echo ' make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections' |
1272 | @echo '' | 1295 | @echo '' |
1273 | @echo 'Execute "make" or "make all" to build all targets marked with [*] ' | 1296 | @echo 'Execute "make" or "make all" to build all targets marked with [*] ' |
@@ -1291,6 +1314,7 @@ $(help-board-dirs): help-%: | |||
1291 | # Documentation targets | 1314 | # Documentation targets |
1292 | # --------------------------------------------------------------------------- | 1315 | # --------------------------------------------------------------------------- |
1293 | %docs: scripts_basic FORCE | 1316 | %docs: scripts_basic FORCE |
1317 | $(Q)$(MAKE) $(build)=scripts build_docproc | ||
1294 | $(Q)$(MAKE) $(build)=Documentation/DocBook $@ | 1318 | $(Q)$(MAKE) $(build)=Documentation/DocBook $@ |
1295 | 1319 | ||
1296 | else # KBUILD_EXTMOD | 1320 | else # KBUILD_EXTMOD |
@@ -1375,7 +1399,7 @@ endif # KBUILD_EXTMOD | |||
1375 | clean: $(clean-dirs) | 1399 | clean: $(clean-dirs) |
1376 | $(call cmd,rmdirs) | 1400 | $(call cmd,rmdirs) |
1377 | $(call cmd,rmfiles) | 1401 | $(call cmd,rmfiles) |
1378 | @find $(or $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ | 1402 | @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ |
1379 | \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ | 1403 | \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ |
1380 | -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ | 1404 | -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ |
1381 | -o -name '*.symtypes' -o -name 'modules.order' \ | 1405 | -o -name '*.symtypes' -o -name 'modules.order' \ |
diff --git a/init/Kconfig b/init/Kconfig index c8b172efaa65..332aac649966 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -959,24 +959,18 @@ config KALLSYMS_ALL | |||
959 | bool "Include all symbols in kallsyms" | 959 | bool "Include all symbols in kallsyms" |
960 | depends on DEBUG_KERNEL && KALLSYMS | 960 | depends on DEBUG_KERNEL && KALLSYMS |
961 | help | 961 | help |
962 | Normally kallsyms only contains the symbols of functions, for nicer | 962 | Normally kallsyms only contains the symbols of functions for nicer |
963 | OOPS messages. Some debuggers can use kallsyms for other | 963 | OOPS messages and backtraces (i.e., symbols from the text and inittext |
964 | symbols too: say Y here to include all symbols, if you need them | 964 | sections). This is sufficient for most cases. And only in very rare |
965 | and you don't care about adding 300k to the size of your kernel. | 965 | cases (e.g., when a debugger is used) all symbols are required (e.g., |
966 | 966 | names of variables from the data sections, etc). | |
967 | Say N. | 967 | |
968 | 968 | This option makes sure that all symbols are loaded into the kernel | |
969 | config KALLSYMS_EXTRA_PASS | 969 | image (i.e., symbols from all sections) in cost of increased kernel |
970 | bool "Do an extra kallsyms pass" | 970 | size (depending on the kernel configuration, it may be 300KiB or |
971 | depends on KALLSYMS | 971 | something like this). |
972 | help | 972 | |
973 | If kallsyms is not working correctly, the build will fail with | 973 | Say N unless you really need all symbols. |
974 | inconsistent kallsyms data. If that occurs, log a bug report and | ||
975 | turn on KALLSYMS_EXTRA_PASS which should result in a stable build. | ||
976 | Always say N here unless you find a bug in kallsyms, which must be | ||
977 | reported. KALLSYMS_EXTRA_PASS is only a temporary workaround while | ||
978 | you wait for kallsyms to be fixed. | ||
979 | |||
980 | 974 | ||
981 | config HOTPLUG | 975 | config HOTPLUG |
982 | bool "Support for hot-pluggable devices" if EXPERT | 976 | bool "Support for hot-pluggable devices" if EXPERT |
diff --git a/scripts/.gitignore b/scripts/.gitignore index e2741d23bab8..105b21f08185 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore | |||
@@ -8,3 +8,4 @@ bin2c | |||
8 | unifdef | 8 | unifdef |
9 | ihex2fw | 9 | ihex2fw |
10 | recordmcount | 10 | recordmcount |
11 | docproc | ||
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index ed2773edfe71..be39cd1c74cf 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
@@ -118,6 +118,11 @@ cc-option-yn = $(call try-run,\ | |||
118 | cc-option-align = $(subst -functions=0,,\ | 118 | cc-option-align = $(subst -functions=0,,\ |
119 | $(call cc-option,-falign-functions=0,-malign-functions=0)) | 119 | $(call cc-option,-falign-functions=0,-malign-functions=0)) |
120 | 120 | ||
121 | # cc-disable-warning | ||
122 | # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable) | ||
123 | cc-disable-warning = $(call try-run,\ | ||
124 | $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -xc /dev/null -o "$$TMP",-Wno-$(strip $(1))) | ||
125 | |||
121 | # cc-version | 126 | # cc-version |
122 | # Usage gcc-ver := $(call cc-version) | 127 | # Usage gcc-ver := $(call cc-version) |
123 | cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC)) | 128 | cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC)) |
@@ -141,6 +146,11 @@ cc-ldoption = $(call try-run,\ | |||
141 | ld-option = $(call try-run,\ | 146 | ld-option = $(call try-run,\ |
142 | $(CC) /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2)) | 147 | $(CC) /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2)) |
143 | 148 | ||
149 | # ar-option | ||
150 | # Usage: KBUILD_ARFLAGS := $(call ar-option,D) | ||
151 | # Important: no spaces around options | ||
152 | ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2)) | ||
153 | |||
144 | ###### | 154 | ###### |
145 | 155 | ||
146 | ### | 156 | ### |
@@ -187,6 +197,8 @@ ifneq ($(KBUILD_NOCMDDEP),1) | |||
187 | # User may override this check using make KBUILD_NOCMDDEP=1 | 197 | # User may override this check using make KBUILD_NOCMDDEP=1 |
188 | arg-check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ | 198 | arg-check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ |
189 | $(filter-out $(cmd_$@), $(cmd_$(1))) ) | 199 | $(filter-out $(cmd_$@), $(cmd_$(1))) ) |
200 | else | ||
201 | arg-check = $(if $(strip $(cmd_$@)),,1) | ||
190 | endif | 202 | endif |
191 | 203 | ||
192 | # >'< substitution is for echo to work, | 204 | # >'< substitution is for echo to work, |
diff --git a/scripts/Makefile b/scripts/Makefile index fcea26168bca..df7678febf27 100644 --- a/scripts/Makefile +++ b/scripts/Makefile | |||
@@ -6,6 +6,7 @@ | |||
6 | # pnmttologo: Convert pnm files to logo files | 6 | # pnmttologo: Convert pnm files to logo files |
7 | # conmakehash: Create chartable | 7 | # conmakehash: Create chartable |
8 | # conmakehash: Create arrays for initializing the kernel console tables | 8 | # conmakehash: Create arrays for initializing the kernel console tables |
9 | # docproc: Used in Documentation/DocBook | ||
9 | 10 | ||
10 | hostprogs-$(CONFIG_KALLSYMS) += kallsyms | 11 | hostprogs-$(CONFIG_KALLSYMS) += kallsyms |
11 | hostprogs-$(CONFIG_LOGO) += pnmtologo | 12 | hostprogs-$(CONFIG_LOGO) += pnmtologo |
@@ -16,12 +17,14 @@ hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount | |||
16 | always := $(hostprogs-y) $(hostprogs-m) | 17 | always := $(hostprogs-y) $(hostprogs-m) |
17 | 18 | ||
18 | # The following hostprogs-y programs are only build on demand | 19 | # The following hostprogs-y programs are only build on demand |
19 | hostprogs-y += unifdef | 20 | hostprogs-y += unifdef docproc |
20 | 21 | ||
21 | # This target is used internally to avoid "is up to date" messages | 22 | # These targets are used internally to avoid "is up to date" messages |
22 | PHONY += build_unifdef | 23 | PHONY += build_unifdef |
23 | build_unifdef: scripts/unifdef FORCE | 24 | build_unifdef: scripts/unifdef FORCE |
24 | @: | 25 | @: |
26 | build_docproc: scripts/docproc FORCE | ||
27 | @: | ||
25 | 28 | ||
26 | subdir-$(CONFIG_MODVERSIONS) += genksyms | 29 | subdir-$(CONFIG_MODVERSIONS) += genksyms |
27 | subdir-y += mod | 30 | subdir-y += mod |
diff --git a/scripts/Makefile.asm-generic b/scripts/Makefile.asm-generic new file mode 100644 index 000000000000..490122c3e2aa --- /dev/null +++ b/scripts/Makefile.asm-generic | |||
@@ -0,0 +1,23 @@ | |||
1 | # include/asm-generic contains a lot of files that are used | ||
2 | # verbatim by several architectures. | ||
3 | # | ||
4 | # This Makefile reads the file arch/$(SRCARCH)/include/asm/Kbuild | ||
5 | # and for each file listed in this file with generic-y creates | ||
6 | # a small wrapper file in $(obj) (arch/$(SRCARCH)/include/generated/asm) | ||
7 | |||
8 | kbuild-file := $(srctree)/arch/$(SRCARCH)/include/asm/Kbuild | ||
9 | -include $(kbuild-file) | ||
10 | |||
11 | include scripts/Kbuild.include | ||
12 | |||
13 | # Create output directory if not already present | ||
14 | _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) | ||
15 | |||
16 | quiet_cmd_wrap = WRAP $@ | ||
17 | cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ | ||
18 | |||
19 | all: $(patsubst %, $(obj)/%, $(generic-y)) | ||
20 | |||
21 | $(obj)/%.h: | ||
22 | $(call cmd,wrap) | ||
23 | |||
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 6165622c3e29..a0fd5029cfe7 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -51,36 +51,52 @@ ifeq ($(KBUILD_NOPEDANTIC),) | |||
51 | endif | 51 | endif |
52 | 52 | ||
53 | # | 53 | # |
54 | # make W=1 settings | 54 | # make W=... settings |
55 | # | 55 | # |
56 | # $(call cc-option... ) handles gcc -W.. options which | 56 | # W=1 - warnings that may be relevant and does not occur too often |
57 | # W=2 - warnings that occur quite often but may still be relevant | ||
58 | # W=3 - the more obscure warnings, can most likely be ignored | ||
59 | # | ||
60 | # $(call cc-option, -W...) handles gcc -W.. options which | ||
57 | # are not supported by all versions of the compiler | 61 | # are not supported by all versions of the compiler |
58 | ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS | 62 | ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS |
59 | KBUILD_EXTRA_WARNINGS := -Wextra | 63 | warning- := $(empty) |
60 | KBUILD_EXTRA_WARNINGS += -Wunused -Wno-unused-parameter | 64 | |
61 | KBUILD_EXTRA_WARNINGS += -Waggregate-return | 65 | warning-1 := -Wextra -Wunused -Wno-unused-parameter |
62 | KBUILD_EXTRA_WARNINGS += -Wbad-function-cast | 66 | warning-1 += -Wmissing-declarations |
63 | KBUILD_EXTRA_WARNINGS += -Wcast-qual | 67 | warning-1 += -Wmissing-format-attribute |
64 | KBUILD_EXTRA_WARNINGS += -Wcast-align | 68 | warning-1 += -Wmissing-prototypes |
65 | KBUILD_EXTRA_WARNINGS += -Wconversion | 69 | warning-1 += -Wold-style-definition |
66 | KBUILD_EXTRA_WARNINGS += -Wdisabled-optimization | 70 | warning-1 += $(call cc-option, -Wmissing-include-dirs) |
67 | KBUILD_EXTRA_WARNINGS += -Wlogical-op | 71 | warning-1 += $(call cc-option, -Wunused-but-set-variable) |
68 | KBUILD_EXTRA_WARNINGS += -Wmissing-declarations | 72 | |
69 | KBUILD_EXTRA_WARNINGS += -Wmissing-format-attribute | 73 | warning-2 := -Waggregate-return |
70 | KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wmissing-include-dirs,) | 74 | warning-2 += -Wcast-align |
71 | KBUILD_EXTRA_WARNINGS += -Wmissing-prototypes | 75 | warning-2 += -Wdisabled-optimization |
72 | KBUILD_EXTRA_WARNINGS += -Wnested-externs | 76 | warning-2 += -Wnested-externs |
73 | KBUILD_EXTRA_WARNINGS += -Wold-style-definition | 77 | warning-2 += -Wshadow |
74 | KBUILD_EXTRA_WARNINGS += $(call cc-option, -Woverlength-strings,) | 78 | warning-2 += $(call cc-option, -Wlogical-op) |
75 | KBUILD_EXTRA_WARNINGS += -Wpacked | 79 | |
76 | KBUILD_EXTRA_WARNINGS += -Wpacked-bitfield-compat | 80 | warning-3 := -Wbad-function-cast |
77 | KBUILD_EXTRA_WARNINGS += -Wpadded | 81 | warning-3 += -Wcast-qual |
78 | KBUILD_EXTRA_WARNINGS += -Wpointer-arith | 82 | warning-3 += -Wconversion |
79 | KBUILD_EXTRA_WARNINGS += -Wredundant-decls | 83 | warning-3 += -Wpacked |
80 | KBUILD_EXTRA_WARNINGS += -Wshadow | 84 | warning-3 += -Wpadded |
81 | KBUILD_EXTRA_WARNINGS += -Wswitch-default | 85 | warning-3 += -Wpointer-arith |
82 | KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wvla,) | 86 | warning-3 += -Wredundant-decls |
83 | KBUILD_CFLAGS += $(KBUILD_EXTRA_WARNINGS) | 87 | warning-3 += -Wswitch-default |
88 | warning-3 += $(call cc-option, -Wpacked-bitfield-compat) | ||
89 | warning-3 += $(call cc-option, -Wvla) | ||
90 | |||
91 | warning := $(warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) | ||
92 | warning += $(warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) | ||
93 | warning += $(warning-$(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) | ||
94 | |||
95 | ifeq ("$(strip $(warning))","") | ||
96 | $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown) | ||
97 | endif | ||
98 | |||
99 | KBUILD_CFLAGS += $(warning) | ||
84 | endif | 100 | endif |
85 | 101 | ||
86 | include scripts/Makefile.lib | 102 | include scripts/Makefile.lib |
@@ -351,7 +367,7 @@ quiet_cmd_link_o_target = LD $@ | |||
351 | cmd_link_o_target = $(if $(strip $(obj-y)),\ | 367 | cmd_link_o_target = $(if $(strip $(obj-y)),\ |
352 | $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^) \ | 368 | $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^) \ |
353 | $(cmd_secanalysis),\ | 369 | $(cmd_secanalysis),\ |
354 | rm -f $@; $(AR) rcs $@) | 370 | rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@) |
355 | 371 | ||
356 | $(builtin-target): $(obj-y) FORCE | 372 | $(builtin-target): $(obj-y) FORCE |
357 | $(call if_changed,link_o_target) | 373 | $(call if_changed,link_o_target) |
@@ -377,7 +393,7 @@ $(modorder-target): $(subdir-ym) FORCE | |||
377 | # | 393 | # |
378 | ifdef lib-target | 394 | ifdef lib-target |
379 | quiet_cmd_link_l_target = AR $@ | 395 | quiet_cmd_link_l_target = AR $@ |
380 | cmd_link_l_target = rm -f $@; $(AR) rcs $@ $(lib-y) | 396 | cmd_link_l_target = rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@ $(lib-y) |
381 | 397 | ||
382 | $(lib-target): $(lib-y) FORCE | 398 | $(lib-target): $(lib-y) FORCE |
383 | $(call if_changed,link_l_target) | 399 | $(call if_changed,link_l_target) |
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst index f89cb87f5c01..a57f5bd5a13d 100644 --- a/scripts/Makefile.headersinst +++ b/scripts/Makefile.headersinst | |||
@@ -27,8 +27,13 @@ header-y := $(filter-out %/, $(header-y)) | |||
27 | install-file := $(install)/.install | 27 | install-file := $(install)/.install |
28 | check-file := $(install)/.check | 28 | check-file := $(install)/.check |
29 | 29 | ||
30 | # generic-y list all files an architecture uses from asm-generic | ||
31 | # Use this to build a list of headers which require a wrapper | ||
32 | wrapper-files := $(filter $(header-y), $(generic-y)) | ||
33 | |||
30 | # all headers files for this dir | 34 | # all headers files for this dir |
31 | all-files := $(header-y) $(objhdr-y) | 35 | header-y := $(filter-out $(generic-y), $(header-y)) |
36 | all-files := $(header-y) $(objhdr-y) $(wrapper-files) | ||
32 | input-files := $(addprefix $(srctree)/$(obj)/,$(header-y)) \ | 37 | input-files := $(addprefix $(srctree)/$(obj)/,$(header-y)) \ |
33 | $(addprefix $(objtree)/$(obj)/,$(objhdr-y)) | 38 | $(addprefix $(objtree)/$(obj)/,$(objhdr-y)) |
34 | output-files := $(addprefix $(install)/, $(all-files)) | 39 | output-files := $(addprefix $(install)/, $(all-files)) |
@@ -47,6 +52,9 @@ quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\ | |||
47 | cmd_install = \ | 52 | cmd_install = \ |
48 | $(PERL) $< $(srctree)/$(obj) $(install) $(SRCARCH) $(header-y); \ | 53 | $(PERL) $< $(srctree)/$(obj) $(install) $(SRCARCH) $(header-y); \ |
49 | $(PERL) $< $(objtree)/$(obj) $(install) $(SRCARCH) $(objhdr-y); \ | 54 | $(PERL) $< $(objtree)/$(obj) $(install) $(SRCARCH) $(objhdr-y); \ |
55 | for F in $(wrapper-files); do \ | ||
56 | echo "\#include <asm-generic/$$F>" > $(install)/$$F; \ | ||
57 | done; \ | ||
50 | touch $@ | 58 | touch $@ |
51 | 59 | ||
52 | quiet_cmd_remove = REMOVE $(unwanted) | 60 | quiet_cmd_remove = REMOVE $(unwanted) |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 1c702ca8aac8..93b2b5938a2e 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -197,7 +197,7 @@ cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@ | |||
197 | # --------------------------------------------------------------------------- | 197 | # --------------------------------------------------------------------------- |
198 | 198 | ||
199 | quiet_cmd_gzip = GZIP $@ | 199 | quiet_cmd_gzip = GZIP $@ |
200 | cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 > $@) || \ | 200 | cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@) || \ |
201 | (rm -f $@ ; false) | 201 | (rm -f $@ ; false) |
202 | 202 | ||
203 | # DTC | 203 | # DTC |
diff --git a/scripts/basic/.gitignore b/scripts/basic/.gitignore index bf8b199ec598..a776371a3502 100644 --- a/scripts/basic/.gitignore +++ b/scripts/basic/.gitignore | |||
@@ -1,3 +1 @@ | |||
1 | hash | ||
2 | fixdep | fixdep | |
3 | docproc | ||
diff --git a/scripts/basic/Makefile b/scripts/basic/Makefile index 4c324a1f1e0e..4fcef87bb875 100644 --- a/scripts/basic/Makefile +++ b/scripts/basic/Makefile | |||
@@ -7,9 +7,8 @@ | |||
7 | # .config is included by main Makefile. | 7 | # .config is included by main Makefile. |
8 | # --------------------------------------------------------------------------- | 8 | # --------------------------------------------------------------------------- |
9 | # fixdep: Used to generate dependency information during build process | 9 | # fixdep: Used to generate dependency information during build process |
10 | # docproc: Used in Documentation/DocBook | ||
11 | 10 | ||
12 | hostprogs-y := fixdep docproc | 11 | hostprogs-y := fixdep |
13 | always := $(hostprogs-y) | 12 | always := $(hostprogs-y) |
14 | 13 | ||
15 | # fixdep is needed to compile other host programs | 14 | # fixdep is needed to compile other host programs |
diff --git a/scripts/basic/docproc.c b/scripts/docproc.c index 98dec87974d0..98dec87974d0 100644 --- a/scripts/basic/docproc.c +++ b/scripts/docproc.c | |||
diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh index e12b1a7525cf..b482f162a18a 100644 --- a/scripts/gen_initramfs_list.sh +++ b/scripts/gen_initramfs_list.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/sh |
2 | # Copyright (C) Martin Schlemmer <azarah@nosferatu.za.org> | 2 | # Copyright (C) Martin Schlemmer <azarah@nosferatu.za.org> |
3 | # Copyright (C) 2006 Sam Ravnborg <sam@ravnborg.org> | 3 | # Copyright (C) 2006 Sam Ravnborg <sam@ravnborg.org> |
4 | # | 4 | # |
@@ -105,9 +105,9 @@ list_parse() { | |||
105 | # for links, devices etc the format differs. See gen_init_cpio for details | 105 | # for links, devices etc the format differs. See gen_init_cpio for details |
106 | parse() { | 106 | parse() { |
107 | local location="$1" | 107 | local location="$1" |
108 | local name="${location/${srcdir}//}" | 108 | local name="/${location#${srcdir}}" |
109 | # change '//' into '/' | 109 | # change '//' into '/' |
110 | name="${name//\/\///}" | 110 | name=$(echo "$name" | sed -e 's://*:/:g') |
111 | local mode="$2" | 111 | local mode="$2" |
112 | local uid="$3" | 112 | local uid="$3" |
113 | local gid="$4" | 113 | local gid="$4" |
@@ -117,8 +117,8 @@ parse() { | |||
117 | [ "$root_gid" = "squash" ] && gid=0 || [ "$gid" -eq "$root_gid" ] && gid=0 | 117 | [ "$root_gid" = "squash" ] && gid=0 || [ "$gid" -eq "$root_gid" ] && gid=0 |
118 | local str="${mode} ${uid} ${gid}" | 118 | local str="${mode} ${uid} ${gid}" |
119 | 119 | ||
120 | [ "${ftype}" == "invalid" ] && return 0 | 120 | [ "${ftype}" = "invalid" ] && return 0 |
121 | [ "${location}" == "${srcdir}" ] && return 0 | 121 | [ "${location}" = "${srcdir}" ] && return 0 |
122 | 122 | ||
123 | case "${ftype}" in | 123 | case "${ftype}" in |
124 | "file") | 124 | "file") |
@@ -192,7 +192,7 @@ input_file() { | |||
192 | if [ -f "$1" ]; then | 192 | if [ -f "$1" ]; then |
193 | ${dep_list}header "$1" | 193 | ${dep_list}header "$1" |
194 | is_cpio="$(echo "$1" | sed 's/^.*\.cpio\(\..*\)\?/cpio/')" | 194 | is_cpio="$(echo "$1" | sed 's/^.*\.cpio\(\..*\)\?/cpio/')" |
195 | if [ $2 -eq 0 -a ${is_cpio} == "cpio" ]; then | 195 | if [ $2 -eq 0 -a ${is_cpio} = "cpio" ]; then |
196 | cpio_file=$1 | 196 | cpio_file=$1 |
197 | echo "$1" | grep -q '^.*\.cpio\..*' && is_cpio_compressed="compressed" | 197 | echo "$1" | grep -q '^.*\.cpio\..*' && is_cpio_compressed="compressed" |
198 | [ ! -z ${dep_list} ] && echo "$1" | 198 | [ ! -z ${dep_list} ] && echo "$1" |
@@ -204,7 +204,7 @@ input_file() { | |||
204 | else | 204 | else |
205 | echo "$1 \\" | 205 | echo "$1 \\" |
206 | cat "$1" | while read type dir file perm ; do | 206 | cat "$1" | while read type dir file perm ; do |
207 | if [ "$type" == "file" ]; then | 207 | if [ "$type" = "file" ]; then |
208 | echo "$file \\"; | 208 | echo "$file \\"; |
209 | fi | 209 | fi |
210 | done | 210 | done |
@@ -226,7 +226,7 @@ cpio_list= | |||
226 | output="/dev/stdout" | 226 | output="/dev/stdout" |
227 | output_file="" | 227 | output_file="" |
228 | is_cpio_compressed= | 228 | is_cpio_compressed= |
229 | compr="gzip -9 -f" | 229 | compr="gzip -n -9 -f" |
230 | 230 | ||
231 | arg="$1" | 231 | arg="$1" |
232 | case "$arg" in | 232 | case "$arg" in |
@@ -240,7 +240,7 @@ case "$arg" in | |||
240 | output_file="$1" | 240 | output_file="$1" |
241 | cpio_list="$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)" | 241 | cpio_list="$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)" |
242 | output=${cpio_list} | 242 | output=${cpio_list} |
243 | echo "$output_file" | grep -q "\.gz$" && compr="gzip -9 -f" | 243 | echo "$output_file" | grep -q "\.gz$" && compr="gzip -n -9 -f" |
244 | echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f" | 244 | echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f" |
245 | echo "$output_file" | grep -q "\.lzma$" && compr="lzma -9 -f" | 245 | echo "$output_file" | grep -q "\.lzma$" && compr="lzma -9 -f" |
246 | echo "$output_file" | grep -q "\.xz$" && \ | 246 | echo "$output_file" | grep -q "\.xz$" && \ |
@@ -287,8 +287,15 @@ done | |||
287 | # we are careful to delete tmp files | 287 | # we are careful to delete tmp files |
288 | if [ ! -z ${output_file} ]; then | 288 | if [ ! -z ${output_file} ]; then |
289 | if [ -z ${cpio_file} ]; then | 289 | if [ -z ${cpio_file} ]; then |
290 | timestamp= | ||
291 | if test -n "$KBUILD_BUILD_TIMESTAMP"; then | ||
292 | timestamp="$(date -d"$KBUILD_BUILD_TIMESTAMP" +%s || :)" | ||
293 | if test -n "$timestamp"; then | ||
294 | timestamp="-t $timestamp" | ||
295 | fi | ||
296 | fi | ||
290 | cpio_tfile="$(mktemp ${TMPDIR:-/tmp}/cpiofile.XXXXXX)" | 297 | cpio_tfile="$(mktemp ${TMPDIR:-/tmp}/cpiofile.XXXXXX)" |
291 | usr/gen_init_cpio ${cpio_list} > ${cpio_tfile} | 298 | usr/gen_init_cpio $timestamp ${cpio_list} > ${cpio_tfile} |
292 | else | 299 | else |
293 | cpio_tfile=${cpio_file} | 300 | cpio_tfile=${cpio_file} |
294 | fi | 301 | fi |
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 60dd3eb9366e..487ac6f37ca2 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c | |||
@@ -500,6 +500,8 @@ static void optimize_result(void) | |||
500 | 500 | ||
501 | /* find the token with the breates profit value */ | 501 | /* find the token with the breates profit value */ |
502 | best = find_best_token(); | 502 | best = find_best_token(); |
503 | if (token_profit[best] == 0) | ||
504 | break; | ||
503 | 505 | ||
504 | /* place it in the "best" table */ | 506 | /* place it in the "best" table */ |
505 | best_table_len[i] = 2; | 507 | best_table_len[i] = 2; |
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h index 50ad317a4bf9..f221ddf69080 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h | |||
@@ -42,6 +42,16 @@ if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then | |||
42 | else | 42 | else |
43 | TIMESTAMP=$KBUILD_BUILD_TIMESTAMP | 43 | TIMESTAMP=$KBUILD_BUILD_TIMESTAMP |
44 | fi | 44 | fi |
45 | if test -z "$KBUILD_BUILD_USER"; then | ||
46 | LINUX_COMPILE_BY=$(whoami | sed 's/\\/\\\\/') | ||
47 | else | ||
48 | LINUX_COMPILE_BY=$KBUILD_BUILD_USER | ||
49 | fi | ||
50 | if test -z "$KBUILD_BUILD_HOST"; then | ||
51 | LINUX_COMPILE_HOST=`hostname` | ||
52 | else | ||
53 | LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST | ||
54 | fi | ||
45 | 55 | ||
46 | UTS_VERSION="#$VERSION" | 56 | UTS_VERSION="#$VERSION" |
47 | CONFIG_FLAGS="" | 57 | CONFIG_FLAGS="" |
@@ -63,20 +73,8 @@ UTS_TRUNCATE="cut -b -$UTS_LEN" | |||
63 | 73 | ||
64 | echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\" | 74 | echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\" |
65 | 75 | ||
66 | echo \#define LINUX_COMPILE_TIME \"`date +%T`\" | 76 | echo \#define LINUX_COMPILE_BY \"`echo $LINUX_COMPILE_BY | $UTS_TRUNCATE`\" |
67 | echo \#define LINUX_COMPILE_BY \"`whoami`\" | 77 | echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\" |
68 | echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\" | ||
69 | |||
70 | domain=`dnsdomainname 2> /dev/null` | ||
71 | if [ -z "$domain" ]; then | ||
72 | domain=`domainname 2> /dev/null` | ||
73 | fi | ||
74 | |||
75 | if [ -n "$domain" ]; then | ||
76 | echo \#define LINUX_COMPILE_DOMAIN \"`echo $domain | $UTS_TRUNCATE`\" | ||
77 | else | ||
78 | echo \#define LINUX_COMPILE_DOMAIN | ||
79 | fi | ||
80 | 78 | ||
81 | echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\" | 79 | echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\" |
82 | ) > .tmpcompile | 80 | ) > .tmpcompile |
@@ -91,8 +89,8 @@ UTS_TRUNCATE="cut -b -$UTS_LEN" | |||
91 | # first line. | 89 | # first line. |
92 | 90 | ||
93 | if [ -r $TARGET ] && \ | 91 | if [ -r $TARGET ] && \ |
94 | grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' $TARGET > .tmpver.1 && \ | 92 | grep -v 'UTS_VERSION' $TARGET > .tmpver.1 && \ |
95 | grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' .tmpcompile > .tmpver.2 && \ | 93 | grep -v 'UTS_VERSION' .tmpcompile > .tmpver.2 && \ |
96 | cmp -s .tmpver.1 .tmpver.2; then | 94 | cmp -s .tmpver.1 .tmpver.2; then |
97 | rm -f .tmpcompile | 95 | rm -f .tmpcompile |
98 | else | 96 | else |
diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c index 7f06884ecd41..af0f22fb1ef7 100644 --- a/usr/gen_init_cpio.c +++ b/usr/gen_init_cpio.c | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | static unsigned int offset; | 23 | static unsigned int offset; |
24 | static unsigned int ino = 721; | 24 | static unsigned int ino = 721; |
25 | static time_t default_mtime; | ||
25 | 26 | ||
26 | struct file_handler { | 27 | struct file_handler { |
27 | const char *type; | 28 | const char *type; |
@@ -102,7 +103,6 @@ static int cpio_mkslink(const char *name, const char *target, | |||
102 | unsigned int mode, uid_t uid, gid_t gid) | 103 | unsigned int mode, uid_t uid, gid_t gid) |
103 | { | 104 | { |
104 | char s[256]; | 105 | char s[256]; |
105 | time_t mtime = time(NULL); | ||
106 | 106 | ||
107 | if (name[0] == '/') | 107 | if (name[0] == '/') |
108 | name++; | 108 | name++; |
@@ -114,7 +114,7 @@ static int cpio_mkslink(const char *name, const char *target, | |||
114 | (long) uid, /* uid */ | 114 | (long) uid, /* uid */ |
115 | (long) gid, /* gid */ | 115 | (long) gid, /* gid */ |
116 | 1, /* nlink */ | 116 | 1, /* nlink */ |
117 | (long) mtime, /* mtime */ | 117 | (long) default_mtime, /* mtime */ |
118 | (unsigned)strlen(target)+1, /* filesize */ | 118 | (unsigned)strlen(target)+1, /* filesize */ |
119 | 3, /* major */ | 119 | 3, /* major */ |
120 | 1, /* minor */ | 120 | 1, /* minor */ |
@@ -152,7 +152,6 @@ static int cpio_mkgeneric(const char *name, unsigned int mode, | |||
152 | uid_t uid, gid_t gid) | 152 | uid_t uid, gid_t gid) |
153 | { | 153 | { |
154 | char s[256]; | 154 | char s[256]; |
155 | time_t mtime = time(NULL); | ||
156 | 155 | ||
157 | if (name[0] == '/') | 156 | if (name[0] == '/') |
158 | name++; | 157 | name++; |
@@ -164,7 +163,7 @@ static int cpio_mkgeneric(const char *name, unsigned int mode, | |||
164 | (long) uid, /* uid */ | 163 | (long) uid, /* uid */ |
165 | (long) gid, /* gid */ | 164 | (long) gid, /* gid */ |
166 | 2, /* nlink */ | 165 | 2, /* nlink */ |
167 | (long) mtime, /* mtime */ | 166 | (long) default_mtime, /* mtime */ |
168 | 0, /* filesize */ | 167 | 0, /* filesize */ |
169 | 3, /* major */ | 168 | 3, /* major */ |
170 | 1, /* minor */ | 169 | 1, /* minor */ |
@@ -242,7 +241,6 @@ static int cpio_mknod(const char *name, unsigned int mode, | |||
242 | unsigned int maj, unsigned int min) | 241 | unsigned int maj, unsigned int min) |
243 | { | 242 | { |
244 | char s[256]; | 243 | char s[256]; |
245 | time_t mtime = time(NULL); | ||
246 | 244 | ||
247 | if (dev_type == 'b') | 245 | if (dev_type == 'b') |
248 | mode |= S_IFBLK; | 246 | mode |= S_IFBLK; |
@@ -259,7 +257,7 @@ static int cpio_mknod(const char *name, unsigned int mode, | |||
259 | (long) uid, /* uid */ | 257 | (long) uid, /* uid */ |
260 | (long) gid, /* gid */ | 258 | (long) gid, /* gid */ |
261 | 1, /* nlink */ | 259 | 1, /* nlink */ |
262 | (long) mtime, /* mtime */ | 260 | (long) default_mtime, /* mtime */ |
263 | 0, /* filesize */ | 261 | 0, /* filesize */ |
264 | 3, /* major */ | 262 | 3, /* major */ |
265 | 1, /* minor */ | 263 | 1, /* minor */ |
@@ -460,7 +458,7 @@ static int cpio_mkfile_line(const char *line) | |||
460 | static void usage(const char *prog) | 458 | static void usage(const char *prog) |
461 | { | 459 | { |
462 | fprintf(stderr, "Usage:\n" | 460 | fprintf(stderr, "Usage:\n" |
463 | "\t%s <cpio_list>\n" | 461 | "\t%s [-t <timestamp>] <cpio_list>\n" |
464 | "\n" | 462 | "\n" |
465 | "<cpio_list> is a file containing newline separated entries that\n" | 463 | "<cpio_list> is a file containing newline separated entries that\n" |
466 | "describe the files to be included in the initramfs archive:\n" | 464 | "describe the files to be included in the initramfs archive:\n" |
@@ -491,7 +489,11 @@ static void usage(const char *prog) | |||
491 | "nod /dev/console 0600 0 0 c 5 1\n" | 489 | "nod /dev/console 0600 0 0 c 5 1\n" |
492 | "dir /root 0700 0 0\n" | 490 | "dir /root 0700 0 0\n" |
493 | "dir /sbin 0755 0 0\n" | 491 | "dir /sbin 0755 0 0\n" |
494 | "file /sbin/kinit /usr/src/klibc/kinit/kinit 0755 0 0\n", | 492 | "file /sbin/kinit /usr/src/klibc/kinit/kinit 0755 0 0\n" |
493 | "\n" | ||
494 | "<timestamp> is time in seconds since Epoch that will be used\n" | ||
495 | "as mtime for symlinks, special files and directories. The default\n" | ||
496 | "is to use the current time for these entries.\n", | ||
495 | prog); | 497 | prog); |
496 | } | 498 | } |
497 | 499 | ||
@@ -529,17 +531,42 @@ int main (int argc, char *argv[]) | |||
529 | char *args, *type; | 531 | char *args, *type; |
530 | int ec = 0; | 532 | int ec = 0; |
531 | int line_nr = 0; | 533 | int line_nr = 0; |
534 | const char *filename; | ||
535 | |||
536 | default_mtime = time(NULL); | ||
537 | while (1) { | ||
538 | int opt = getopt(argc, argv, "t:h"); | ||
539 | char *invalid; | ||
532 | 540 | ||
533 | if (2 != argc) { | 541 | if (opt == -1) |
542 | break; | ||
543 | switch (opt) { | ||
544 | case 't': | ||
545 | default_mtime = strtol(optarg, &invalid, 10); | ||
546 | if (!*optarg || *invalid) { | ||
547 | fprintf(stderr, "Invalid timestamp: %s\n", | ||
548 | optarg); | ||
549 | usage(argv[0]); | ||
550 | exit(1); | ||
551 | } | ||
552 | break; | ||
553 | case 'h': | ||
554 | case '?': | ||
555 | usage(argv[0]); | ||
556 | exit(opt == 'h' ? 0 : 1); | ||
557 | } | ||
558 | } | ||
559 | |||
560 | if (argc - optind != 1) { | ||
534 | usage(argv[0]); | 561 | usage(argv[0]); |
535 | exit(1); | 562 | exit(1); |
536 | } | 563 | } |
537 | 564 | filename = argv[optind]; | |
538 | if (!strcmp(argv[1], "-")) | 565 | if (!strcmp(filename, "-")) |
539 | cpio_list = stdin; | 566 | cpio_list = stdin; |
540 | else if (! (cpio_list = fopen(argv[1], "r"))) { | 567 | else if (!(cpio_list = fopen(filename, "r"))) { |
541 | fprintf(stderr, "ERROR: unable to open '%s': %s\n\n", | 568 | fprintf(stderr, "ERROR: unable to open '%s': %s\n\n", |
542 | argv[1], strerror(errno)); | 569 | filename, strerror(errno)); |
543 | usage(argv[0]); | 570 | usage(argv[0]); |
544 | exit(1); | 571 | exit(1); |
545 | } | 572 | } |