Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull kbuild changes from Michal Marek:
- Unification of cmd_uimage among archs that use it
- make headers_check tries harder before reporting a missing
<linux/types.h> include
- kbuild portability fix for shells that do not support echo -e
- make clean descends into samples/
- setlocalversion grep fix
- modpost typo fix
- dtc warnings fix

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
setlocalversion: Use "grep -q" instead of piping output to "read dummy"
modpost: fix ALL_INIT_DATA_SECTIONS
Kbuild: centralize MKIMAGE and cmd_uimage definitions
headers_check: recursively search for linux/types.h inclusion
scripts/Kbuild.include: Fix portability problem of "echo -e"
scripts: dtc: fix compile warnings
kbuild: clean up samples directory
kbuild: disable -Wmissing-field-initializers for W=1

+98 -72
+1 -1
Makefile
··· 1170 1170 # 1171 1171 clean: rm-dirs := $(CLEAN_DIRS) 1172 1172 clean: rm-files := $(CLEAN_FILES) 1173 - clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation) 1173 + clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation samples) 1174 1174 1175 1175 PHONY += $(clean-dirs) clean archclean 1176 1176 $(clean-dirs):
+9 -14
arch/arm/boot/Makefile
··· 11 11 # Copyright (C) 1995-2002 Russell King 12 12 # 13 13 14 - MKIMAGE := $(srctree)/scripts/mkuboot.sh 15 - 16 14 ifneq ($(MACHINE),) 17 15 include $(srctree)/$(MACHINE)/Makefile.boot 18 16 endif ··· 67 69 68 70 clean-files := *.dtb 69 71 70 - quiet_cmd_uimage = UIMAGE $@ 71 - cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \ 72 - -C none -a $(LOADADDR) -e $(STARTADDR) \ 73 - -n 'Linux-$(KERNELRELEASE)' -d $< $@ 74 - 75 - ifeq ($(CONFIG_ZBOOT_ROM),y) 76 - $(obj)/uImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT) 72 + ifneq ($(LOADADDR),) 73 + UIMAGE_LOADADDR=$(LOADADDR) 77 74 else 78 - $(obj)/uImage: LOADADDR=$(ZRELADDR) 75 + ifeq ($(CONFIG_ZBOOT_ROM),y) 76 + UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT) 77 + else 78 + UIMAGE_LOADADDR=$(ZRELADDR) 79 + endif 79 80 endif 80 81 81 - $(obj)/uImage: STARTADDR=$(LOADADDR) 82 - 83 82 check_for_multiple_loadaddr = \ 84 - if [ $(words $(LOADADDR)) -gt 1 ]; then \ 85 - echo 'multiple load addresses: $(LOADADDR)'; \ 83 + if [ $(words $(UIMAGE_LOADADDR)) -gt 1 ]; then \ 84 + echo 'multiple load addresses: $(UIMAGE_LOADADDR)'; \ 86 85 echo 'This is incompatible with uImages'; \ 87 86 echo 'Specify LOADADDR on the commandline to build an uImage'; \ 88 87 false; \
+3 -6
arch/avr32/boot/images/Makefile
··· 6 6 # for more details. 7 7 # 8 8 9 - MKIMAGE := $(srctree)/scripts/mkuboot.sh 10 - 11 9 extra-y := vmlinux.bin vmlinux.gz 12 10 13 11 OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note.gnu.build-id ··· 15 17 $(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE 16 18 $(call if_changed,gzip) 17 19 18 - quiet_cmd_uimage = UIMAGE $@ 19 - cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A avr32 -O linux -T kernel \ 20 - -C gzip -a $(CONFIG_LOAD_ADDRESS) -e $(CONFIG_ENTRY_ADDRESS) \ 21 - -n 'Linux-$(KERNELRELEASE)' -d $< $@ 20 + UIMAGE_LOADADDR = $(CONFIG_LOAD_ADDRESS) 21 + UIMAGE_ENTRYADDR = $(CONFIG_ENTRY_ADDRESS) 22 + UIMAGE_COMPRESSION = gzip 22 23 23 24 targets += uImage uImage.srec 24 25 $(obj)/uImage: $(obj)/vmlinux.gz
+8 -11
arch/blackfin/boot/Makefile
··· 6 6 # for more details. 7 7 # 8 8 9 - MKIMAGE := $(srctree)/scripts/mkuboot.sh 10 - 11 9 targets := vmImage vmImage.bin vmImage.bz2 vmImage.gz vmImage.lzma vmImage.lzo vmImage.xip 12 10 extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.xip 13 11 14 - UIMAGE_OPTS-y := 15 - UIMAGE_OPTS-$(CONFIG_RAMKERNEL) += -a $(CONFIG_BOOT_LOAD) 16 - UIMAGE_OPTS-$(CONFIG_ROMKERNEL) += -a $(CONFIG_ROM_BASE) -x 17 - 18 - quiet_cmd_uimage = UIMAGE $@ 19 - cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(ARCH) -O linux -T kernel \ 20 - -C $(2) -n '$(CPU_REV)-$(KERNELRELEASE)' \ 21 - -e $(shell $(NM) vmlinux | awk '$$NF == "__start" {print $$1}') \ 22 - $(UIMAGE_OPTS-y) -d $< $@ 12 + ifeq ($(CONFIG_RAMKERNEL),y) 13 + UIMAGE_LOADADDR = $(CONFIG_BOOT_LOAD) 14 + else # CONFIG_ROMKERNEL must be set 15 + UIMAGE_LOADADDR = $(CONFIG_ROM_BASE) 16 + endif 17 + UIMAGE_ENTRYADDR = $(shell $(NM) vmlinux | awk '$$NF == "__start" {print $$1}') 18 + UIMAGE_NAME = '$(CPU_REV)-$(KERNELRELEASE)' 19 + UIMAGE_OPTS-$(CONFIG_ROMKERNEL) += -x 23 20 24 21 $(obj)/vmlinux.bin: vmlinux FORCE 25 22 $(call if_changed,objcopy)
+3 -7
arch/microblaze/boot/Makefile
··· 2 2 # arch/microblaze/boot/Makefile 3 3 # 4 4 5 - MKIMAGE := $(srctree)/scripts/mkuboot.sh 6 - 7 5 obj-y += linked_dtb.o 8 6 9 7 targets := linux.bin linux.bin.gz simpleImage.% ··· 33 35 cmd_strip = $(STRIP) -K microblaze_start -K _end -K __log_buf \ 34 36 -K _fdt_start vmlinux -o $@ 35 37 36 - quiet_cmd_uimage = UIMAGE $@.ub 37 - cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A microblaze -O linux -T kernel \ 38 - -C none -n 'Linux-$(KERNELRELEASE)' \ 39 - -a $(CONFIG_KERNEL_BASE_ADDR) -e $(CONFIG_KERNEL_BASE_ADDR) \ 40 - -d $@ $@.ub 38 + UIMAGE_IN = $@ 39 + UIMAGE_OUT = $@.ub 40 + UIMAGE_LOADADDR = $(CONFIG_KERNEL_BASE_ADDR) 41 41 42 42 $(obj)/simpleImage.%: vmlinux FORCE 43 43 $(call if_changed,cp,.unstrip)
+2 -6
arch/sh/boot/Makefile
··· 8 8 # Copyright (C) 1999 Stuart Menefy 9 9 # 10 10 11 - MKIMAGE := $(srctree)/scripts/mkuboot.sh 12 - 13 11 # 14 12 # Assign safe dummy values if these variables are not defined, 15 13 # in order to suppress error message. ··· 59 61 $(KERNEL_MEMORY) + \ 60 62 $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]') 61 63 62 - quiet_cmd_uimage = UIMAGE $@ 63 - cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \ 64 - -C $(2) -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \ 65 - -n 'Linux-$(KERNELRELEASE)' -d $< $@ 64 + UIMAGE_LOADADDR = $(KERNEL_LOAD) 65 + UIMAGE_ENTRYADDR = $(KERNEL_ENTRY) 66 66 67 67 $(obj)/vmlinux.bin: vmlinux FORCE 68 68 $(call if_changed,objcopy)
+3 -6
arch/sparc/boot/Makefile
··· 5 5 6 6 ROOT_IMG := /usr/src/root.img 7 7 ELFTOAOUT := elftoaout 8 - MKIMAGE := $(srctree)/scripts/mkuboot.sh 9 8 10 9 hostprogs-y := piggyback btfixupprep 11 10 targets := tftpboot.img btfix.o btfix.S image zImage vmlinux.aout ··· 91 92 $(obj)/image.gz: $(obj)/image.bin 92 93 $(call if_changed,gzip) 93 94 94 - quiet_cmd_uimage = UIMAGE $@ 95 - cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sparc -O linux -T kernel \ 96 - -C gzip -a $(CONFIG_UBOOT_LOAD_ADDR) \ 97 - -e $(CONFIG_UBOOT_ENTRY_ADDR) -n 'Linux-$(KERNELRELEASE)' \ 98 - -d $< $@ 95 + UIMAGE_LOADADDR = $(CONFIG_UBOOT_LOAD_ADDR) 96 + UIMAGE_ENTRYADDR = $(CONFIG_UBOOT_ENTRY_ADDR) 97 + UIMAGE_COMPRESSION = gzip 99 98 100 99 quiet_cmd_uimage.o = UIMAGE.O $@ 101 100 cmd_uimage.o = $(LD) -Tdata $(CONFIG_UBOOT_FLASH_ADDR) \
+2 -10
arch/unicore32/boot/Makefile
··· 11 11 # Copyright (C) 2001~2010 GUAN Xue-tao 12 12 # 13 13 14 - MKIMAGE := $(srctree)/scripts/mkuboot.sh 15 - 16 14 targets := Image zImage uImage 17 15 18 16 $(obj)/Image: vmlinux FORCE ··· 24 26 $(call if_changed,objcopy) 25 27 @echo ' Kernel: $@ is ready' 26 28 27 - quiet_cmd_uimage = UIMAGE $@ 28 - cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A unicore -O linux -T kernel \ 29 - -C none -a $(LOADADDR) -e $(STARTADDR) \ 30 - -n 'Linux-$(KERNELRELEASE)' -d $< $@ 31 - 32 - $(obj)/uImage: LOADADDR=0x0 33 - 34 - $(obj)/uImage: STARTADDR=$(LOADADDR) 29 + UIMAGE_ARCH = unicore 30 + UIMAGE_LOADADDR = 0x0 35 31 36 32 $(obj)/uImage: $(obj)/zImage FORCE 37 33 $(call if_changed,uimage)
+1 -1
scripts/Kbuild.include
··· 104 104 # Usage: cflags-y += $(call as-instr,instr,option1,option2) 105 105 106 106 as-instr = $(call try-run,\ 107 - /bin/echo -e "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3)) 107 + printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3)) 108 108 109 109 # cc-option 110 110 # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
+2
scripts/Makefile.build
··· 69 69 warning-1 += -Wold-style-definition 70 70 warning-1 += $(call cc-option, -Wmissing-include-dirs) 71 71 warning-1 += $(call cc-option, -Wunused-but-set-variable) 72 + warning-1 += $(call cc-disable-warning, missing-field-initializers) 72 73 73 74 warning-2 := -Waggregate-return 74 75 warning-2 += -Wcast-align ··· 77 76 warning-2 += -Wnested-externs 78 77 warning-2 += -Wshadow 79 78 warning-2 += $(call cc-option, -Wlogical-op) 79 + warning-2 += $(call cc-option, -Wmissing-field-initializers) 80 80 81 81 warning-3 := -Wbad-function-cast 82 82 warning-3 += -Wcast-qual
+24
scripts/Makefile.lib
··· 304 304 lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ 305 305 (rm -f $@ ; false) 306 306 307 + # U-Boot mkimage 308 + # --------------------------------------------------------------------------- 309 + 310 + MKIMAGE := $(srctree)/scripts/mkuboot.sh 311 + 312 + # SRCARCH just happens to match slightly more than ARCH (on sparc), so reduces 313 + # the number of overrides in arch makefiles 314 + UIMAGE_ARCH ?= $(SRCARCH) 315 + UIMAGE_COMPRESSION ?= $(if $(2),$(2),none) 316 + UIMAGE_OPTS-y ?= 317 + UIMAGE_TYPE ?= kernel 318 + UIMAGE_LOADADDR ?= arch_must_set_this 319 + UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR) 320 + UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)' 321 + UIMAGE_IN ?= $< 322 + UIMAGE_OUT ?= $@ 323 + 324 + quiet_cmd_uimage = UIMAGE $(UIMAGE_OUT) 325 + cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \ 326 + -C $(UIMAGE_COMPRESSION) $(UIMAGE_OPTS-y) \ 327 + -T $(UIMAGE_TYPE) \ 328 + -a $(UIMAGE_LOADADDR) -e $(UIMAGE_ENTRYADDR) \ 329 + -n $(UIMAGE_NAME) -d $(UIMAGE_IN) $(UIMAGE_OUT) 330 + 307 331 # XZ 308 332 # --------------------------------------------------------------------------- 309 333 # Use xzkern to compress the kernel image and xzmisc to compress other things.
+1 -4
scripts/dtc/dtc.c
··· 101 101 const char *outform = "dts"; 102 102 const char *outname = "-"; 103 103 const char *depname = NULL; 104 - int force = 0, check = 0, sort = 0; 104 + int force = 0, sort = 0; 105 105 const char *arg; 106 106 int opt; 107 107 FILE *outf = NULL; ··· 142 142 break; 143 143 case 'f': 144 144 force = 1; 145 - break; 146 - case 'c': 147 - check = 1; 148 145 break; 149 146 case 'q': 150 147 quiet++;
-2
scripts/dtc/flattree.c
··· 697 697 { 698 698 struct reserve_info *reservelist = NULL; 699 699 struct reserve_info *new; 700 - const char *p; 701 700 struct fdt_reserve_entry re; 702 701 703 702 /* ··· 705 706 * 706 707 * First pass, count entries. 707 708 */ 708 - p = inb->ptr; 709 709 while (1) { 710 710 flat_read_chunk(inb, &re, sizeof(re)); 711 711 re.address = fdt64_to_cpu(re.address);
+37 -1
scripts/headers_check.pl
··· 19 19 # 3) Check for leaked CONFIG_ symbols 20 20 21 21 use strict; 22 + use File::Basename; 22 23 23 24 my ($dir, $arch, @files) = @ARGV; 24 25 ··· 100 99 } 101 100 102 101 my $linux_types; 102 + my %import_stack = (); 103 + sub check_include_typesh 104 + { 105 + my $path = $_[0]; 106 + my $import_path; 107 + 108 + my $fh; 109 + my @file_paths = ($path, $dir . "/" . $path, dirname($filename) . "/" . $path); 110 + for my $possible ( @file_paths ) { 111 + if (not $import_stack{$possible} and open($fh, '<', $possible)) { 112 + $import_path = $possible; 113 + $import_stack{$import_path} = 1; 114 + last; 115 + } 116 + } 117 + if (eof $fh) { 118 + return; 119 + } 120 + 121 + my $line; 122 + while ($line = <$fh>) { 123 + if ($line =~ m/^\s*#\s*include\s+<linux\/types.h>/) { 124 + $linux_types = 1; 125 + last; 126 + } 127 + if (my $included = ($line =~ /^\s*#\s*include\s+[<"](\S+)[>"]/)[0]) { 128 + check_include_typesh($included); 129 + } 130 + } 131 + close $fh; 132 + delete $import_stack{$import_path}; 133 + } 134 + 103 135 sub check_sizetypes 104 136 { 105 137 if ($filename =~ /types.h|int-l64.h|int-ll64.h/o) { ··· 147 113 $linux_types = 1; 148 114 return; 149 115 } 116 + if (my $included = ($line =~ /^\s*#\s*include\s+[<"](\S+)[>"]/)[0]) { 117 + check_include_typesh($included); 118 + } 150 119 if ($line =~ m/__[us](8|16|32|64)\b/) { 151 120 printf STDERR "$filename:$lineno: " . 152 121 "found __[us]{8,16,32,64} type " . ··· 159 122 #$ret = 1; 160 123 } 161 124 } 162 -
+1 -1
scripts/mod/modpost.c
··· 849 849 850 850 #define ALL_INIT_DATA_SECTIONS \ 851 851 ".init.setup$", ".init.rodata$", \ 852 - ".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$" \ 852 + ".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$", \ 853 853 ".init.data$", ".devinit.data$", ".cpuinit.data$", ".meminit.data$" 854 854 #define ALL_EXIT_DATA_SECTIONS \ 855 855 ".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$"
+1 -2
scripts/setlocalversion
··· 75 75 [ -w . ] && git update-index --refresh --unmerged > /dev/null 76 76 77 77 # Check for uncommitted changes 78 - if git diff-index --name-only HEAD | grep -v "^scripts/package" \ 79 - | read dummy; then 78 + if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then 80 79 printf '%s' -dirty 81 80 fi 82 81