aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-30 21:15:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-30 21:15:43 -0400
commit923f79743c76583ed4684e2c80c8da51a7268af3 (patch)
treee523a04c6b4cdddf70cf4adec25fa4fbbdbc5f5a /scripts
parenta7697b945e6e5025f184d6762e7285f1c498411d (diff)
parent7f3bd6c9cb8e9fa2b57bfa860cd3e734a28f48ed (diff)
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
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Kbuild.include2
-rw-r--r--scripts/Makefile.build2
-rw-r--r--scripts/Makefile.lib24
-rw-r--r--scripts/dtc/dtc.c5
-rw-r--r--scripts/dtc/flattree.c2
-rw-r--r--scripts/headers_check.pl38
-rw-r--r--scripts/mod/modpost.c2
-rwxr-xr-xscripts/setlocalversion3
8 files changed, 67 insertions, 11 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index d897278b1f97..6a3ee981931d 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -104,7 +104,7 @@ as-option = $(call try-run,\
104# Usage: cflags-y += $(call as-instr,instr,option1,option2) 104# Usage: cflags-y += $(call as-instr,instr,option1,option2)
105 105
106as-instr = $(call try-run,\ 106as-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# cc-option 109# cc-option
110# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) 110# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index d2b366c16b64..ff1720d28d0c 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -69,6 +69,7 @@ warning-1 += -Wmissing-prototypes
69warning-1 += -Wold-style-definition 69warning-1 += -Wold-style-definition
70warning-1 += $(call cc-option, -Wmissing-include-dirs) 70warning-1 += $(call cc-option, -Wmissing-include-dirs)
71warning-1 += $(call cc-option, -Wunused-but-set-variable) 71warning-1 += $(call cc-option, -Wunused-but-set-variable)
72warning-1 += $(call cc-disable-warning, missing-field-initializers)
72 73
73warning-2 := -Waggregate-return 74warning-2 := -Waggregate-return
74warning-2 += -Wcast-align 75warning-2 += -Wcast-align
@@ -76,6 +77,7 @@ warning-2 += -Wdisabled-optimization
76warning-2 += -Wnested-externs 77warning-2 += -Wnested-externs
77warning-2 += -Wshadow 78warning-2 += -Wshadow
78warning-2 += $(call cc-option, -Wlogical-op) 79warning-2 += $(call cc-option, -Wlogical-op)
80warning-2 += $(call cc-option, -Wmissing-field-initializers)
79 81
80warning-3 := -Wbad-function-cast 82warning-3 := -Wbad-function-cast
81warning-3 += -Wcast-qual 83warning-3 += -Wcast-qual
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 00c368c6e996..0be6f110cce7 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -304,6 +304,30 @@ cmd_lzo = (cat $(filter-out FORCE,$^) | \
304 lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ 304 lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
305 (rm -f $@ ; false) 305 (rm -f $@ ; false)
306 306
307# U-Boot mkimage
308# ---------------------------------------------------------------------------
309
310MKIMAGE := $(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
314UIMAGE_ARCH ?= $(SRCARCH)
315UIMAGE_COMPRESSION ?= $(if $(2),$(2),none)
316UIMAGE_OPTS-y ?=
317UIMAGE_TYPE ?= kernel
318UIMAGE_LOADADDR ?= arch_must_set_this
319UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR)
320UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)'
321UIMAGE_IN ?= $<
322UIMAGE_OUT ?= $@
323
324quiet_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# XZ 331# XZ
308# --------------------------------------------------------------------------- 332# ---------------------------------------------------------------------------
309# Use xzkern to compress the kernel image and xzmisc to compress other things. 333# Use xzkern to compress the kernel image and xzmisc to compress other things.
diff --git a/scripts/dtc/dtc.c b/scripts/dtc/dtc.c
index 451c92d31b19..2ef5e2e3dd38 100644
--- a/scripts/dtc/dtc.c
+++ b/scripts/dtc/dtc.c
@@ -101,7 +101,7 @@ int main(int argc, char *argv[])
101 const char *outform = "dts"; 101 const char *outform = "dts";
102 const char *outname = "-"; 102 const char *outname = "-";
103 const char *depname = NULL; 103 const char *depname = NULL;
104 int force = 0, check = 0, sort = 0; 104 int force = 0, sort = 0;
105 const char *arg; 105 const char *arg;
106 int opt; 106 int opt;
107 FILE *outf = NULL; 107 FILE *outf = NULL;
@@ -143,9 +143,6 @@ int main(int argc, char *argv[])
143 case 'f': 143 case 'f':
144 force = 1; 144 force = 1;
145 break; 145 break;
146 case 'c':
147 check = 1;
148 break;
149 case 'q': 146 case 'q':
150 quiet++; 147 quiet++;
151 break; 148 break;
diff --git a/scripts/dtc/flattree.c b/scripts/dtc/flattree.c
index ead0332c87e1..28d0b2381df6 100644
--- a/scripts/dtc/flattree.c
+++ b/scripts/dtc/flattree.c
@@ -697,7 +697,6 @@ static struct reserve_info *flat_read_mem_reserve(struct inbuf *inb)
697{ 697{
698 struct reserve_info *reservelist = NULL; 698 struct reserve_info *reservelist = NULL;
699 struct reserve_info *new; 699 struct reserve_info *new;
700 const char *p;
701 struct fdt_reserve_entry re; 700 struct fdt_reserve_entry re;
702 701
703 /* 702 /*
@@ -706,7 +705,6 @@ static struct reserve_info *flat_read_mem_reserve(struct inbuf *inb)
706 * 705 *
707 * First pass, count entries. 706 * First pass, count entries.
708 */ 707 */
709 p = inb->ptr;
710 while (1) { 708 while (1) {
711 flat_read_chunk(inb, &re, sizeof(re)); 709 flat_read_chunk(inb, &re, sizeof(re));
712 re.address = fdt64_to_cpu(re.address); 710 re.address = fdt64_to_cpu(re.address);
diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl
index 7957e7a5166a..64ac2380e4d5 100644
--- a/scripts/headers_check.pl
+++ b/scripts/headers_check.pl
@@ -19,6 +19,7 @@
19# 3) Check for leaked CONFIG_ symbols 19# 3) Check for leaked CONFIG_ symbols
20 20
21use strict; 21use strict;
22use File::Basename;
22 23
23my ($dir, $arch, @files) = @ARGV; 24my ($dir, $arch, @files) = @ARGV;
24 25
@@ -99,6 +100,39 @@ sub check_asm_types
99} 100}
100 101
101my $linux_types; 102my $linux_types;
103my %import_stack = ();
104sub check_include_typesh
105{
106 my $path = $_[0];
107 my $import_path;
108
109 my $fh;
110 my @file_paths = ($path, $dir . "/" . $path, dirname($filename) . "/" . $path);
111 for my $possible ( @file_paths ) {
112 if (not $import_stack{$possible} and open($fh, '<', $possible)) {
113 $import_path = $possible;
114 $import_stack{$import_path} = 1;
115 last;
116 }
117 }
118 if (eof $fh) {
119 return;
120 }
121
122 my $line;
123 while ($line = <$fh>) {
124 if ($line =~ m/^\s*#\s*include\s+<linux\/types.h>/) {
125 $linux_types = 1;
126 last;
127 }
128 if (my $included = ($line =~ /^\s*#\s*include\s+[<"](\S+)[>"]/)[0]) {
129 check_include_typesh($included);
130 }
131 }
132 close $fh;
133 delete $import_stack{$import_path};
134}
135
102sub check_sizetypes 136sub check_sizetypes
103{ 137{
104 if ($filename =~ /types.h|int-l64.h|int-ll64.h/o) { 138 if ($filename =~ /types.h|int-l64.h|int-ll64.h/o) {
@@ -113,6 +147,9 @@ sub check_sizetypes
113 $linux_types = 1; 147 $linux_types = 1;
114 return; 148 return;
115 } 149 }
150 if (my $included = ($line =~ /^\s*#\s*include\s+[<"](\S+)[>"]/)[0]) {
151 check_include_typesh($included);
152 }
116 if ($line =~ m/__[us](8|16|32|64)\b/) { 153 if ($line =~ m/__[us](8|16|32|64)\b/) {
117 printf STDERR "$filename:$lineno: " . 154 printf STDERR "$filename:$lineno: " .
118 "found __[us]{8,16,32,64} type " . 155 "found __[us]{8,16,32,64} type " .
@@ -122,4 +159,3 @@ sub check_sizetypes
122 #$ret = 1; 159 #$ret = 1;
123 } 160 }
124} 161}
125
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 9adb667dd31a..3f01fd908730 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -849,7 +849,7 @@ static void check_section(const char *modname, struct elf_info *elf,
849 849
850#define ALL_INIT_DATA_SECTIONS \ 850#define ALL_INIT_DATA_SECTIONS \
851 ".init.setup$", ".init.rodata$", \ 851 ".init.setup$", ".init.rodata$", \
852 ".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$" \ 852 ".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$", \
853 ".init.data$", ".devinit.data$", ".cpuinit.data$", ".meminit.data$" 853 ".init.data$", ".devinit.data$", ".cpuinit.data$", ".meminit.data$"
854#define ALL_EXIT_DATA_SECTIONS \ 854#define ALL_EXIT_DATA_SECTIONS \
855 ".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$" 855 ".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$"
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 4d403844e137..bd6dca8a0ab2 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -75,8 +75,7 @@ scm_version()
75 [ -w . ] && git update-index --refresh --unmerged > /dev/null 75 [ -w . ] && git update-index --refresh --unmerged > /dev/null
76 76
77 # Check for uncommitted changes 77 # Check for uncommitted changes
78 if git diff-index --name-only HEAD | grep -v "^scripts/package" \ 78 if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then
79 | read dummy; then
80 printf '%s' -dirty 79 printf '%s' -dirty
81 fi 80 fi
82 81