Merge branch 'for-33' of git://repo.or.cz/linux-kbuild

* 'for-33' of git://repo.or.cz/linux-kbuild: (29 commits)
net: fix for utsrelease.h moving to generated
gen_init_cpio: fixed fwrite warning
kbuild: fix make clean after mismerge
kbuild: generate modules.builtin
genksyms: properly consider EXPORT_UNUSED_SYMBOL{,_GPL}()
score: add asm/asm-offsets.h wrapper
unifdef: update to upstream revision 1.190
kbuild: specify absolute paths for cscope
kbuild: create include/generated in silentoldconfig
scripts/package: deb-pkg: use fakeroot if available
scripts/package: add KBUILD_PKG_ROOTCMD variable
scripts/package: tar-pkg: use tar --owner=root
Kbuild: clean up marker
net: add net_tstamp.h to headers_install
kbuild: move utsrelease.h to include/generated
kbuild: move autoconf.h to include/generated
drop explicit include of autoconf.h
kbuild: move compile.h to include/generated
kbuild: drop include/asm
kbuild: do not check for include/asm-$ARCH
...

Fixed non-conflicting clean merge of modpost.c as per comments from
Stephen Rothwell (modpost.c had grown an include of linux/autoconf.h
that needed to be changed to generated/autoconf.h)

+577 -422
+1 -6
.gitignore
··· 22 *.lst 23 *.symtypes 24 *.order 25 *.elf 26 *.bin 27 *.gz ··· 46 # 47 # Generated include files 48 # 49 - include/asm 50 - include/asm-*/asm-offsets.h 51 include/config 52 - include/linux/autoconf.h 53 - include/linux/compile.h 54 include/linux/version.h 55 - include/linux/utsrelease.h 56 - include/linux/bounds.h 57 include/generated 58 59 # stgit generated dirs
··· 22 *.lst 23 *.symtypes 24 *.order 25 + modules.builtin 26 *.elf 27 *.bin 28 *.gz ··· 45 # 46 # Generated include files 47 # 48 include/config 49 include/linux/version.h 50 include/generated 51 52 # stgit generated dirs
+1
Documentation/dontdiff
··· 103 gen-devlist 104 gen_crc32table 105 gen_init_cpio 106 genheaders 107 genksyms 108 *_gray256.c
··· 103 gen-devlist 104 gen_crc32table 105 gen_init_cpio 106 + generated 107 genheaders 108 genksyms 109 *_gray256.c
+14
Documentation/kbuild/kbuild.txt
··· 1 Environment variables 2 3 KCPPFLAGS
··· 1 + Output files 2 + 3 + modules.order 4 + -------------------------------------------------- 5 + This file records the order in which modules appear in Makefiles. This 6 + is used by modprobe to deterministically resolve aliases that match 7 + multiple modules. 8 + 9 + modules.builtin 10 + -------------------------------------------------- 11 + This file lists all modules that are built into the kernel. This is used 12 + by modprobe to not fail when trying to load something builtin. 13 + 14 + 15 Environment variables 16 17 KCPPFLAGS
+7 -1
Documentation/kbuild/kconfig.txt
··· 103 This environment variable can be set to specify the path & name of the 104 "auto.conf" file. Its default value is "include/config/auto.conf". 105 106 KCONFIG_AUTOHEADER 107 -------------------------------------------------- 108 This environment variable can be set to specify the path & name of the 109 - "autoconf.h" (header) file. Its default value is "include/linux/autoconf.h". 110 111 112 ======================================================================
··· 103 This environment variable can be set to specify the path & name of the 104 "auto.conf" file. Its default value is "include/config/auto.conf". 105 106 + KCONFIG_TRISTATE 107 + -------------------------------------------------- 108 + This environment variable can be set to specify the path & name of the 109 + "tristate.conf" file. Its default value is "include/config/tristate.conf". 110 + 111 KCONFIG_AUTOHEADER 112 -------------------------------------------------- 113 This environment variable can be set to specify the path & name of the 114 + "autoconf.h" (header) file. 115 + Its default value is "include/generated/autoconf.h". 116 117 118 ======================================================================
+2 -2
Kbuild
··· 8 ##### 9 # 1) Generate bounds.h 10 11 - bounds-file := include/linux/bounds.h 12 13 always := $(bounds-file) 14 targets := $(bounds-file) kernel/bounds.s ··· 43 # 2) Generate asm-offsets.h 44 # 45 46 - offsets-file := include/asm/asm-offsets.h 47 48 always += $(offsets-file) 49 targets += $(offsets-file)
··· 8 ##### 9 # 1) Generate bounds.h 10 11 + bounds-file := include/generated/bounds.h 12 13 always := $(bounds-file) 14 targets := $(bounds-file) kernel/bounds.s ··· 43 # 2) Generate asm-offsets.h 44 # 45 46 + offsets-file := include/generated/asm-offsets.h 47 48 always += $(offsets-file) 49 targets += $(offsets-file)
+6
MAINTAINERS
··· 5434 F: include/linux/uwb.h 5435 F: include/linux/uwb/ 5436 5437 UNIFORM CDROM DRIVER 5438 M: Jens Axboe <axboe@kernel.dk> 5439 W: http://www.kernel.dk
··· 5434 F: include/linux/uwb.h 5435 F: include/linux/uwb/ 5436 5437 + UNIFDEF 5438 + M: Tony Finch <dot@dotat.at> 5439 + W: http://dotat.at/prog/unifdef 5440 + S: Maintained 5441 + F: scripts/unifdef.c 5442 + 5443 UNIFORM CDROM DRIVER 5444 M: Jens Axboe <axboe@kernel.dk> 5445 W: http://www.kernel.dk
+26 -70
Makefile
··· 334 335 # Use LINUXINCLUDE when you must reference the include/ directory. 336 # Needed to be compatible with the O= option 337 - LINUXINCLUDE := -Iinclude \ 338 - $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \ 339 - -I$(srctree)/arch/$(hdr-arch)/include \ 340 - -include include/linux/autoconf.h 341 342 KBUILD_CPPFLAGS := -D__KERNEL__ 343 ··· 464 # Carefully list dependencies so we do not try to build scripts twice 465 # in parallel 466 PHONY += scripts 467 - scripts: scripts_basic include/config/auto.conf 468 $(Q)$(MAKE) $(build)=$(@) 469 470 # Objects we will link into vmlinux / subdirs we need to visit ··· 491 # with it and forgot to run make oldconfig. 492 # if auto.conf.cmd is missing then we are probably in a cleaned tree so 493 # we execute the config step to be sure to catch updated Kconfig files 494 - include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd 495 $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig 496 else 497 - # external modules needs include/linux/autoconf.h and include/config/auto.conf 498 # but do not care if they are up-to-date. Use auto.conf to trigger the test 499 PHONY += include/config/auto.conf 500 501 include/config/auto.conf: 502 - $(Q)test -e include/linux/autoconf.h -a -e $@ || ( \ 503 echo; \ 504 echo " ERROR: Kernel configuration is invalid."; \ 505 - echo " include/linux/autoconf.h or $@ are missing."; \ 506 echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ 507 echo; \ 508 /bin/false) ··· 876 PHONY += $(vmlinux-dirs) 877 $(vmlinux-dirs): prepare scripts 878 $(Q)$(MAKE) $(build)=$@ 879 880 # Build the kernel release string 881 # ··· 957 # prepare3 is used to check if we are building in a separate output directory, 958 # and if so do: 959 # 1) Check that make has not been executed in the kernel src $(srctree) 960 - # 2) Create the include2 directory, used for the second asm symlink 961 prepare3: include/config/kernel.release 962 ifneq ($(KBUILD_SRC),) 963 @$(kecho) ' Using $(srctree) as source for kernel' ··· 965 echo " in the '$(srctree)' directory.";\ 966 /bin/false; \ 967 fi; 968 - $(Q)if [ ! -d include2 ]; then \ 969 - mkdir -p include2; \ 970 - ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm; \ 971 - fi 972 endif 973 974 # prepare2 creates a makefile if using a separate output directory 975 prepare2: prepare3 outputmakefile 976 977 - prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ 978 - include/asm include/config/auto.conf 979 $(cmd_crmodverdir) 980 981 archprepare: prepare1 scripts_basic ··· 982 983 # All the preparing.. 984 prepare: prepare0 985 - 986 - # The asm symlink changes when $(ARCH) changes. 987 - # Detect this and ask user to run make mrproper 988 - # If asm is a stale symlink (point to dir that does not exist) remove it 989 - define check-symlink 990 - set -e; \ 991 - if [ -L include/asm ]; then \ 992 - asmlink=`readlink include/asm | cut -d '-' -f 2`; \ 993 - if [ "$$asmlink" != "$(SRCARCH)" ]; then \ 994 - echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \ 995 - echo " set ARCH or save .config and run 'make mrproper' to fix it"; \ 996 - exit 1; \ 997 - fi; \ 998 - test -e $$asmlink || rm include/asm; \ 999 - elif [ -d include/asm ]; then \ 1000 - echo "ERROR: $@ is a directory but a symlink was expected";\ 1001 - exit 1; \ 1002 - fi 1003 - endef 1004 - 1005 - # We create the target directory of the symlink if it does 1006 - # not exist so the test in check-symlink works and we have a 1007 - # directory for generated filesas used by some architectures. 1008 - define create-symlink 1009 - if [ ! -L include/asm ]; then \ 1010 - $(kecho) ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \ 1011 - if [ ! -d include/asm-$(SRCARCH) ]; then \ 1012 - mkdir -p include/asm-$(SRCARCH); \ 1013 - fi; \ 1014 - ln -fsn asm-$(SRCARCH) $@; \ 1015 - fi 1016 - endef 1017 - 1018 - include/asm: FORCE 1019 - $(Q)$(check-symlink) 1020 - $(Q)$(create-symlink) 1021 1022 # Generate some files 1023 # --------------------------------------------------------------------------- ··· 1007 include/linux/version.h: $(srctree)/Makefile FORCE 1008 $(call filechk,version.h) 1009 1010 - include/linux/utsrelease.h: include/config/kernel.release FORCE 1011 $(call filechk,utsrelease.h) 1012 1013 PHONY += headerdep ··· 1037 export INSTALL_HDR_PATH = $(objtree)/usr 1038 1039 hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj 1040 - # Find out where the Kbuild file is located to support 1041 - # arch/$(ARCH)/include/asm 1042 - hdr-dir = $(strip \ 1043 - $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild), \ 1044 - arch/$(hdr-arch)/include/asm, include/asm-$(hdr-arch))) 1045 1046 # If we do an all arch process set dst to asm-$(hdr-arch) 1047 hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) ··· 1051 1052 PHONY += headers_install 1053 headers_install: __headers 1054 - $(if $(wildcard $(srctree)/$(hdr-dir)/Kbuild),, \ 1055 $(error Headers not exportable for the $(SRCARCH) architecture)) 1056 $(Q)$(MAKE) $(hdr-inst)=include 1057 - $(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) 1058 1059 PHONY += headers_check_all 1060 headers_check_all: headers_install_all ··· 1063 PHONY += headers_check 1064 headers_check: headers_install 1065 $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1 1066 - $(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) HDRCHECK=1 1067 1068 # --------------------------------------------------------------------------- 1069 # Modules ··· 1083 PHONY += modules 1084 modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) 1085 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order 1086 @$(kecho) ' Building modules, stage 2.'; 1087 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost 1088 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild ··· 1113 ln -s $(objtree) $(MODLIB)/build ; \ 1114 fi 1115 @cp -f $(objtree)/modules.order $(MODLIB)/ 1116 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst 1117 1118 # This depmod is only for convenience to give the initial ··· 1152 .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map 1153 1154 # Directories & files removed with 'make mrproper' 1155 - MRPROPER_DIRS += include/config include2 usr/include include/generated 1156 - MRPROPER_FILES += .config .config.old include/asm .version .old_version \ 1157 - include/linux/autoconf.h include/linux/version.h \ 1158 - include/linux/utsrelease.h \ 1159 - include/linux/bounds.h include/asm*/asm-offsets.h \ 1160 - Module.symvers Module.markers tags TAGS cscope* 1161 1162 # clean - Delete most, but leave enough to build external modules 1163 # ··· 1174 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ 1175 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ 1176 -o -name '*.symtypes' -o -name 'modules.order' \ 1177 - -o -name 'Module.markers' -o -name '.tmp_*.o.*' \ 1178 -o -name '*.gcno' \) -type f -print | xargs rm -f 1179 1180 # mrproper - Delete all generated files, including .config ··· 1372 1373 clean: rm-dirs := $(MODVERDIR) 1374 clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \ 1375 - $(KBUILD_EXTMOD)/Module.markers \ 1376 - $(KBUILD_EXTMOD)/modules.order 1377 clean: $(clean-dirs) 1378 $(call cmd,rmdirs) 1379 $(call cmd,rmfiles)
··· 334 335 # Use LINUXINCLUDE when you must reference the include/ directory. 336 # Needed to be compatible with the O= option 337 + LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include -Iinclude \ 338 + $(if $(KBUILD_SRC), -I$(srctree)/include) \ 339 + -include include/generated/autoconf.h 340 341 KBUILD_CPPFLAGS := -D__KERNEL__ 342 ··· 465 # Carefully list dependencies so we do not try to build scripts twice 466 # in parallel 467 PHONY += scripts 468 + scripts: scripts_basic include/config/auto.conf include/config/tristate.conf 469 $(Q)$(MAKE) $(build)=$(@) 470 471 # Objects we will link into vmlinux / subdirs we need to visit ··· 492 # with it and forgot to run make oldconfig. 493 # if auto.conf.cmd is missing then we are probably in a cleaned tree so 494 # we execute the config step to be sure to catch updated Kconfig files 495 + include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd 496 $(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig 497 else 498 + # external modules needs include/generated/autoconf.h and include/config/auto.conf 499 # but do not care if they are up-to-date. Use auto.conf to trigger the test 500 PHONY += include/config/auto.conf 501 502 include/config/auto.conf: 503 + $(Q)test -e include/generated/autoconf.h -a -e $@ || ( \ 504 echo; \ 505 echo " ERROR: Kernel configuration is invalid."; \ 506 + echo " include/generated/autoconf.h or $@ are missing.";\ 507 echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ 508 echo; \ 509 /bin/false) ··· 877 PHONY += $(vmlinux-dirs) 878 $(vmlinux-dirs): prepare scripts 879 $(Q)$(MAKE) $(build)=$@ 880 + ifdef CONFIG_MODULES 881 + $(Q)$(MAKE) $(modbuiltin)=$@ 882 + endif 883 884 # Build the kernel release string 885 # ··· 955 # prepare3 is used to check if we are building in a separate output directory, 956 # and if so do: 957 # 1) Check that make has not been executed in the kernel src $(srctree) 958 prepare3: include/config/kernel.release 959 ifneq ($(KBUILD_SRC),) 960 @$(kecho) ' Using $(srctree) as source for kernel' ··· 964 echo " in the '$(srctree)' directory.";\ 965 /bin/false; \ 966 fi; 967 endif 968 969 # prepare2 creates a makefile if using a separate output directory 970 prepare2: prepare3 outputmakefile 971 972 + prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \ 973 + include/config/auto.conf 974 $(cmd_crmodverdir) 975 976 archprepare: prepare1 scripts_basic ··· 985 986 # All the preparing.. 987 prepare: prepare0 988 989 # Generate some files 990 # --------------------------------------------------------------------------- ··· 1046 include/linux/version.h: $(srctree)/Makefile FORCE 1047 $(call filechk,version.h) 1048 1049 + include/generated/utsrelease.h: include/config/kernel.release FORCE 1050 $(call filechk,utsrelease.h) 1051 1052 PHONY += headerdep ··· 1076 export INSTALL_HDR_PATH = $(objtree)/usr 1077 1078 hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj 1079 1080 # If we do an all arch process set dst to asm-$(hdr-arch) 1081 hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) ··· 1095 1096 PHONY += headers_install 1097 headers_install: __headers 1098 + $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild),, \ 1099 $(error Headers not exportable for the $(SRCARCH) architecture)) 1100 $(Q)$(MAKE) $(hdr-inst)=include 1101 + $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) 1102 1103 PHONY += headers_check_all 1104 headers_check_all: headers_install_all ··· 1107 PHONY += headers_check 1108 headers_check: headers_install 1109 $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1 1110 + $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) HDRCHECK=1 1111 1112 # --------------------------------------------------------------------------- 1113 # Modules ··· 1127 PHONY += modules 1128 modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) 1129 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order 1130 + $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.builtin) > $(objtree)/modules.builtin 1131 @$(kecho) ' Building modules, stage 2.'; 1132 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost 1133 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild ··· 1156 ln -s $(objtree) $(MODLIB)/build ; \ 1157 fi 1158 @cp -f $(objtree)/modules.order $(MODLIB)/ 1159 + @cp -f $(objtree)/modules.builtin $(MODLIB)/ 1160 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst 1161 1162 # This depmod is only for convenience to give the initial ··· 1194 .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map 1195 1196 # Directories & files removed with 'make mrproper' 1197 + MRPROPER_DIRS += include/config usr/include include/generated 1198 + MRPROPER_FILES += .config .config.old .version .old_version \ 1199 + include/linux/version.h \ 1200 + Module.symvers tags TAGS cscope* 1201 1202 # clean - Delete most, but leave enough to build external modules 1203 # ··· 1218 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ 1219 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ 1220 -o -name '*.symtypes' -o -name 'modules.order' \ 1221 + -o -name modules.builtin -o -name '.tmp_*.o.*' \ 1222 -o -name '*.gcno' \) -type f -print | xargs rm -f 1223 1224 # mrproper - Delete all generated files, including .config ··· 1416 1417 clean: rm-dirs := $(MODVERDIR) 1418 clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \ 1419 + $(KBUILD_EXTMOD)/modules.order \ 1420 + $(KBUILD_EXTMOD)/modules.builtin 1421 clean: $(clean-dirs) 1422 $(call cmd,rmdirs) 1423 $(call cmd,rmfiles)
+1 -1
arch/alpha/boot/bootp.c
··· 9 */ 10 #include <linux/kernel.h> 11 #include <linux/string.h> 12 - #include <linux/utsrelease.h> 13 #include <linux/mm.h> 14 15 #include <asm/system.h>
··· 9 */ 10 #include <linux/kernel.h> 11 #include <linux/string.h> 12 + #include <generated/utsrelease.h> 13 #include <linux/mm.h> 14 15 #include <asm/system.h>
+1 -1
arch/alpha/boot/bootpz.c
··· 11 */ 12 #include <linux/kernel.h> 13 #include <linux/string.h> 14 - #include <linux/utsrelease.h> 15 #include <linux/mm.h> 16 17 #include <asm/system.h>
··· 11 */ 12 #include <linux/kernel.h> 13 #include <linux/string.h> 14 + #include <generated/utsrelease.h> 15 #include <linux/mm.h> 16 17 #include <asm/system.h>
+1 -1
arch/alpha/boot/main.c
··· 7 */ 8 #include <linux/kernel.h> 9 #include <linux/string.h> 10 - #include <linux/utsrelease.h> 11 #include <linux/mm.h> 12 13 #include <asm/system.h>
··· 7 */ 8 #include <linux/kernel.h> 9 #include <linux/string.h> 10 + #include <generated/utsrelease.h> 11 #include <linux/mm.h> 12 13 #include <asm/system.h>
+1
arch/alpha/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+2 -12
arch/arm/Makefile
··· 242 243 boot := arch/arm/boot 244 245 - # Update machine arch and proc symlinks if something which affects 246 - # them changed. We use .arch to indicate when they were updated 247 - # last, otherwise make uses the target directory mtime. 248 - 249 - archprepare: maketools 250 - 251 - PHONY += maketools FORCE 252 - maketools: include/linux/version.h FORCE 253 - $(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h 254 255 # Convert bzImage to zImage 256 bzImage: zImage ··· 253 254 zinstall install: vmlinux 255 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ 256 - 257 - CLEAN_FILES += include/asm-arm/mach-types.h \ 258 - include/asm-arm/arch include/asm-arm/.arch 259 260 # We use MRPROPER_FILES and CLEAN_FILES now 261 archclean:
··· 242 243 boot := arch/arm/boot 244 245 + archprepare: 246 + $(Q)$(MAKE) $(build)=arch/arm/tools include/generated/mach-types.h 247 248 # Convert bzImage to zImage 249 bzImage: zImage ··· 260 261 zinstall install: vmlinux 262 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ 263 264 # We use MRPROPER_FILES and CLEAN_FILES now 265 archclean:
+1
arch/arm/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+1
arch/arm/include/asm/mach-types.h
···
··· 1 + #include <generated/mach-types.h>
+1 -1
arch/arm/tools/Makefile
··· 4 # Copyright (C) 2001 Russell King 5 # 6 7 - include/asm-arm/mach-types.h: $(src)/gen-mach-types $(src)/mach-types 8 @echo ' Generating $@' 9 @mkdir -p $(dir $@) 10 $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; }
··· 4 # Copyright (C) 2001 Russell King 5 # 6 7 + include/generated/mach-types.h: $(src)/gen-mach-types $(src)/mach-types 8 @echo ' Generating $@' 9 @mkdir -p $(dir $@) 10 $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; }
+1 -1
arch/arm/tools/gen-mach-types
··· 1 #!/bin/awk 2 # 3 - # Awk script to generate include/asm-arm/mach-types.h 4 # 5 BEGIN { nr = 0 } 6 /^#/ { next }
··· 1 #!/bin/awk 2 # 3 + # Awk script to generate include/generated/mach-types.h 4 # 5 BEGIN { nr = 0 } 6 /^#/ { next }
+1
arch/avr32/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+1
arch/blackfin/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
-1
arch/cris/arch-v32/kernel/head.S
··· 10 * The macros found in mmu_defs_asm.h uses the ## concatenation operator, so 11 * -traditional must not be used when assembling this file. 12 */ 13 - #include <linux/autoconf.h> 14 #include <arch/memmap.h> 15 #include <hwregs/reg_rdwr.h> 16 #include <hwregs/intr_vect.h>
··· 10 * The macros found in mmu_defs_asm.h uses the ## concatenation operator, so 11 * -traditional must not be used when assembling this file. 12 */ 13 #include <arch/memmap.h> 14 #include <hwregs/reg_rdwr.h> 15 #include <hwregs/intr_vect.h>
+1
arch/cris/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
-1
arch/cris/kernel/asm-offsets.c
··· 1 #include <linux/sched.h> 2 #include <asm/thread_info.h> 3 - #include <linux/autoconf.h> 4 5 /* 6 * Generate definitions needed by assembly language modules.
··· 1 #include <linux/sched.h> 2 #include <asm/thread_info.h> 3 4 /* 5 * Generate definitions needed by assembly language modules.
-1
arch/cris/kernel/vmlinux.lds.S
··· 8 * the kernel has booted. 9 */ 10 11 - #include <linux/autoconf.h> 12 #include <asm-generic/vmlinux.lds.h> 13 #include <asm/page.h> 14
··· 8 * the kernel has booted. 9 */ 10 11 #include <asm-generic/vmlinux.lds.h> 12 #include <asm/page.h> 13
+1
arch/frv/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+1 -1
arch/frv/kernel/setup.c
··· 10 * 2 of the License, or (at your option) any later version. 11 */ 12 13 - #include <linux/utsrelease.h> 14 #include <linux/kernel.h> 15 #include <linux/sched.h> 16 #include <linux/delay.h>
··· 10 * 2 of the License, or (at your option) any later version. 11 */ 12 13 + #include <generated/utsrelease.h> 14 #include <linux/kernel.h> 15 #include <linux/sched.h> 16 #include <linux/delay.h>
+1
arch/h8300/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+1 -1
arch/ia64/Makefile
··· 103 PHONY += make_nr_irqs_h FORCE 104 105 make_nr_irqs_h: FORCE 106 - $(Q)$(MAKE) $(build)=arch/ia64/kernel include/asm-ia64/nr-irqs.h
··· 103 PHONY += make_nr_irqs_h FORCE 104 105 make_nr_irqs_h: FORCE 106 + $(Q)$(MAKE) $(build)=arch/ia64/kernel include/generated/nr-irqs.h
+1
arch/ia64/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+1 -1
arch/ia64/include/asm/irq.h
··· 13 14 #include <linux/types.h> 15 #include <linux/cpumask.h> 16 - #include <asm-ia64/nr-irqs.h> 17 18 static __inline__ int 19 irq_canonicalize (int irq)
··· 13 14 #include <linux/types.h> 15 #include <linux/cpumask.h> 16 + #include <generated/nr-irqs.h> 17 18 static __inline__ int 19 irq_canonicalize (int irq)
+2 -5
arch/ia64/kernel/Makefile
··· 81 endef 82 83 # We use internal kbuild rules to avoid the "is up to date" message from make 84 - arch/$(SRCARCH)/kernel/nr-irqs.s: $(srctree)/arch/$(SRCARCH)/kernel/nr-irqs.c \ 85 - $(wildcard $(srctree)/include/asm-ia64/*/irq.h) 86 $(Q)mkdir -p $(dir $@) 87 $(call if_changed_dep,cc_s_c) 88 89 - include/asm-ia64/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s 90 $(Q)mkdir -p $(dir $@) 91 $(call cmd,nr_irqs) 92 - 93 - clean-files += $(objtree)/include/asm-ia64/nr-irqs.h 94 95 # 96 # native ivt.S, entry.S and fsys.S
··· 81 endef 82 83 # We use internal kbuild rules to avoid the "is up to date" message from make 84 + arch/$(SRCARCH)/kernel/nr-irqs.s: arch/$(SRCARCH)/kernel/nr-irqs.c 85 $(Q)mkdir -p $(dir $@) 86 $(call if_changed_dep,cc_s_c) 87 88 + include/generated/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s 89 $(Q)mkdir -p $(dir $@) 90 $(call cmd,nr_irqs) 91 92 # 93 # native ivt.S, entry.S and fsys.S
-1
arch/ia64/kvm/asm-offsets.c
··· 22 * 23 */ 24 25 - #include <linux/autoconf.h> 26 #include <linux/kvm_host.h> 27 #include <linux/kbuild.h> 28
··· 22 * 23 */ 24 25 #include <linux/kvm_host.h> 26 #include <linux/kbuild.h> 27
+1
arch/m68k/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+1 -1
arch/m68k/kernel/head.S
··· 196 * for them and trying to understand what they mean. 197 * 198 * CONFIG_xxx: These are the obvious machine configuration defines created 199 - * during configuration. These are defined in include/linux/autoconf.h. 200 * 201 * CONSOLE: There is support for head.S console in this file. This 202 * console can talk to a Mac frame buffer, but could easily be extrapolated
··· 196 * for them and trying to understand what they mean. 197 * 198 * CONFIG_xxx: These are the obvious machine configuration defines created 199 + * during configuration. These are defined in autoconf.h. 200 * 201 * CONSOLE: There is support for head.S console in this file. This 202 * console can talk to a Mac frame buffer, but could easily be extrapolated
+1
arch/microblaze/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+1
arch/mips/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+1
arch/mn10300/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+1
arch/parisc/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+1
arch/powerpc/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+1 -1
arch/powerpc/platforms/52xx/efika.c
··· 10 */ 11 12 #include <linux/init.h> 13 - #include <linux/utsrelease.h> 14 #include <linux/pci.h> 15 #include <linux/of.h> 16 #include <asm/prom.h>
··· 10 */ 11 12 #include <linux/init.h> 13 + #include <generated/utsrelease.h> 14 #include <linux/pci.h> 15 #include <linux/of.h> 16 #include <asm/prom.h>
+1 -1
arch/powerpc/platforms/amigaone/setup.c
··· 14 15 #include <linux/kernel.h> 16 #include <linux/seq_file.h> 17 - #include <linux/utsrelease.h> 18 19 #include <asm/machdep.h> 20 #include <asm/cputable.h>
··· 14 15 #include <linux/kernel.h> 16 #include <linux/seq_file.h> 17 + #include <generated/utsrelease.h> 18 19 #include <asm/machdep.h> 20 #include <asm/cputable.h>
+2 -4
arch/powerpc/platforms/cell/spufs/Makefile
··· 13 SPU_AS := $(SPU_CROSS)gcc 14 SPU_LD := $(SPU_CROSS)ld 15 SPU_OBJCOPY := $(SPU_CROSS)objcopy 16 - SPU_CFLAGS := -O2 -Wall -I$(srctree)/include \ 17 - -I$(objtree)/include2 -D__KERNEL__ 18 - SPU_AFLAGS := -c -D__ASSEMBLY__ -I$(srctree)/include \ 19 - -I$(objtree)/include2 -D__KERNEL__ 20 SPU_LDFLAGS := -N -Ttext=0x0 21 22 $(obj)/switch.o: $(obj)/spu_save_dump.h $(obj)/spu_restore_dump.h
··· 13 SPU_AS := $(SPU_CROSS)gcc 14 SPU_LD := $(SPU_CROSS)ld 15 SPU_OBJCOPY := $(SPU_CROSS)objcopy 16 + SPU_CFLAGS := -O2 -Wall -I$(srctree)/include -D__KERNEL__ 17 + SPU_AFLAGS := -c -D__ASSEMBLY__ -I$(srctree)/include -D__KERNEL__ 18 SPU_LDFLAGS := -N -Ttext=0x0 19 20 $(obj)/switch.o: $(obj)/spu_save_dump.h $(obj)/spu_restore_dump.h
+1 -1
arch/powerpc/platforms/chrp/setup.c
··· 23 #include <linux/reboot.h> 24 #include <linux/init.h> 25 #include <linux/pci.h> 26 - #include <linux/utsrelease.h> 27 #include <linux/adb.h> 28 #include <linux/module.h> 29 #include <linux/delay.h>
··· 23 #include <linux/reboot.h> 24 #include <linux/init.h> 25 #include <linux/pci.h> 26 + #include <generated/utsrelease.h> 27 #include <linux/adb.h> 28 #include <linux/module.h> 29 #include <linux/delay.h>
+1 -1
arch/powerpc/platforms/powermac/bootx_init.c
··· 12 #include <linux/kernel.h> 13 #include <linux/string.h> 14 #include <linux/init.h> 15 - #include <linux/utsrelease.h> 16 #include <asm/sections.h> 17 #include <asm/prom.h> 18 #include <asm/page.h>
··· 12 #include <linux/kernel.h> 13 #include <linux/string.h> 14 #include <linux/init.h> 15 + #include <generated/utsrelease.h> 16 #include <asm/sections.h> 17 #include <asm/prom.h> 18 #include <asm/page.h>
+1
arch/s390/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+1
arch/score/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+3 -7
arch/sh/Makefile
··· 205 206 BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.srec uImage.bin \ 207 zImage vmlinux.srec romImage 208 - PHONY += maketools $(BOOT_TARGETS) FORCE 209 - 210 - maketools: include/linux/version.h FORCE 211 - $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h 212 213 all: $(KBUILD_IMAGE) 214 ··· 214 215 compressed: zImage 216 217 - archprepare: maketools 218 219 archclean: 220 $(Q)$(MAKE) $(clean)=$(boot) ··· 232 @echo ' uImage.bz2 - Kernel-only image for U-Boot (bzip2)' 233 @echo ' uImage.lzma - Kernel-only image for U-Boot (lzma)' 234 endef 235 - 236 - CLEAN_FILES += include/asm-sh/machtypes.h
··· 205 206 BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.srec uImage.bin \ 207 zImage vmlinux.srec romImage 208 + PHONY += $(BOOT_TARGETS) 209 210 all: $(KBUILD_IMAGE) 211 ··· 217 218 compressed: zImage 219 220 + archprepare: 221 + $(Q)$(MAKE) $(build)=arch/sh/tools include/generated/machtypes.h 222 223 archclean: 224 $(Q)$(MAKE) $(clean)=$(boot) ··· 234 @echo ' uImage.bz2 - Kernel-only image for U-Boot (bzip2)' 235 @echo ' uImage.lzma - Kernel-only image for U-Boot (lzma)' 236 endef
+1 -1
arch/sh/drivers/pci/fixups-rts7751r2d.c
··· 15 #include <mach/lboxre2.h> 16 #include <mach/r2d.h> 17 #include "pci-sh4.h" 18 - #include <asm/machtypes.h> 19 20 #define PCIMCR_MRSET_OFF 0xBFFFFFFF 21 #define PCIMCR_RFSH_OFF 0xFFFFFFFB
··· 15 #include <mach/lboxre2.h> 16 #include <mach/r2d.h> 17 #include "pci-sh4.h" 18 + #include <generated/machtypes.h> 19 20 #define PCIMCR_MRSET_OFF 0xBFFFFFFF 21 #define PCIMCR_RFSH_OFF 0xFFFFFFFB
-1
arch/sh/include/asm/.gitignore
··· 1 - machtypes.h
···
+1
arch/sh/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+1 -1
arch/sh/include/asm/machvec.h
··· 12 13 #include <linux/types.h> 14 #include <linux/time.h> 15 - #include <asm/machtypes.h> 16 17 struct sh_machine_vector { 18 void (*mv_setup)(char **cmdline_p);
··· 12 13 #include <linux/types.h> 14 #include <linux/time.h> 15 + #include <generated/machtypes.h> 16 17 struct sh_machine_vector { 18 void (*mv_setup)(char **cmdline_p);
+2 -2
arch/sh/tools/Makefile
··· 10 # Shamelessly cloned from ARM. 11 # 12 13 - include/asm-sh/machtypes.h: $(src)/gen-mach-types $(src)/mach-types 14 @echo ' Generating $@' 15 - $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi 16 $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; }
··· 10 # Shamelessly cloned from ARM. 11 # 12 13 + include/generated/machtypes.h: $(src)/gen-mach-types $(src)/mach-types 14 @echo ' Generating $@' 15 + $(Q)mkdir -p $(dir $@) 16 $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; }
+1 -1
arch/sh/tools/gen-mach-types
··· 1 #!/bin/awk 2 # 3 - # Awk script to generate include/asm-sh/machtypes.h 4 # Heavily based on arch/arm/tools/gen-mach-types 5 # 6 BEGIN { nr = 0 }
··· 1 #!/bin/awk 2 # 3 + # Awk script to generate include/generated/machtypes.h 4 # Heavily based on arch/arm/tools/gen-mach-types 5 # 6 BEGIN { nr = 0 }
+1
arch/sparc/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+1 -1
arch/um/Makefile
··· 149 150 $(SHARED_HEADERS)/kern_constants.h: 151 $(Q)mkdir -p $(dir $@) 152 - $(Q)echo '#include "../../../../include/asm/asm-offsets.h"' >$@ 153 154 export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH
··· 149 150 $(SHARED_HEADERS)/kern_constants.h: 151 $(Q)mkdir -p $(dir $@) 152 + $(Q)echo '#include "../../../../include/generated/asm-offsets.h"' >$@ 153 154 export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH
+1
arch/um/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+1 -1
arch/x86/boot/header.S
··· 16 */ 17 18 #include <asm/segment.h> 19 - #include <linux/utsrelease.h> 20 #include <asm/boot.h> 21 #include <asm/e820.h> 22 #include <asm/page_types.h>
··· 16 */ 17 18 #include <asm/segment.h> 19 + #include <generated/utsrelease.h> 20 #include <asm/boot.h> 21 #include <asm/e820.h> 22 #include <asm/page_types.h>
+2 -2
arch/x86/boot/version.c
··· 13 */ 14 15 #include "boot.h" 16 - #include <linux/utsrelease.h> 17 - #include <linux/compile.h> 18 19 const char kernel_version[] = 20 UTS_RELEASE " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ") "
··· 13 */ 14 15 #include "boot.h" 16 + #include <generated/utsrelease.h> 17 + #include <generated/compile.h> 18 19 const char kernel_version[] = 20 UTS_RELEASE " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ") "
+1
arch/x86/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
+1
arch/xtensa/include/asm/asm-offsets.h
···
··· 1 + #include <generated/asm-offsets.h>
-1
drivers/accessibility/braille/braille_console.c
··· 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 */ 23 24 - #include <linux/autoconf.h> 25 #include <linux/kernel.h> 26 #include <linux/module.h> 27 #include <linux/moduleparam.h>
··· 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 */ 23 24 #include <linux/kernel.h> 25 #include <linux/module.h> 26 #include <linux/moduleparam.h>
-2
drivers/hid/hid-lg.h
··· 1 #ifndef __HID_LG_H 2 #define __HID_LG_H 3 4 - #include <linux/autoconf.h> 5 - 6 #ifdef CONFIG_LOGITECH_FF 7 int lgff_init(struct hid_device *hdev); 8 #else
··· 1 #ifndef __HID_LG_H 2 #define __HID_LG_H 3 4 #ifdef CONFIG_LOGITECH_FF 5 int lgff_init(struct hid_device *hdev); 6 #else
+1 -1
drivers/net/wireless/iwlwifi/iwl-core.h
··· 63 #ifndef __iwl_core_h__ 64 #define __iwl_core_h__ 65 66 - #include <linux/utsrelease.h> 67 68 /************************ 69 * forward declarations *
··· 63 #ifndef __iwl_core_h__ 64 #define __iwl_core_h__ 65 66 + #include <generated/utsrelease.h> 67 68 /************************ 69 * forward declarations *
-1
drivers/platform/x86/compal-laptop.c
··· 51 #include <linux/dmi.h> 52 #include <linux/backlight.h> 53 #include <linux/platform_device.h> 54 - #include <linux/autoconf.h> 55 56 #define COMPAL_DRIVER_VERSION "0.2.6" 57
··· 51 #include <linux/dmi.h> 52 #include <linux/backlight.h> 53 #include <linux/platform_device.h> 54 55 #define COMPAL_DRIVER_VERSION "0.2.6" 56
-1
drivers/staging/iio/ring_sw.h
··· 29 * driver requests - some may support multiple options */ 30 31 32 - #include <linux/autoconf.h> 33 #include "iio.h" 34 #include "ring_generic.h" 35
··· 29 * driver requests - some may support multiple options */ 30 31 32 #include "iio.h" 33 #include "ring_generic.h" 34
+1 -1
drivers/staging/panel/panel.c
··· 55 #include <linux/list.h> 56 #include <linux/notifier.h> 57 #include <linux/reboot.h> 58 - #include <linux/utsrelease.h> 59 60 #include <linux/io.h> 61 #include <asm/uaccess.h>
··· 55 #include <linux/list.h> 56 #include <linux/notifier.h> 57 #include <linux/reboot.h> 58 + #include <generated/utsrelease.h> 59 60 #include <linux/io.h> 61 #include <asm/uaccess.h>
+1
include/linux/Kbuild
··· 118 header-y += ncp_no.h 119 header-y += neighbour.h 120 header-y += net_dropmon.h 121 header-y += netfilter_arp.h 122 header-y += netrom.h 123 header-y += nfs2.h
··· 118 header-y += ncp_no.h 119 header-y += neighbour.h 120 header-y += net_dropmon.h 121 + header-y += net_tstamp.h 122 header-y += netfilter_arp.h 123 header-y += netrom.h 124 header-y += nfs2.h
-2
include/linux/mmdebug.h
··· 1 #ifndef LINUX_MM_DEBUG_H 2 #define LINUX_MM_DEBUG_H 1 3 4 - #include <linux/autoconf.h> 5 - 6 #ifdef CONFIG_DEBUG_VM 7 #define VM_BUG_ON(cond) BUG_ON(cond) 8 #else
··· 1 #ifndef LINUX_MM_DEBUG_H 2 #define LINUX_MM_DEBUG_H 1 3 4 #ifdef CONFIG_DEBUG_VM 5 #define VM_BUG_ON(cond) BUG_ON(cond) 6 #else
+1 -1
include/linux/mmzone.h
··· 15 #include <linux/seqlock.h> 16 #include <linux/nodemask.h> 17 #include <linux/pageblock-flags.h> 18 - #include <linux/bounds.h> 19 #include <asm/atomic.h> 20 #include <asm/page.h> 21
··· 15 #include <linux/seqlock.h> 16 #include <linux/nodemask.h> 17 #include <linux/pageblock-flags.h> 18 + #include <generated/bounds.h> 19 #include <asm/atomic.h> 20 #include <asm/page.h> 21
+1 -1
include/linux/page-flags.h
··· 8 #include <linux/types.h> 9 #ifndef __GENERATING_BOUNDS_H 10 #include <linux/mm_types.h> 11 - #include <linux/bounds.h> 12 #endif /* !__GENERATING_BOUNDS_H */ 13 14 /*
··· 8 #include <linux/types.h> 9 #ifndef __GENERATING_BOUNDS_H 10 #include <linux/mm_types.h> 11 + #include <generated/bounds.h> 12 #endif /* !__GENERATING_BOUNDS_H */ 13 14 /*
+1 -1
include/linux/vermagic.h
··· 1 - #include <linux/utsrelease.h> 2 #include <linux/module.h> 3 4 /* Simply sanity version stamp for modules. */
··· 1 + #include <generated/utsrelease.h> 2 #include <linux/module.h> 3 4 /* Simply sanity version stamp for modules. */
+2 -6
init/Makefile
··· 15 mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o 16 mounts-$(CONFIG_BLK_DEV_MD) += do_mounts_md.o 17 18 - # files to be removed upon make clean 19 - clean-files := ../include/linux/compile.h 20 - 21 # dependencies on generated files need to be listed explicitly 22 - 23 - $(obj)/version.o: include/linux/compile.h 24 25 # compile.h changes depending on hostname, generation number, etc, 26 # so we regenerate it always. ··· 26 chk_compile.h = : 27 quiet_chk_compile.h = echo ' CHK $@' 28 silent_chk_compile.h = : 29 - include/linux/compile.h: FORCE 30 @$($(quiet)chk_compile.h) 31 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ 32 "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)"
··· 15 mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o 16 mounts-$(CONFIG_BLK_DEV_MD) += do_mounts_md.o 17 18 # dependencies on generated files need to be listed explicitly 19 + $(obj)/version.o: include/generated/compile.h 20 21 # compile.h changes depending on hostname, generation number, etc, 22 # so we regenerate it always. ··· 30 chk_compile.h = : 31 quiet_chk_compile.h = echo ' CHK $@' 32 silent_chk_compile.h = : 33 + include/generated/compile.h: FORCE 34 @$($(quiet)chk_compile.h) 35 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ 36 "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)"
+2 -2
init/version.c
··· 6 * May be freely distributed as part of Linux. 7 */ 8 9 - #include <linux/compile.h> 10 #include <linux/module.h> 11 #include <linux/uts.h> 12 #include <linux/utsname.h> 13 - #include <linux/utsrelease.h> 14 #include <linux/version.h> 15 16 #ifndef CONFIG_KALLSYMS
··· 6 * May be freely distributed as part of Linux. 7 */ 8 9 + #include <generated/compile.h> 10 #include <linux/module.h> 11 #include <linux/uts.h> 12 #include <linux/utsname.h> 13 + #include <generated/utsrelease.h> 14 #include <linux/version.h> 15 16 #ifndef CONFIG_KALLSYMS
+1 -1
kernel/bounds.c
··· 12 13 void foo(void) 14 { 15 - /* The enum constants to put into include/linux/bounds.h */ 16 DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS); 17 DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES); 18 /* End of constants */
··· 12 13 void foo(void) 14 { 15 + /* The enum constants to put into include/generated/bounds.h */ 16 DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS); 17 DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES); 18 /* End of constants */
+1 -1
kernel/kexec.c
··· 21 #include <linux/hardirq.h> 22 #include <linux/elf.h> 23 #include <linux/elfcore.h> 24 - #include <linux/utsrelease.h> 25 #include <linux/utsname.h> 26 #include <linux/numa.h> 27 #include <linux/suspend.h>
··· 21 #include <linux/hardirq.h> 22 #include <linux/elf.h> 23 #include <linux/elfcore.h> 24 + #include <generated/utsrelease.h> 25 #include <linux/utsname.h> 26 #include <linux/numa.h> 27 #include <linux/suspend.h>
+1 -1
kernel/trace/trace.c
··· 12 * Copyright (C) 2004 William Lee Irwin III 13 */ 14 #include <linux/ring_buffer.h> 15 - #include <linux/utsrelease.h> 16 #include <linux/stacktrace.h> 17 #include <linux/writeback.h> 18 #include <linux/kallsyms.h>
··· 12 * Copyright (C) 2004 William Lee Irwin III 13 */ 14 #include <linux/ring_buffer.h> 15 + #include <generated/utsrelease.h> 16 #include <linux/stacktrace.h> 17 #include <linux/writeback.h> 18 #include <linux/kallsyms.h>
+6
scripts/Kbuild.include
··· 149 # $(Q)$(MAKE) $(build)=dir 150 build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj 151 152 # Prefix -I with $(srctree) if it is not an absolute path. 153 # skip if -I has no parameter 154 addtree = $(if $(patsubst -I%,%,$(1)), \
··· 149 # $(Q)$(MAKE) $(build)=dir 150 build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj 151 152 + ### 153 + # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj= 154 + # Usage: 155 + # $(Q)$(MAKE) $(modbuiltin)=dir 156 + modbuiltin := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.modbuiltin obj 157 + 158 # Prefix -I with $(srctree) if it is not an absolute path. 159 # skip if -I has no parameter 160 addtree = $(if $(patsubst -I%,%,$(1)), \
+1 -1
scripts/Makefile.lib
··· 213 214 # Bzip2 and LZMA do not include size in file... so we have to fake that; 215 # append the size as a 32-bit littleendian number as gzip does. 216 - size_append = /bin/echo -ne $(shell \ 217 dec_size=0; \ 218 for F in $1; do \ 219 fsize=$$(stat -c "%s" $$F); \
··· 213 214 # Bzip2 and LZMA do not include size in file... so we have to fake that; 215 # append the size as a 32-bit littleendian number as gzip does. 216 + size_append = printf $(shell \ 217 dec_size=0; \ 218 for F in $1; do \ 219 fsize=$$(stat -c "%s" $$F); \
+55
scripts/Makefile.modbuiltin
···
··· 1 + # ========================================================================== 2 + # Generating modules.builtin 3 + # ========================================================================== 4 + 5 + src := $(obj) 6 + 7 + PHONY := __modbuiltin 8 + __modbuiltin: 9 + 10 + -include include/config/auto.conf 11 + # tristate.conf sets tristate variables to uppercase 'Y' or 'M' 12 + # That way, we get the list of built-in modules in obj-Y 13 + -include include/config/tristate.conf 14 + 15 + include scripts/Kbuild.include 16 + 17 + # The filename Kbuild has precedence over Makefile 18 + kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 19 + kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile) 20 + include $(kbuild-file) 21 + 22 + include scripts/Makefile.lib 23 + __subdir-Y := $(patsubst %/,%,$(filter %/, $(obj-Y))) 24 + subdir-Y += $(__subdir-Y) 25 + subdir-ym := $(sort $(subdir-y) $(subdir-Y) $(subdir-m)) 26 + subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) 27 + obj-Y := $(addprefix $(obj)/,$(obj-Y)) 28 + 29 + modbuiltin-subdirs := $(patsubst %,%/modules.builtin, $(subdir-ym)) 30 + modbuiltin-mods := $(filter %.ko, $(obj-Y:.o=.ko)) 31 + modbuiltin-target := $(obj)/modules.builtin 32 + 33 + __modbuiltin: $(modbuiltin-target) $(subdir-ym) 34 + @: 35 + 36 + $(modbuiltin-target): $(subdir-ym) FORCE 37 + $(Q)(for m in $(modbuiltin-mods); do echo kernel/$$m; done; \ 38 + cat /dev/null $(modbuiltin-subdirs)) > $@ 39 + 40 + PHONY += FORCE 41 + 42 + FORCE: 43 + 44 + # Descending 45 + # --------------------------------------------------------------------------- 46 + 47 + PHONY += $(subdir-ym) 48 + $(subdir-ym): 49 + $(Q)$(MAKE) $(modbuiltin)=$@ 50 + 51 + 52 + # Declare the contents of the .PHONY variable as phony. We keep that 53 + # information in a variable se we can use it in if_changed and friends. 54 + 55 + .PHONY: $(PHONY)
+5 -5
scripts/basic/fixdep.c
··· 16 * tells make when to remake a file. 17 * 18 * To use this list as-is however has the drawback that virtually 19 - * every file in the kernel includes <linux/autoconf.h>. 20 * 21 - * If the user re-runs make *config, linux/autoconf.h will be 22 * regenerated. make notices that and will rebuild every file which 23 * includes autoconf.h, i.e. basically all files. This is extremely 24 * annoying if the user just changed CONFIG_HIS_DRIVER from n to m. 25 * 26 * So we play the same trick that "mkdep" played before. We replace 27 - * the dependency on linux/autoconf.h by a dependency on every config 28 * option which is mentioned in any of the listed prequisites. 29 * 30 * kconfig populates a tree in include/config/ with an empty file ··· 73 * cmd_<target> = <cmdline> 74 * 75 * and then basically copies the .<target>.d file to stdout, in the 76 - * process filtering out the dependency on linux/autoconf.h and adding 77 * dependencies on include/config/my/option.h for every 78 * CONFIG_MY_OPTION encountered in any of the prequisites. 79 * ··· 324 p++; 325 } 326 memcpy(s, m, p-m); s[p-m] = 0; 327 - if (strrcmp(s, "include/linux/autoconf.h") && 328 strrcmp(s, "arch/um/include/uml-config.h") && 329 strrcmp(s, ".ver")) { 330 printf(" %s \\\n", s);
··· 16 * tells make when to remake a file. 17 * 18 * To use this list as-is however has the drawback that virtually 19 + * every file in the kernel includes autoconf.h. 20 * 21 + * If the user re-runs make *config, autoconf.h will be 22 * regenerated. make notices that and will rebuild every file which 23 * includes autoconf.h, i.e. basically all files. This is extremely 24 * annoying if the user just changed CONFIG_HIS_DRIVER from n to m. 25 * 26 * So we play the same trick that "mkdep" played before. We replace 27 + * the dependency on autoconf.h by a dependency on every config 28 * option which is mentioned in any of the listed prequisites. 29 * 30 * kconfig populates a tree in include/config/ with an empty file ··· 73 * cmd_<target> = <cmdline> 74 * 75 * and then basically copies the .<target>.d file to stdout, in the 76 + * process filtering out the dependency on autoconf.h and adding 77 * dependencies on include/config/my/option.h for every 78 * CONFIG_MY_OPTION encountered in any of the prequisites. 79 * ··· 324 p++; 325 } 326 memcpy(s, m, p-m); s[p-m] = 0; 327 + if (strrcmp(s, "include/generated/autoconf.h") && 328 strrcmp(s, "arch/um/include/uml-config.h") && 329 strrcmp(s, ".ver")) { 330 printf(" %s \\\n", s);
+118 -115
scripts/genksyms/keywords.c_shipped
··· 1 - /* ANSI-C code produced by gperf version 3.0.3 */ 2 /* Command-line: gperf -L ANSI-C -a -C -E -g -H is_reserved_hash -k '1,3,$' -N is_reserved_word -p -t scripts/genksyms/keywords.gperf */ 3 4 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ ··· 34 static const struct resword *is_reserved_word(register const char *str, register unsigned int len); 35 #line 5 "scripts/genksyms/keywords.gperf" 36 struct resword { const char *name; int token; }; 37 - /* maximum key range = 62, duplicates = 0 */ 38 39 #ifdef __GNUC__ 40 __inline ··· 48 { 49 static const unsigned char asso_values[] = 50 { 51 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 52 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 53 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 54 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 55 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 56 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 57 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 5, 58 - 65, 65, 65, 65, 65, 65, 35, 65, 65, 65, 59 - 0, 65, 65, 65, 65, 65, 65, 65, 65, 65, 60 - 65, 65, 65, 65, 65, 0, 65, 0, 65, 5, 61 - 20, 15, 10, 30, 65, 15, 65, 65, 20, 0, 62 - 10, 35, 20, 65, 10, 5, 0, 10, 5, 65, 63 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 66 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 67 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 68 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 69 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 70 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 71 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 72 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 73 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 74 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 75 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 76 - 65, 65, 65, 65, 65, 65 77 }; 78 return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values[(unsigned char)str[len - 1]]; 79 } 80 81 #ifdef __GNUC__ 82 __inline 83 - #ifdef __GNUC_STDC_INLINE__ 84 __attribute__ ((__gnu_inline__)) 85 #endif 86 #endif ··· 89 { 90 enum 91 { 92 - TOTAL_KEYWORDS = 43, 93 MIN_WORD_LENGTH = 3, 94 MAX_WORD_LENGTH = 24, 95 MIN_HASH_VALUE = 3, 96 - MAX_HASH_VALUE = 64 97 }; 98 99 static const struct resword wordlist[] = 100 { 101 {""}, {""}, {""}, 102 - #line 28 "scripts/genksyms/keywords.gperf" 103 {"asm", ASM_KEYW}, 104 {""}, 105 - #line 10 "scripts/genksyms/keywords.gperf" 106 {"__asm", ASM_KEYW}, 107 {""}, 108 - #line 11 "scripts/genksyms/keywords.gperf" 109 {"__asm__", ASM_KEYW}, 110 {""}, {""}, 111 - #line 54 "scripts/genksyms/keywords.gperf" 112 {"__typeof__", TYPEOF_KEYW}, 113 {""}, 114 - #line 14 "scripts/genksyms/keywords.gperf" 115 - {"__const", CONST_KEYW}, 116 - #line 13 "scripts/genksyms/keywords.gperf" 117 - {"__attribute__", ATTRIBUTE_KEYW}, 118 - #line 15 "scripts/genksyms/keywords.gperf" 119 - {"__const__", CONST_KEYW}, 120 - #line 20 "scripts/genksyms/keywords.gperf" 121 - {"__signed__", SIGNED_KEYW}, 122 - #line 46 "scripts/genksyms/keywords.gperf" 123 - {"static", STATIC_KEYW}, 124 - #line 22 "scripts/genksyms/keywords.gperf" 125 - {"__volatile__", VOLATILE_KEYW}, 126 - #line 41 "scripts/genksyms/keywords.gperf" 127 - {"int", INT_KEYW}, 128 - #line 34 "scripts/genksyms/keywords.gperf" 129 - {"char", CHAR_KEYW}, 130 - #line 35 "scripts/genksyms/keywords.gperf" 131 - {"const", CONST_KEYW}, 132 - #line 47 "scripts/genksyms/keywords.gperf" 133 - {"struct", STRUCT_KEYW}, 134 - #line 26 "scripts/genksyms/keywords.gperf" 135 - {"__restrict__", RESTRICT_KEYW}, 136 - #line 27 "scripts/genksyms/keywords.gperf" 137 - {"restrict", RESTRICT_KEYW}, 138 - #line 25 "scripts/genksyms/keywords.gperf" 139 - {"_restrict", RESTRICT_KEYW}, 140 - #line 18 "scripts/genksyms/keywords.gperf" 141 - {"__inline__", INLINE_KEYW}, 142 - #line 12 "scripts/genksyms/keywords.gperf" 143 - {"__attribute", ATTRIBUTE_KEYW}, 144 - {""}, 145 #line 16 "scripts/genksyms/keywords.gperf" 146 - {"__extension__", EXTENSION_KEYW}, 147 - #line 37 "scripts/genksyms/keywords.gperf" 148 - {"enum", ENUM_KEYW}, 149 - #line 21 "scripts/genksyms/keywords.gperf" 150 - {"__volatile", VOLATILE_KEYW}, 151 - #line 38 "scripts/genksyms/keywords.gperf" 152 - {"extern", EXTERN_KEYW}, 153 {""}, 154 - #line 19 "scripts/genksyms/keywords.gperf" 155 - {"__signed", SIGNED_KEYW}, 156 #line 9 "scripts/genksyms/keywords.gperf" 157 {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW}, 158 - {""}, 159 - #line 53 "scripts/genksyms/keywords.gperf" 160 - {"typeof", TYPEOF_KEYW}, 161 - #line 48 "scripts/genksyms/keywords.gperf" 162 - {"typedef", TYPEDEF_KEYW}, 163 - #line 17 "scripts/genksyms/keywords.gperf" 164 - {"__inline", INLINE_KEYW}, 165 - #line 33 "scripts/genksyms/keywords.gperf" 166 - {"auto", AUTO_KEYW}, 167 - #line 49 "scripts/genksyms/keywords.gperf" 168 - {"union", UNION_KEYW}, 169 - {""}, {""}, 170 - #line 50 "scripts/genksyms/keywords.gperf" 171 - {"unsigned", UNSIGNED_KEYW}, 172 - #line 51 "scripts/genksyms/keywords.gperf" 173 - {"void", VOID_KEYW}, 174 - #line 44 "scripts/genksyms/keywords.gperf" 175 - {"short", SHORT_KEYW}, 176 - {""}, {""}, 177 - #line 52 "scripts/genksyms/keywords.gperf" 178 - {"volatile", VOLATILE_KEYW}, 179 - {""}, 180 - #line 39 "scripts/genksyms/keywords.gperf" 181 - {"float", FLOAT_KEYW}, 182 - #line 36 "scripts/genksyms/keywords.gperf" 183 - {"double", DOUBLE_KEYW}, 184 - {""}, 185 - #line 7 "scripts/genksyms/keywords.gperf" 186 - {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW}, 187 - {""}, {""}, 188 - #line 40 "scripts/genksyms/keywords.gperf" 189 - {"inline", INLINE_KEYW}, 190 - #line 8 "scripts/genksyms/keywords.gperf" 191 - {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, 192 - #line 43 "scripts/genksyms/keywords.gperf" 193 - {"register", REGISTER_KEYW}, 194 {""}, 195 #line 24 "scripts/genksyms/keywords.gperf" 196 - {"_Bool", BOOL_KEYW}, 197 - #line 45 "scripts/genksyms/keywords.gperf" 198 - {"signed", SIGNED_KEYW}, 199 {""}, {""}, 200 #line 42 "scripts/genksyms/keywords.gperf" 201 - {"long", LONG_KEYW} 202 }; 203 204 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
··· 1 + /* ANSI-C code produced by gperf version 3.0.4 */ 2 /* Command-line: gperf -L ANSI-C -a -C -E -g -H is_reserved_hash -k '1,3,$' -N is_reserved_word -p -t scripts/genksyms/keywords.gperf */ 3 4 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ ··· 34 static const struct resword *is_reserved_word(register const char *str, register unsigned int len); 35 #line 5 "scripts/genksyms/keywords.gperf" 36 struct resword { const char *name; int token; }; 37 + /* maximum key range = 64, duplicates = 0 */ 38 39 #ifdef __GNUC__ 40 __inline ··· 48 { 49 static const unsigned char asso_values[] = 50 { 51 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 52 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 53 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 54 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 55 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 56 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 57 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 58 + 67, 67, 67, 67, 67, 67, 15, 67, 67, 67, 59 + 0, 67, 67, 67, 67, 67, 67, 67, 67, 67, 60 + 67, 67, 67, 67, 67, 0, 67, 0, 67, 5, 61 + 25, 20, 15, 30, 67, 15, 67, 67, 10, 0, 62 + 10, 40, 20, 67, 10, 5, 0, 10, 15, 67, 63 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 64 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 65 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 66 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 68 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 69 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 70 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 71 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 72 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 73 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 74 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 75 + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 76 + 67, 67, 67, 67, 67, 67 77 }; 78 return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values[(unsigned char)str[len - 1]]; 79 } 80 81 #ifdef __GNUC__ 82 __inline 83 + #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ 84 __attribute__ ((__gnu_inline__)) 85 #endif 86 #endif ··· 89 { 90 enum 91 { 92 + TOTAL_KEYWORDS = 45, 93 MIN_WORD_LENGTH = 3, 94 MAX_WORD_LENGTH = 24, 95 MIN_HASH_VALUE = 3, 96 + MAX_HASH_VALUE = 66 97 }; 98 99 static const struct resword wordlist[] = 100 { 101 {""}, {""}, {""}, 102 + #line 30 "scripts/genksyms/keywords.gperf" 103 {"asm", ASM_KEYW}, 104 {""}, 105 + #line 12 "scripts/genksyms/keywords.gperf" 106 {"__asm", ASM_KEYW}, 107 {""}, 108 + #line 13 "scripts/genksyms/keywords.gperf" 109 {"__asm__", ASM_KEYW}, 110 {""}, {""}, 111 + #line 56 "scripts/genksyms/keywords.gperf" 112 {"__typeof__", TYPEOF_KEYW}, 113 {""}, 114 #line 16 "scripts/genksyms/keywords.gperf" 115 + {"__const", CONST_KEYW}, 116 + #line 15 "scripts/genksyms/keywords.gperf" 117 + {"__attribute__", ATTRIBUTE_KEYW}, 118 + #line 17 "scripts/genksyms/keywords.gperf" 119 + {"__const__", CONST_KEYW}, 120 + #line 22 "scripts/genksyms/keywords.gperf" 121 + {"__signed__", SIGNED_KEYW}, 122 + #line 48 "scripts/genksyms/keywords.gperf" 123 + {"static", STATIC_KEYW}, 124 {""}, 125 + #line 43 "scripts/genksyms/keywords.gperf" 126 + {"int", INT_KEYW}, 127 + #line 36 "scripts/genksyms/keywords.gperf" 128 + {"char", CHAR_KEYW}, 129 + #line 37 "scripts/genksyms/keywords.gperf" 130 + {"const", CONST_KEYW}, 131 + #line 49 "scripts/genksyms/keywords.gperf" 132 + {"struct", STRUCT_KEYW}, 133 + #line 28 "scripts/genksyms/keywords.gperf" 134 + {"__restrict__", RESTRICT_KEYW}, 135 + #line 29 "scripts/genksyms/keywords.gperf" 136 + {"restrict", RESTRICT_KEYW}, 137 #line 9 "scripts/genksyms/keywords.gperf" 138 {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW}, 139 + #line 20 "scripts/genksyms/keywords.gperf" 140 + {"__inline__", INLINE_KEYW}, 141 {""}, 142 #line 24 "scripts/genksyms/keywords.gperf" 143 + {"__volatile__", VOLATILE_KEYW}, 144 + #line 7 "scripts/genksyms/keywords.gperf" 145 + {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW}, 146 + #line 27 "scripts/genksyms/keywords.gperf" 147 + {"_restrict", RESTRICT_KEYW}, 148 + {""}, 149 + #line 14 "scripts/genksyms/keywords.gperf" 150 + {"__attribute", ATTRIBUTE_KEYW}, 151 + #line 8 "scripts/genksyms/keywords.gperf" 152 + {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, 153 + #line 18 "scripts/genksyms/keywords.gperf" 154 + {"__extension__", EXTENSION_KEYW}, 155 + #line 39 "scripts/genksyms/keywords.gperf" 156 + {"enum", ENUM_KEYW}, 157 + #line 10 "scripts/genksyms/keywords.gperf" 158 + {"EXPORT_UNUSED_SYMBOL", EXPORT_SYMBOL_KEYW}, 159 + #line 40 "scripts/genksyms/keywords.gperf" 160 + {"extern", EXTERN_KEYW}, 161 + {""}, 162 + #line 21 "scripts/genksyms/keywords.gperf" 163 + {"__signed", SIGNED_KEYW}, 164 + #line 11 "scripts/genksyms/keywords.gperf" 165 + {"EXPORT_UNUSED_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, 166 + #line 51 "scripts/genksyms/keywords.gperf" 167 + {"union", UNION_KEYW}, 168 + #line 55 "scripts/genksyms/keywords.gperf" 169 + {"typeof", TYPEOF_KEYW}, 170 + #line 50 "scripts/genksyms/keywords.gperf" 171 + {"typedef", TYPEDEF_KEYW}, 172 + #line 19 "scripts/genksyms/keywords.gperf" 173 + {"__inline", INLINE_KEYW}, 174 + #line 35 "scripts/genksyms/keywords.gperf" 175 + {"auto", AUTO_KEYW}, 176 + #line 23 "scripts/genksyms/keywords.gperf" 177 + {"__volatile", VOLATILE_KEYW}, 178 {""}, {""}, 179 + #line 52 "scripts/genksyms/keywords.gperf" 180 + {"unsigned", UNSIGNED_KEYW}, 181 + {""}, 182 + #line 46 "scripts/genksyms/keywords.gperf" 183 + {"short", SHORT_KEYW}, 184 #line 42 "scripts/genksyms/keywords.gperf" 185 + {"inline", INLINE_KEYW}, 186 + {""}, 187 + #line 54 "scripts/genksyms/keywords.gperf" 188 + {"volatile", VOLATILE_KEYW}, 189 + #line 44 "scripts/genksyms/keywords.gperf" 190 + {"long", LONG_KEYW}, 191 + #line 26 "scripts/genksyms/keywords.gperf" 192 + {"_Bool", BOOL_KEYW}, 193 + {""}, {""}, 194 + #line 45 "scripts/genksyms/keywords.gperf" 195 + {"register", REGISTER_KEYW}, 196 + #line 53 "scripts/genksyms/keywords.gperf" 197 + {"void", VOID_KEYW}, 198 + #line 41 "scripts/genksyms/keywords.gperf" 199 + {"float", FLOAT_KEYW}, 200 + #line 38 "scripts/genksyms/keywords.gperf" 201 + {"double", DOUBLE_KEYW}, 202 + {""}, {""}, {""}, {""}, 203 + #line 47 "scripts/genksyms/keywords.gperf" 204 + {"signed", SIGNED_KEYW} 205 }; 206 207 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+2
scripts/genksyms/keywords.gperf
··· 7 EXPORT_SYMBOL, EXPORT_SYMBOL_KEYW 8 EXPORT_SYMBOL_GPL, EXPORT_SYMBOL_KEYW 9 EXPORT_SYMBOL_GPL_FUTURE, EXPORT_SYMBOL_KEYW 10 __asm, ASM_KEYW 11 __asm__, ASM_KEYW 12 __attribute, ATTRIBUTE_KEYW
··· 7 EXPORT_SYMBOL, EXPORT_SYMBOL_KEYW 8 EXPORT_SYMBOL_GPL, EXPORT_SYMBOL_KEYW 9 EXPORT_SYMBOL_GPL_FUTURE, EXPORT_SYMBOL_KEYW 10 + EXPORT_UNUSED_SYMBOL, EXPORT_SYMBOL_KEYW 11 + EXPORT_UNUSED_SYMBOL_GPL, EXPORT_SYMBOL_KEYW 12 __asm, ASM_KEYW 13 __asm__, ASM_KEYW 14 __attribute, ATTRIBUTE_KEYW
-2
scripts/headers.sh
··· 8 { 9 if [ -f ${srctree}/arch/$2/include/asm/Kbuild ]; then 10 make ARCH=$2 KBUILD_HEADERS=$1 headers_$1 11 - elif [ -f ${srctree}/include/asm-$2/Kbuild ]; then 12 - make ARCH=$2 KBUILD_HEADERS=$1 headers_$1 13 else 14 printf "Ignoring arch: %s\n" ${arch} 15 fi
··· 8 { 9 if [ -f ${srctree}/arch/$2/include/asm/Kbuild ]; then 10 make ARCH=$2 KBUILD_HEADERS=$1 headers_$1 11 else 12 printf "Ignoring arch: %s\n" ${arch} 13 fi
+1
scripts/kconfig/Makefile
··· 27 $< -o $(Kconfig) 28 29 silentoldconfig: $(obj)/conf 30 $< -s $(Kconfig) 31 32 localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
··· 27 $< -o $(Kconfig) 28 29 silentoldconfig: $(obj)/conf 30 + $(Q)mkdir -p include/generated 31 $< -s $(Kconfig) 32 33 localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
+22 -2
scripts/kconfig/confdata.c
··· 677 struct symbol *sym; 678 const char *str; 679 const char *name; 680 - FILE *out, *out_h; 681 time_t now; 682 int i, l; 683 ··· 692 if (!out) 693 return 1; 694 695 out_h = fopen(".tmpconfig.h", "w"); 696 if (!out_h) { 697 fclose(out); 698 return 1; 699 } 700 ··· 714 "# %s" 715 "#\n", 716 sym_get_string_value(sym), ctime(&now)); 717 fprintf(out_h, "/*\n" 718 " * Automatically generated C config: don't edit\n" 719 " * Linux kernel version: %s\n" ··· 737 break; 738 case mod: 739 fprintf(out, "CONFIG_%s=m\n", sym->name); 740 fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name); 741 break; 742 case yes: 743 fprintf(out, "CONFIG_%s=y\n", sym->name); 744 fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); 745 break; 746 } ··· 786 } 787 } 788 fclose(out); 789 fclose(out_h); 790 791 name = getenv("KCONFIG_AUTOHEADER"); 792 if (!name) 793 - name = "include/linux/autoconf.h"; 794 if (rename(".tmpconfig.h", name)) 795 return 1; 796 name = conf_get_autoconfig_name(); 797 /*
··· 677 struct symbol *sym; 678 const char *str; 679 const char *name; 680 + FILE *out, *tristate, *out_h; 681 time_t now; 682 int i, l; 683 ··· 692 if (!out) 693 return 1; 694 695 + tristate = fopen(".tmpconfig_tristate", "w"); 696 + if (!tristate) { 697 + fclose(out); 698 + return 1; 699 + } 700 + 701 out_h = fopen(".tmpconfig.h", "w"); 702 if (!out_h) { 703 fclose(out); 704 + fclose(tristate); 705 return 1; 706 } 707 ··· 707 "# %s" 708 "#\n", 709 sym_get_string_value(sym), ctime(&now)); 710 + fprintf(tristate, "#\n" 711 + "# Automatically generated - do not edit\n" 712 + "\n"); 713 fprintf(out_h, "/*\n" 714 " * Automatically generated C config: don't edit\n" 715 " * Linux kernel version: %s\n" ··· 727 break; 728 case mod: 729 fprintf(out, "CONFIG_%s=m\n", sym->name); 730 + fprintf(tristate, "CONFIG_%s=M\n", sym->name); 731 fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name); 732 break; 733 case yes: 734 fprintf(out, "CONFIG_%s=y\n", sym->name); 735 + if (sym->type == S_TRISTATE) 736 + fprintf(tristate, "CONFIG_%s=Y\n", 737 + sym->name); 738 fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); 739 break; 740 } ··· 772 } 773 } 774 fclose(out); 775 + fclose(tristate); 776 fclose(out_h); 777 778 name = getenv("KCONFIG_AUTOHEADER"); 779 if (!name) 780 + name = "include/generated/autoconf.h"; 781 if (rename(".tmpconfig.h", name)) 782 + return 1; 783 + name = getenv("KCONFIG_TRISTATE"); 784 + if (!name) 785 + name = "include/config/tristate.conf"; 786 + if (rename(".tmpconfig_tristate", name)) 787 return 1; 788 name = conf_get_autoconfig_name(); 789 /*
+1 -1
scripts/mkcompile_h
··· 14 # So "sudo make install" won't change the "compiled by <user>" 15 # do "compiled by root" 16 17 - if [ -r $TARGET -a ! -O include/linux/autoconf.h ]; then 18 vecho " SKIPPED $TARGET" 19 exit 0 20 fi
··· 14 # So "sudo make install" won't change the "compiled by <user>" 15 # do "compiled by root" 16 17 + if [ -r $TARGET -a ! -O include/generated/autoconf.h ]; then 18 vecho " SKIPPED $TARGET" 19 exit 0 20 fi
+1 -1
scripts/mod/modpost.c
··· 15 #include <stdio.h> 16 #include <ctype.h> 17 #include "modpost.h" 18 - #include "../../include/linux/autoconf.h" 19 #include "../../include/linux/license.h" 20 21 /* Some toolchains use a `_' prefix for all user symbols. */
··· 15 #include <stdio.h> 16 #include <ctype.h> 17 #include "modpost.h" 18 + #include "../../include/generated/autoconf.h" 19 #include "../../include/linux/license.h" 20 21 /* Some toolchains use a `_' prefix for all user symbols. */
+19 -1
scripts/package/Makefile
··· 77 78 # Deb target 79 # --------------------------------------------------------------------------- 80 deb-pkg: FORCE 81 $(MAKE) KBUILD_SRC= 82 - $(CONFIG_SHELL) $(srctree)/scripts/package/builddeb 83 84 clean-dirs += $(objtree)/debian/ 85
··· 77 78 # Deb target 79 # --------------------------------------------------------------------------- 80 + quiet_cmd_builddeb = BUILDDEB 81 + cmd_builddeb = set -e; \ 82 + test `id -u` = 0 || \ 83 + test -n "$(KBUILD_PKG_ROOTCMD)" || { \ 84 + which fakeroot >/dev/null 2>&1 && \ 85 + KBUILD_PKG_ROOTCMD="fakeroot -u"; \ 86 + } || { \ 87 + echo; \ 88 + echo "builddeb must be run as root (or using fakeroot)."; \ 89 + echo "KBUILD_PKG_ROOTCMD is unset and fakeroot not found."; \ 90 + echo "Try setting KBUILD_PKG_ROOTCMD to a command to acquire"; \ 91 + echo "root privileges (e.g., 'fakeroot -u' or 'sudo')."; \ 92 + false; \ 93 + } && \ 94 + \ 95 + $$KBUILD_PKG_ROOTCMD $(CONFIG_SHELL) \ 96 + $(srctree)/scripts/package/builddeb 97 + 98 deb-pkg: FORCE 99 $(MAKE) KBUILD_SRC= 100 + $(call cmd,builddeb) 101 102 clean-dirs += $(objtree)/debian/ 103
+5 -1
scripts/package/buildtar
··· 101 # 102 ( 103 cd "${tmpdir}" 104 - tar cf - . | ${compress} > "${tarball}${file_ext}" 105 ) 106 107 echo "Tarball successfully created in ${tarball}${file_ext}"
··· 101 # 102 ( 103 cd "${tmpdir}" 104 + opts= 105 + if tar --owner=root --group=root --help >/dev/null 2>&1; then 106 + opts="--owner=root --group=root" 107 + fi 108 + tar cf - . $opts | ${compress} > "${tarball}${file_ext}" 109 ) 110 111 echo "Tarball successfully created in ${tarball}${file_ext}"
+7 -1
scripts/tags.sh
··· 89 90 docscope() 91 { 92 - (echo \-k; echo \-q; all_sources) > cscope.files 93 cscope -b -f cscope.out 94 } 95
··· 89 90 docscope() 91 { 92 + # always use absolute paths for cscope, as recommended by cscope 93 + # upstream 94 + case "$tree" in 95 + /*) ;; 96 + *) tree=$PWD/$tree ;; 97 + esac 98 + (cd /; echo \-k; echo \-q; all_sources) > cscope.files 99 cscope -b -f cscope.out 100 } 101
+207 -134
scripts/unifdef.c
··· 1 /* 2 - * Copyright (c) 2002 - 2005 Tony Finch <dot@dotat.at>. All rights reserved. 3 - * 4 - * This code is derived from software contributed to Berkeley by Dave Yost. 5 - * It was rewritten to support ANSI C by Tony Finch. The original version of 6 - * unifdef carried the following copyright notice. None of its code remains 7 - * in this version (though some of the names remain). 8 - * 9 - * Copyright (c) 1985, 1993 10 - * The Regents of the University of California. All rights reserved. 11 * 12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions ··· 23 * SUCH DAMAGE. 24 */ 25 26 - #include <sys/cdefs.h> 27 28 - #ifndef lint 29 - #if 0 30 - static const char copyright[] = 31 - "@(#) Copyright (c) 1985, 1993\n\ 32 - The Regents of the University of California. All rights reserved.\n"; 33 - #endif 34 - #ifdef __IDSTRING 35 - __IDSTRING(Berkeley, "@(#)unifdef.c 8.1 (Berkeley) 6/6/93"); 36 - __IDSTRING(NetBSD, "$NetBSD: unifdef.c,v 1.8 2000/07/03 02:51:36 matt Exp $"); 37 - __IDSTRING(dotat, "$dotat: things/unifdef.c,v 1.171 2005/03/08 12:38:48 fanf2 Exp $"); 38 - #endif 39 - #endif /* not lint */ 40 - #ifdef __FBSDID 41 - __FBSDID("$FreeBSD: /repoman/r/ncvs/src/usr.bin/unifdef/unifdef.c,v 1.20 2005/05/21 09:55:09 ru Exp $"); 42 - #endif 43 44 /* 45 * unifdef - remove ifdef'ed lines ··· 61 #include <string.h> 62 #include <unistd.h> 63 64 - size_t strlcpy(char *dst, const char *src, size_t siz); 65 - 66 /* types of input lines: */ 67 typedef enum { 68 LT_TRUEI, /* a true #if with ignore flag */ ··· 77 LT_DODGY_LAST = LT_DODGY + LT_ENDIF, 78 LT_PLAIN, /* ordinary line */ 79 LT_EOF, /* end of file */ 80 LT_COUNT 81 } Linetype; 82 ··· 88 "DODGY IF", "DODGY TRUE", "DODGY FALSE", 89 "DODGY ELIF", "DODGY ELTRUE", "DODGY ELFALSE", 90 "DODGY ELSE", "DODGY ENDIF", 91 - "PLAIN", "EOF" 92 }; 93 94 /* state of #if processing */ ··· 156 * Globals. 157 */ 158 159 static bool complement; /* -c: do the complement */ 160 static bool debugging; /* -d: debugging reports */ 161 static bool iocccok; /* -e: fewer IOCCC errors */ 162 static bool killconsts; /* -k: eval constant #ifs */ 163 - static bool lnblank; /* -l: blank deleted lines */ 164 static bool lnnum; /* -n: add #line directives */ 165 static bool symlist; /* -s: output symbol list */ 166 static bool text; /* -t: this is a text file */ ··· 186 static int stifline[MAXDEPTH]; /* start of current #if */ 187 static int depth; /* current #if nesting */ 188 static int delcount; /* count of deleted lines */ 189 - static bool keepthis; /* don't delete constant #if */ 190 191 static int exitstat; /* program exit status */ 192 ··· 198 static void error(const char *); 199 static int findsym(const char *); 200 static void flushline(bool); 201 - static Linetype get_line(void); 202 static Linetype ifeval(const char **); 203 static void ignoreoff(void); 204 static void ignoreon(void); 205 static void keywordedit(const char *); 206 static void nest(void); 207 static void process(void); 208 static const char *skipcomment(const char *); 209 static const char *skipsym(const char *); 210 static void state(Ifstate); ··· 213 static void unnest(void); 214 static void usage(void); 215 216 - #define endsym(c) (!isalpha((unsigned char)c) && !isdigit((unsigned char)c) && c != '_') 217 218 /* 219 * The main program. ··· 223 { 224 int opt; 225 226 - while ((opt = getopt(argc, argv, "i:D:U:I:cdeklnst")) != -1) 227 switch (opt) { 228 case 'i': /* treat stuff controlled by these symbols as text */ 229 /* ··· 248 case 'I': 249 /* no-op for compatibility with cpp */ 250 break; 251 case 'c': /* treat -D as -U and vice versa */ 252 complement = true; 253 break; ··· 264 case 'e': /* fewer errors from dodgy lines */ 265 iocccok = true; 266 break; 267 case 'k': /* process constant #ifs */ 268 killconsts = true; 269 - break; 270 - case 'l': /* blank deleted lines instead of omitting them */ 271 - lnblank = true; 272 break; 273 case 'n': /* add #line directive after deleted lines */ 274 lnnum = true; ··· 284 } 285 argc -= optind; 286 argv += optind; 287 if (argc > 1) { 288 errx(2, "can only do one file"); 289 } else if (argc == 1 && strcmp(*argv, "-") != 0) { ··· 304 static void 305 usage(void) 306 { 307 - fprintf(stderr, "usage: unifdef [-cdeklnst] [-Ipath]" 308 " [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\n"); 309 exit(2); 310 } ··· 385 /* IS_OUTSIDE */ 386 { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Eendif, 387 Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Eendif, 388 - print, done }, 389 /* IS_FALSE_PREFIX */ 390 { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Mpass, Strue, Sfalse,Selse, Dendif, 391 Idrop, Idrop, Fdrop, Fdrop, Fdrop, Mpass, Eioccc,Eioccc,Eioccc,Eioccc, 392 - drop, Eeof }, 393 /* IS_TRUE_PREFIX */ 394 { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Dfalse,Dfalse,Dfalse,Delse, Dendif, 395 Oiffy, Oiffy, Fpass, Oif, Oif, Eioccc,Eioccc,Eioccc,Eioccc,Eioccc, 396 - print, Eeof }, 397 /* IS_PASS_MIDDLE */ 398 { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Pelif, Mtrue, Delif, Pelse, Pendif, 399 Oiffy, Oiffy, Fpass, Oif, Oif, Pelif, Oelif, Oelif, Pelse, Pendif, 400 - print, Eeof }, 401 /* IS_FALSE_MIDDLE */ 402 { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Pelif, Mtrue, Delif, Pelse, Pendif, 403 Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eioccc,Eioccc,Eioccc,Eioccc,Eioccc, 404 - drop, Eeof }, 405 /* IS_TRUE_MIDDLE */ 406 { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Melif, Melif, Melif, Melse, Pendif, 407 Oiffy, Oiffy, Fpass, Oif, Oif, Eioccc,Eioccc,Eioccc,Eioccc,Pendif, 408 - print, Eeof }, 409 /* IS_PASS_ELSE */ 410 { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Pendif, 411 Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Pendif, 412 - print, Eeof }, 413 /* IS_FALSE_ELSE */ 414 { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eelif, Eelif, Eelif, Eelse, Dendif, 415 Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eelif, Eelif, Eelif, Eelse, Eioccc, 416 - drop, Eeof }, 417 /* IS_TRUE_ELSE */ 418 { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Dendif, 419 Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Eioccc, 420 - print, Eeof }, 421 /* IS_FALSE_TRAILER */ 422 { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Dfalse,Dfalse,Dfalse,Delse, Dendif, 423 Idrop, Idrop, Fdrop, Fdrop, Fdrop, Dfalse,Dfalse,Dfalse,Delse, Eioccc, 424 - drop, Eeof } 425 /*TRUEI FALSEI IF TRUE FALSE ELIF ELTRUE ELFALSE ELSE ENDIF 426 TRUEI FALSEI IF TRUE FALSE ELIF ELTRUE ELFALSE ELSE ENDIF (DODGY) 427 - PLAIN EOF */ 428 }; 429 430 /* ··· 465 static void 466 nest(void) 467 { 468 - depth += 1; 469 - if (depth >= MAXDEPTH) 470 error("Too many levels of nesting"); 471 stifline[depth] = linenum; 472 } 473 static void ··· 494 if (symlist) 495 return; 496 if (keep ^ complement) { 497 - if (lnnum && delcount > 0) 498 - printf("#line %d\n", linenum); 499 - fputs(tline, stdout); 500 - delcount = 0; 501 } else { 502 if (lnblank) 503 putc('\n', stdout); 504 exitstat = 1; 505 delcount += 1; 506 } 507 } 508 ··· 522 { 523 Linetype lineval; 524 525 for (;;) { 526 linenum++; 527 - lineval = get_line(); 528 trans_table[ifstate[depth]][lineval](); 529 debug("process %s -> %s depth %d", 530 linetype_name[lineval], ··· 541 * help from skipcomment(). 542 */ 543 static Linetype 544 - get_line(void) 545 { 546 const char *cp; 547 int cursym; ··· 610 if (incomment) 611 linestate = LS_DIRTY; 612 } 613 - /* skipcomment should have changed the state */ 614 - if (linestate == LS_HASH) 615 - abort(); /* bug */ 616 } 617 if (linestate == LS_DIRTY) { 618 while (*cp != '\0') ··· 637 638 /* 639 * These are the binary operators that are supported by the expression 640 - * evaluator. Note that if support for division is added then we also 641 - * need short-circuiting booleans because of divide-by-zero. 642 */ 643 - static int op_lt(int a, int b) { return (a < b); } 644 - static int op_gt(int a, int b) { return (a > b); } 645 - static int op_le(int a, int b) { return (a <= b); } 646 - static int op_ge(int a, int b) { return (a >= b); } 647 - static int op_eq(int a, int b) { return (a == b); } 648 - static int op_ne(int a, int b) { return (a != b); } 649 - static int op_or(int a, int b) { return (a || b); } 650 - static int op_and(int a, int b) { return (a && b); } 651 652 /* 653 * An evaluation function takes three arguments, as follows: (1) a pointer to ··· 679 * value of the expression; and (3) a pointer to a char* that points to the 680 * expression to be evaluated and that is updated to the end of the expression 681 * when evaluation is complete. The function returns LT_FALSE if the value of 682 - * the expression is zero, LT_TRUE if it is non-zero, or LT_IF if the 683 - * expression could not be evaluated. 684 */ 685 struct ops; 686 ··· 699 eval_fn *inner; 700 struct op { 701 const char *str; 702 - int (*fn)(int, int); 703 } op[5]; 704 } eval_ops[] = { 705 { eval_table, { { "||", op_or } } }, ··· 714 715 /* 716 * Function for evaluating the innermost parts of expressions, 717 - * viz. !expr (expr) defined(symbol) symbol number 718 - * We reset the keepthis flag when we find a non-constant subexpression. 719 */ 720 static Linetype 721 eval_unary(const struct ops *ops, int *valp, const char **cpp) ··· 723 const char *cp; 724 char *ep; 725 int sym; 726 727 cp = skipcomment(*cpp); 728 if (*cp == '!') { 729 debug("eval%d !", ops - eval_ops); 730 cp++; 731 - if (eval_unary(ops, valp, &cp) == LT_IF) { 732 - *cpp = cp; 733 - return (LT_IF); 734 } 735 - *valp = !*valp; 736 } else if (*cp == '(') { 737 cp++; 738 debug("eval%d (", ops - eval_ops); 739 - if (eval_table(eval_ops, valp, &cp) == LT_IF) 740 - return (LT_IF); 741 cp = skipcomment(cp); 742 if (*cp++ != ')') 743 - return (LT_IF); 744 } else if (isdigit((unsigned char)*cp)) { 745 debug("eval%d number", ops - eval_ops); 746 *valp = strtol(cp, &ep, 0); 747 cp = skipsym(cp); 748 } else if (strncmp(cp, "defined", 7) == 0 && endsym(cp[7])) { 749 cp = skipcomment(cp+7); 750 debug("eval%d defined", ops - eval_ops); 751 - if (*cp++ != '(') 752 - return (LT_IF); 753 - cp = skipcomment(cp); 754 sym = findsym(cp); 755 cp = skipsym(cp); 756 cp = skipcomment(cp); 757 - if (*cp++ != ')') 758 - return (LT_IF); 759 - if (sym >= 0) 760 - *valp = (value[sym] != NULL); 761 - else { 762 - *cpp = cp; 763 - return (LT_IF); 764 - } 765 - keepthis = false; 766 } else if (!endsym(*cp)) { 767 debug("eval%d symbol", ops - eval_ops); 768 sym = findsym(cp); 769 - if (sym < 0) 770 - return (LT_IF); 771 - if (value[sym] == NULL) 772 *valp = 0; 773 - else { 774 *valp = strtol(value[sym], &ep, 0); 775 if (*ep != '\0' || ep == value[sym]) 776 - return (LT_IF); 777 } 778 - cp = skipsym(cp); 779 - keepthis = false; 780 } else { 781 debug("eval%d bad expr", ops - eval_ops); 782 - return (LT_IF); 783 } 784 785 *cpp = cp; 786 debug("eval%d = %d", ops - eval_ops, *valp); 787 - return (*valp ? LT_TRUE : LT_FALSE); 788 } 789 790 /* ··· 811 const struct op *op; 812 const char *cp; 813 int val; 814 - Linetype lhs, rhs; 815 816 debug("eval%d", ops - eval_ops); 817 cp = *cpp; 818 - lhs = ops->inner(ops+1, valp, &cp); 819 for (;;) { 820 cp = skipcomment(cp); 821 for (op = ops->op; op->str != NULL; op++) ··· 827 break; 828 cp += strlen(op->str); 829 debug("eval%d %s", ops - eval_ops, op->str); 830 - rhs = ops->inner(ops+1, &val, &cp); 831 - if (op->fn == op_and && (lhs == LT_FALSE || rhs == LT_FALSE)) { 832 - debug("eval%d: and always false", ops - eval_ops); 833 - if (lhs == LT_IF) 834 - *valp = val; 835 - lhs = LT_FALSE; 836 - continue; 837 - } 838 - if (op->fn == op_or && (lhs == LT_TRUE || rhs == LT_TRUE)) { 839 - debug("eval%d: or always true", ops - eval_ops); 840 - if (lhs == LT_IF) 841 - *valp = val; 842 - lhs = LT_TRUE; 843 - continue; 844 - } 845 - if (rhs == LT_IF) 846 - lhs = LT_IF; 847 - if (lhs != LT_IF) 848 - *valp = op->fn(*valp, val); 849 } 850 851 *cpp = cp; 852 debug("eval%d = %d", ops - eval_ops, *valp); 853 - if (lhs != LT_IF) 854 - lhs = (*valp ? LT_TRUE : LT_FALSE); 855 - return lhs; 856 } 857 858 /* ··· 847 static Linetype 848 ifeval(const char **cpp) 849 { 850 - const char *cp = *cpp; 851 int ret; 852 - int val; 853 854 debug("eval %s", *cpp); 855 - keepthis = killconsts ? false : true; 856 - ret = eval_table(eval_ops, &val, &cp); 857 - if (ret != LT_IF) 858 - *cpp = cp; 859 debug("eval = %d", val); 860 - return (keepthis ? LT_IF : ret); 861 } 862 863 /* ··· 966 } 967 968 /* 969 * Skip over an identifier. 970 */ 971 static const char * ··· 1002 } 1003 1004 /* 1005 - * Look for the symbol in the symbol table. If is is found, we return 1006 * the symbol table index, else we return -1. 1007 */ 1008 static int
··· 1 /* 2 + * Copyright (c) 2002 - 2009 Tony Finch <dot@dotat.at> 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions ··· 31 * SUCH DAMAGE. 32 */ 33 34 + /* 35 + * This code was derived from software contributed to Berkeley by Dave Yost. 36 + * It was rewritten to support ANSI C by Tony Finch. The original version 37 + * of unifdef carried the 4-clause BSD copyright licence. None of its code 38 + * remains in this version (though some of the names remain) so it now 39 + * carries a more liberal licence. 40 + * 41 + * The latest version is available from http://dotat.at/prog/unifdef 42 + */ 43 44 + static const char * const copyright[] = { 45 + "@(#) Copyright (c) 2002 - 2009 Tony Finch <dot@dotat.at>\n", 46 + "$dotat: unifdef/unifdef.c,v 1.190 2009/11/27 17:21:26 fanf2 Exp $", 47 + }; 48 49 /* 50 * unifdef - remove ifdef'ed lines ··· 72 #include <string.h> 73 #include <unistd.h> 74 75 /* types of input lines: */ 76 typedef enum { 77 LT_TRUEI, /* a true #if with ignore flag */ ··· 90 LT_DODGY_LAST = LT_DODGY + LT_ENDIF, 91 LT_PLAIN, /* ordinary line */ 92 LT_EOF, /* end of file */ 93 + LT_ERROR, /* unevaluable #if */ 94 LT_COUNT 95 } Linetype; 96 ··· 100 "DODGY IF", "DODGY TRUE", "DODGY FALSE", 101 "DODGY ELIF", "DODGY ELTRUE", "DODGY ELFALSE", 102 "DODGY ELSE", "DODGY ENDIF", 103 + "PLAIN", "EOF", "ERROR" 104 }; 105 106 /* state of #if processing */ ··· 168 * Globals. 169 */ 170 171 + static bool compblank; /* -B: compress blank lines */ 172 + static bool lnblank; /* -b: blank deleted lines */ 173 static bool complement; /* -c: do the complement */ 174 static bool debugging; /* -d: debugging reports */ 175 static bool iocccok; /* -e: fewer IOCCC errors */ 176 + static bool strictlogic; /* -K: keep ambiguous #ifs */ 177 static bool killconsts; /* -k: eval constant #ifs */ 178 static bool lnnum; /* -n: add #line directives */ 179 static bool symlist; /* -s: output symbol list */ 180 static bool text; /* -t: this is a text file */ ··· 196 static int stifline[MAXDEPTH]; /* start of current #if */ 197 static int depth; /* current #if nesting */ 198 static int delcount; /* count of deleted lines */ 199 + static unsigned blankcount; /* count of blank lines */ 200 + static unsigned blankmax; /* maximum recent blankcount */ 201 + static bool constexpr; /* constant #if expression */ 202 203 static int exitstat; /* program exit status */ 204 ··· 206 static void error(const char *); 207 static int findsym(const char *); 208 static void flushline(bool); 209 + static Linetype parseline(void); 210 static Linetype ifeval(const char **); 211 static void ignoreoff(void); 212 static void ignoreon(void); 213 static void keywordedit(const char *); 214 static void nest(void); 215 static void process(void); 216 + static const char *skipargs(const char *); 217 static const char *skipcomment(const char *); 218 static const char *skipsym(const char *); 219 static void state(Ifstate); ··· 220 static void unnest(void); 221 static void usage(void); 222 223 + #define endsym(c) (!isalnum((unsigned char)c) && c != '_') 224 225 /* 226 * The main program. ··· 230 { 231 int opt; 232 233 + while ((opt = getopt(argc, argv, "i:D:U:I:BbcdeKklnst")) != -1) 234 switch (opt) { 235 case 'i': /* treat stuff controlled by these symbols as text */ 236 /* ··· 255 case 'I': 256 /* no-op for compatibility with cpp */ 257 break; 258 + case 'B': /* compress blank lines around removed section */ 259 + compblank = true; 260 + break; 261 + case 'b': /* blank deleted lines instead of omitting them */ 262 + case 'l': /* backwards compatibility */ 263 + lnblank = true; 264 + break; 265 case 'c': /* treat -D as -U and vice versa */ 266 complement = true; 267 break; ··· 264 case 'e': /* fewer errors from dodgy lines */ 265 iocccok = true; 266 break; 267 + case 'K': /* keep ambiguous #ifs */ 268 + strictlogic = true; 269 + break; 270 case 'k': /* process constant #ifs */ 271 killconsts = true; 272 break; 273 case 'n': /* add #line directive after deleted lines */ 274 lnnum = true; ··· 284 } 285 argc -= optind; 286 argv += optind; 287 + if (compblank && lnblank) 288 + errx(2, "-B and -b are mutually exclusive"); 289 if (argc > 1) { 290 errx(2, "can only do one file"); 291 } else if (argc == 1 && strcmp(*argv, "-") != 0) { ··· 302 static void 303 usage(void) 304 { 305 + fprintf(stderr, "usage: unifdef [-BbcdeKknst] [-Ipath]" 306 " [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\n"); 307 exit(2); 308 } ··· 383 /* IS_OUTSIDE */ 384 { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Eendif, 385 Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Eendif, 386 + print, done, abort }, 387 /* IS_FALSE_PREFIX */ 388 { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Mpass, Strue, Sfalse,Selse, Dendif, 389 Idrop, Idrop, Fdrop, Fdrop, Fdrop, Mpass, Eioccc,Eioccc,Eioccc,Eioccc, 390 + drop, Eeof, abort }, 391 /* IS_TRUE_PREFIX */ 392 { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Dfalse,Dfalse,Dfalse,Delse, Dendif, 393 Oiffy, Oiffy, Fpass, Oif, Oif, Eioccc,Eioccc,Eioccc,Eioccc,Eioccc, 394 + print, Eeof, abort }, 395 /* IS_PASS_MIDDLE */ 396 { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Pelif, Mtrue, Delif, Pelse, Pendif, 397 Oiffy, Oiffy, Fpass, Oif, Oif, Pelif, Oelif, Oelif, Pelse, Pendif, 398 + print, Eeof, abort }, 399 /* IS_FALSE_MIDDLE */ 400 { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Pelif, Mtrue, Delif, Pelse, Pendif, 401 Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eioccc,Eioccc,Eioccc,Eioccc,Eioccc, 402 + drop, Eeof, abort }, 403 /* IS_TRUE_MIDDLE */ 404 { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Melif, Melif, Melif, Melse, Pendif, 405 Oiffy, Oiffy, Fpass, Oif, Oif, Eioccc,Eioccc,Eioccc,Eioccc,Pendif, 406 + print, Eeof, abort }, 407 /* IS_PASS_ELSE */ 408 { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Pendif, 409 Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Pendif, 410 + print, Eeof, abort }, 411 /* IS_FALSE_ELSE */ 412 { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eelif, Eelif, Eelif, Eelse, Dendif, 413 Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eelif, Eelif, Eelif, Eelse, Eioccc, 414 + drop, Eeof, abort }, 415 /* IS_TRUE_ELSE */ 416 { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Dendif, 417 Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Eioccc, 418 + print, Eeof, abort }, 419 /* IS_FALSE_TRAILER */ 420 { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Dfalse,Dfalse,Dfalse,Delse, Dendif, 421 Idrop, Idrop, Fdrop, Fdrop, Fdrop, Dfalse,Dfalse,Dfalse,Delse, Eioccc, 422 + drop, Eeof, abort } 423 /*TRUEI FALSEI IF TRUE FALSE ELIF ELTRUE ELFALSE ELSE ENDIF 424 TRUEI FALSEI IF TRUE FALSE ELIF ELTRUE ELFALSE ELSE ENDIF (DODGY) 425 + PLAIN EOF ERROR */ 426 }; 427 428 /* ··· 463 static void 464 nest(void) 465 { 466 + if (depth > MAXDEPTH-1) 467 + abort(); /* bug */ 468 + if (depth == MAXDEPTH-1) 469 error("Too many levels of nesting"); 470 + depth += 1; 471 stifline[depth] = linenum; 472 } 473 static void ··· 490 if (symlist) 491 return; 492 if (keep ^ complement) { 493 + bool blankline = tline[strspn(tline, " \t\n")] == '\0'; 494 + if (blankline && compblank && blankcount != blankmax) { 495 + delcount += 1; 496 + blankcount += 1; 497 + } else { 498 + if (lnnum && delcount > 0) 499 + printf("#line %d\n", linenum); 500 + fputs(tline, stdout); 501 + delcount = 0; 502 + blankmax = blankcount = blankline ? blankcount + 1 : 0; 503 + } 504 } else { 505 if (lnblank) 506 putc('\n', stdout); 507 exitstat = 1; 508 delcount += 1; 509 + blankcount = 0; 510 } 511 } 512 ··· 510 { 511 Linetype lineval; 512 513 + /* When compressing blank lines, act as if the file 514 + is preceded by a large number of blank lines. */ 515 + blankmax = blankcount = 1000; 516 for (;;) { 517 linenum++; 518 + lineval = parseline(); 519 trans_table[ifstate[depth]][lineval](); 520 debug("process %s -> %s depth %d", 521 linetype_name[lineval], ··· 526 * help from skipcomment(). 527 */ 528 static Linetype 529 + parseline(void) 530 { 531 const char *cp; 532 int cursym; ··· 595 if (incomment) 596 linestate = LS_DIRTY; 597 } 598 + /* skipcomment normally changes the state, except 599 + if the last line of the file lacks a newline, or 600 + if there is too much whitespace in a directive */ 601 + if (linestate == LS_HASH) { 602 + size_t len = cp - tline; 603 + if (fgets(tline + len, MAXLINE - len, input) == NULL) { 604 + /* append the missing newline */ 605 + tline[len+0] = '\n'; 606 + tline[len+1] = '\0'; 607 + cp++; 608 + linestate = LS_START; 609 + } else { 610 + linestate = LS_DIRTY; 611 + } 612 + } 613 } 614 if (linestate == LS_DIRTY) { 615 while (*cp != '\0') ··· 610 611 /* 612 * These are the binary operators that are supported by the expression 613 + * evaluator. 614 */ 615 + static Linetype op_strict(int *p, int v, Linetype at, Linetype bt) { 616 + if(at == LT_IF || bt == LT_IF) return (LT_IF); 617 + return (*p = v, v ? LT_TRUE : LT_FALSE); 618 + } 619 + static Linetype op_lt(int *p, Linetype at, int a, Linetype bt, int b) { 620 + return op_strict(p, a < b, at, bt); 621 + } 622 + static Linetype op_gt(int *p, Linetype at, int a, Linetype bt, int b) { 623 + return op_strict(p, a > b, at, bt); 624 + } 625 + static Linetype op_le(int *p, Linetype at, int a, Linetype bt, int b) { 626 + return op_strict(p, a <= b, at, bt); 627 + } 628 + static Linetype op_ge(int *p, Linetype at, int a, Linetype bt, int b) { 629 + return op_strict(p, a >= b, at, bt); 630 + } 631 + static Linetype op_eq(int *p, Linetype at, int a, Linetype bt, int b) { 632 + return op_strict(p, a == b, at, bt); 633 + } 634 + static Linetype op_ne(int *p, Linetype at, int a, Linetype bt, int b) { 635 + return op_strict(p, a != b, at, bt); 636 + } 637 + static Linetype op_or(int *p, Linetype at, int a, Linetype bt, int b) { 638 + if (!strictlogic && (at == LT_TRUE || bt == LT_TRUE)) 639 + return (*p = 1, LT_TRUE); 640 + return op_strict(p, a || b, at, bt); 641 + } 642 + static Linetype op_and(int *p, Linetype at, int a, Linetype bt, int b) { 643 + if (!strictlogic && (at == LT_FALSE || bt == LT_FALSE)) 644 + return (*p = 0, LT_FALSE); 645 + return op_strict(p, a && b, at, bt); 646 + } 647 648 /* 649 * An evaluation function takes three arguments, as follows: (1) a pointer to ··· 629 * value of the expression; and (3) a pointer to a char* that points to the 630 * expression to be evaluated and that is updated to the end of the expression 631 * when evaluation is complete. The function returns LT_FALSE if the value of 632 + * the expression is zero, LT_TRUE if it is non-zero, LT_IF if the expression 633 + * depends on an unknown symbol, or LT_ERROR if there is a parse failure. 634 */ 635 struct ops; 636 ··· 649 eval_fn *inner; 650 struct op { 651 const char *str; 652 + Linetype (*fn)(int *, Linetype, int, Linetype, int); 653 } op[5]; 654 } eval_ops[] = { 655 { eval_table, { { "||", op_or } } }, ··· 664 665 /* 666 * Function for evaluating the innermost parts of expressions, 667 + * viz. !expr (expr) number defined(symbol) symbol 668 + * We reset the constexpr flag in the last two cases. 669 */ 670 static Linetype 671 eval_unary(const struct ops *ops, int *valp, const char **cpp) ··· 673 const char *cp; 674 char *ep; 675 int sym; 676 + bool defparen; 677 + Linetype lt; 678 679 cp = skipcomment(*cpp); 680 if (*cp == '!') { 681 debug("eval%d !", ops - eval_ops); 682 cp++; 683 + lt = eval_unary(ops, valp, &cp); 684 + if (lt == LT_ERROR) 685 + return (LT_ERROR); 686 + if (lt != LT_IF) { 687 + *valp = !*valp; 688 + lt = *valp ? LT_TRUE : LT_FALSE; 689 } 690 } else if (*cp == '(') { 691 cp++; 692 debug("eval%d (", ops - eval_ops); 693 + lt = eval_table(eval_ops, valp, &cp); 694 + if (lt == LT_ERROR) 695 + return (LT_ERROR); 696 cp = skipcomment(cp); 697 if (*cp++ != ')') 698 + return (LT_ERROR); 699 } else if (isdigit((unsigned char)*cp)) { 700 debug("eval%d number", ops - eval_ops); 701 *valp = strtol(cp, &ep, 0); 702 + if (ep == cp) 703 + return (LT_ERROR); 704 + lt = *valp ? LT_TRUE : LT_FALSE; 705 cp = skipsym(cp); 706 } else if (strncmp(cp, "defined", 7) == 0 && endsym(cp[7])) { 707 cp = skipcomment(cp+7); 708 debug("eval%d defined", ops - eval_ops); 709 + if (*cp == '(') { 710 + cp = skipcomment(cp+1); 711 + defparen = true; 712 + } else { 713 + defparen = false; 714 + } 715 sym = findsym(cp); 716 + if (sym < 0) { 717 + lt = LT_IF; 718 + } else { 719 + *valp = (value[sym] != NULL); 720 + lt = *valp ? LT_TRUE : LT_FALSE; 721 + } 722 cp = skipsym(cp); 723 cp = skipcomment(cp); 724 + if (defparen && *cp++ != ')') 725 + return (LT_ERROR); 726 + constexpr = false; 727 } else if (!endsym(*cp)) { 728 debug("eval%d symbol", ops - eval_ops); 729 sym = findsym(cp); 730 + cp = skipsym(cp); 731 + if (sym < 0) { 732 + lt = LT_IF; 733 + cp = skipargs(cp); 734 + } else if (value[sym] == NULL) { 735 *valp = 0; 736 + lt = LT_FALSE; 737 + } else { 738 *valp = strtol(value[sym], &ep, 0); 739 if (*ep != '\0' || ep == value[sym]) 740 + return (LT_ERROR); 741 + lt = *valp ? LT_TRUE : LT_FALSE; 742 + cp = skipargs(cp); 743 } 744 + constexpr = false; 745 } else { 746 debug("eval%d bad expr", ops - eval_ops); 747 + return (LT_ERROR); 748 } 749 750 *cpp = cp; 751 debug("eval%d = %d", ops - eval_ops, *valp); 752 + return (lt); 753 } 754 755 /* ··· 746 const struct op *op; 747 const char *cp; 748 int val; 749 + Linetype lt, rt; 750 751 debug("eval%d", ops - eval_ops); 752 cp = *cpp; 753 + lt = ops->inner(ops+1, valp, &cp); 754 + if (lt == LT_ERROR) 755 + return (LT_ERROR); 756 for (;;) { 757 cp = skipcomment(cp); 758 for (op = ops->op; op->str != NULL; op++) ··· 760 break; 761 cp += strlen(op->str); 762 debug("eval%d %s", ops - eval_ops, op->str); 763 + rt = ops->inner(ops+1, &val, &cp); 764 + if (rt == LT_ERROR) 765 + return (LT_ERROR); 766 + lt = op->fn(valp, lt, *valp, rt, val); 767 } 768 769 *cpp = cp; 770 debug("eval%d = %d", ops - eval_ops, *valp); 771 + debug("eval%d lt = %s", ops - eval_ops, linetype_name[lt]); 772 + return (lt); 773 } 774 775 /* ··· 796 static Linetype 797 ifeval(const char **cpp) 798 { 799 int ret; 800 + int val = 0; 801 802 debug("eval %s", *cpp); 803 + constexpr = killconsts ? false : true; 804 + ret = eval_table(eval_ops, &val, cpp); 805 debug("eval = %d", val); 806 + return (constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret); 807 } 808 809 /* ··· 918 } 919 920 /* 921 + * Skip macro arguments. 922 + */ 923 + static const char * 924 + skipargs(const char *cp) 925 + { 926 + const char *ocp = cp; 927 + int level = 0; 928 + cp = skipcomment(cp); 929 + if (*cp != '(') 930 + return (cp); 931 + do { 932 + if (*cp == '(') 933 + level++; 934 + if (*cp == ')') 935 + level--; 936 + cp = skipcomment(cp+1); 937 + } while (level != 0 && *cp != '\0'); 938 + if (level == 0) 939 + return (cp); 940 + else 941 + /* Rewind and re-detect the syntax error later. */ 942 + return (ocp); 943 + } 944 + 945 + /* 946 * Skip over an identifier. 947 */ 948 static const char * ··· 929 } 930 931 /* 932 + * Look for the symbol in the symbol table. If it is found, we return 933 * the symbol table index, else we return -1. 934 */ 935 static int
+4 -1
usr/gen_init_cpio.c
··· 354 push_pad(); 355 356 if (size) { 357 - fwrite(filebuf, size, 1, stdout); 358 offset += size; 359 push_pad(); 360 }
··· 354 push_pad(); 355 356 if (size) { 357 + if (fwrite(filebuf, size, 1, stdout) != 1) { 358 + fprintf(stderr, "writing filebuf failed\n"); 359 + goto error; 360 + } 361 offset += size; 362 push_pad(); 363 }