aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-30 15:55:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-30 15:55:49 -0400
commit65fc716fa673cf98fb5887180fd3c52ca0371198 (patch)
tree8f0924bdb63bafec89ece7f4fab36d31a7e9e2b6
parent814b3bed63c23f310121befa0fe004a20dec95b2 (diff)
parent15a2ee74d22674c58f347b16b3af5601fa4e15db (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes: Fix incompatibility with versions of Perl less than 5.6.0 kbuild: do not include arch/<ARCH>/include/asm in find-sources twice. kbuild: tag with git revision when git describe is missing kbuild: prevent modpost from looking for a .cmd file for a static library linked into a module kbuild: fix KBUILD_EXTRA_SYMBOLS adjust init section definitions scripts/checksyscalls.sh: fix for non-gnu sed scripts/package: don't break if %{_smp_mflags} isn't set kbuild: setlocalversion: dont include svn change count kbuild: improve check-symlink kbuild: mkspec - fix build rpm
-rw-r--r--Makefile8
-rw-r--r--include/linux/init.h6
-rw-r--r--scripts/Makefile.modpost2
-rwxr-xr-xscripts/checksyscalls.sh4
-rw-r--r--scripts/headers_check.pl10
-rw-r--r--scripts/headers_install.pl17
-rw-r--r--scripts/mod/sumversion.c12
-rwxr-xr-xscripts/package/mkspec5
-rwxr-xr-xscripts/setlocalversion6
9 files changed, 48 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index a7f20687d8e5..d50081751e02 100644
--- a/Makefile
+++ b/Makefile
@@ -961,6 +961,7 @@ export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH)
961 961
962# The asm symlink changes when $(ARCH) changes. 962# The asm symlink changes when $(ARCH) changes.
963# Detect this and ask user to run make mrproper 963# Detect this and ask user to run make mrproper
964# If asm is a stale symlink (point to dir that does not exist) remove it
964define check-symlink 965define check-symlink
965 set -e; \ 966 set -e; \
966 if [ -L include/asm ]; then \ 967 if [ -L include/asm ]; then \
@@ -970,6 +971,10 @@ define check-symlink
970 echo " set ARCH or save .config and run 'make mrproper' to fix it"; \ 971 echo " set ARCH or save .config and run 'make mrproper' to fix it"; \
971 exit 1; \ 972 exit 1; \
972 fi; \ 973 fi; \
974 test -e $$asmlink || rm include/asm; \
975 elif [ -d include/asm ]; then \
976 echo "ERROR: $@ is a directory but a symlink was expected";\
977 exit 1; \
973 fi 978 fi
974endef 979endef
975 980
@@ -1431,7 +1436,8 @@ ALLSOURCE_ARCHS := $(SRCARCH)
1431define find-sources 1436define find-sources
1432 ( for arch in $(ALLSOURCE_ARCHS) ; do \ 1437 ( for arch in $(ALLSOURCE_ARCHS) ; do \
1433 find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \ 1438 find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \
1434 -name $1 -print; \ 1439 -wholename $(__srctree)arch/$${arch}/include/asm -type d -prune \
1440 -o -name $1 -print; \
1435 done ; \ 1441 done ; \
1436 find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \ 1442 find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
1437 -name $1 -print; \ 1443 -name $1 -print; \
diff --git a/include/linux/init.h b/include/linux/init.h
index 0c1264668be0..68cb0265d009 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -112,21 +112,25 @@
112#define __FINIT .previous 112#define __FINIT .previous
113 113
114#define __INITDATA .section ".init.data","aw" 114#define __INITDATA .section ".init.data","aw"
115#define __INITRODATA .section ".init.rodata","a"
115#define __FINITDATA .previous 116#define __FINITDATA .previous
116 117
117#define __DEVINIT .section ".devinit.text", "ax" 118#define __DEVINIT .section ".devinit.text", "ax"
118#define __DEVINITDATA .section ".devinit.data", "aw" 119#define __DEVINITDATA .section ".devinit.data", "aw"
120#define __DEVINITRODATA .section ".devinit.rodata", "a"
119 121
120#define __CPUINIT .section ".cpuinit.text", "ax" 122#define __CPUINIT .section ".cpuinit.text", "ax"
121#define __CPUINITDATA .section ".cpuinit.data", "aw" 123#define __CPUINITDATA .section ".cpuinit.data", "aw"
124#define __CPUINITRODATA .section ".cpuinit.rodata", "a"
122 125
123#define __MEMINIT .section ".meminit.text", "ax" 126#define __MEMINIT .section ".meminit.text", "ax"
124#define __MEMINITDATA .section ".meminit.data", "aw" 127#define __MEMINITDATA .section ".meminit.data", "aw"
128#define __MEMINITRODATA .section ".meminit.rodata", "a"
125 129
126/* silence warnings when references are OK */ 130/* silence warnings when references are OK */
127#define __REF .section ".ref.text", "ax" 131#define __REF .section ".ref.text", "ax"
128#define __REFDATA .section ".ref.data", "aw" 132#define __REFDATA .section ".ref.data", "aw"
129#define __REFCONST .section ".ref.rodata", "aw" 133#define __REFCONST .section ".ref.rodata", "a"
130 134
131#ifndef __ASSEMBLY__ 135#ifndef __ASSEMBLY__
132/* 136/*
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 9ee9783aea57..f4053dc7b5d6 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -82,7 +82,7 @@ modpost = scripts/mod/modpost \
82 $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \ 82 $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \
83 $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \ 83 $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
84 $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \ 84 $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
85 $(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e %,$(EXTRA_SYMBOLS))) \ 85 $(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e %,$(KBUILD_EXTRA_SYMBOLS))) \
86 $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ 86 $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
87 $(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \ 87 $(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \
88 $(if $(CONFIG_MARKERS),-K $(kernelmarkersfile)) \ 88 $(if $(CONFIG_MARKERS),-K $(kernelmarkersfile)) \
diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh
index 41564b142c04..60d00d1c4eee 100755
--- a/scripts/checksyscalls.sh
+++ b/scripts/checksyscalls.sh
@@ -113,10 +113,10 @@ EOF
113} 113}
114 114
115syscall_list() { 115syscall_list() {
116sed -n -e '/^\#define/ { s/[^_]*__NR_\([^[:space:]]*\).*/\ 116sed -n -e '/^\#define/ s/[^_]*__NR_\([^[:space:]]*\).*/\
117\#if !defined \(__NR_\1\) \&\& !defined \(__IGNORE_\1\)\ 117\#if !defined \(__NR_\1\) \&\& !defined \(__IGNORE_\1\)\
118\#warning syscall \1 not implemented\ 118\#warning syscall \1 not implemented\
119\#endif/p }' $1 119\#endif/p' $1
120} 120}
121 121
122(ignore_list && syscall_list ${srctree}/arch/x86/include/asm/unistd_32.h) | \ 122(ignore_list && syscall_list ${srctree}/arch/x86/include/asm/unistd_32.h) | \
diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl
index 15d53a6b1a1f..488a3b1f760f 100644
--- a/scripts/headers_check.pl
+++ b/scripts/headers_check.pl
@@ -1,4 +1,4 @@
1#!/usr/bin/perl 1#!/usr/bin/perl -w
2# 2#
3# headers_check.pl execute a number of trivial consistency checks 3# headers_check.pl execute a number of trivial consistency checks
4# 4#
@@ -17,7 +17,6 @@
17# 2) TODO: check for leaked CONFIG_ symbols 17# 2) TODO: check for leaked CONFIG_ symbols
18 18
19use strict; 19use strict;
20use warnings;
21 20
22my ($dir, $arch, @files) = @ARGV; 21my ($dir, $arch, @files) = @ARGV;
23 22
@@ -27,14 +26,15 @@ my $lineno = 0;
27my $filename; 26my $filename;
28 27
29foreach my $file (@files) { 28foreach my $file (@files) {
29 local *FH;
30 $filename = $file; 30 $filename = $file;
31 open(my $fh, '<', "$filename") or die "$filename: $!\n"; 31 open(FH, "<$filename") or die "$filename: $!\n";
32 $lineno = 0; 32 $lineno = 0;
33 while ($line = <$fh>) { 33 while ($line = <FH>) {
34 $lineno++; 34 $lineno++;
35 check_include(); 35 check_include();
36 } 36 }
37 close $fh; 37 close FH;
38} 38}
39exit $ret; 39exit $ret;
40 40
diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
index 68591cd08731..7d2b4146e02f 100644
--- a/scripts/headers_install.pl
+++ b/scripts/headers_install.pl
@@ -1,4 +1,4 @@
1#!/usr/bin/perl 1#!/usr/bin/perl -w
2# 2#
3# headers_install prepare the listed header files for use in 3# headers_install prepare the listed header files for use in
4# user space and copy the files to their destination. 4# user space and copy the files to their destination.
@@ -17,28 +17,29 @@
17# 3) Drop all sections defined out by __KERNEL__ (using unifdef) 17# 3) Drop all sections defined out by __KERNEL__ (using unifdef)
18 18
19use strict; 19use strict;
20use warnings;
21 20
22my ($readdir, $installdir, $arch, @files) = @ARGV; 21my ($readdir, $installdir, $arch, @files) = @ARGV;
23 22
24my $unifdef = "scripts/unifdef -U__KERNEL__"; 23my $unifdef = "scripts/unifdef -U__KERNEL__";
25 24
26foreach my $file (@files) { 25foreach my $file (@files) {
26 local *INFILE;
27 local *OUTFILE;
27 my $tmpfile = "$installdir/$file.tmp"; 28 my $tmpfile = "$installdir/$file.tmp";
28 open(my $infile, '<', "$readdir/$file") 29 open(INFILE, "<$readdir/$file")
29 or die "$readdir/$file: $!\n"; 30 or die "$readdir/$file: $!\n";
30 open(my $outfile, '>', "$tmpfile") or die "$tmpfile: $!\n"; 31 open(OUTFILE, ">$tmpfile") or die "$tmpfile: $!\n";
31 while (my $line = <$infile>) { 32 while (my $line = <INFILE>) {
32 $line =~ s/([\s(])__user\s/$1/g; 33 $line =~ s/([\s(])__user\s/$1/g;
33 $line =~ s/([\s(])__force\s/$1/g; 34 $line =~ s/([\s(])__force\s/$1/g;
34 $line =~ s/([\s(])__iomem\s/$1/g; 35 $line =~ s/([\s(])__iomem\s/$1/g;
35 $line =~ s/\s__attribute_const__\s/ /g; 36 $line =~ s/\s__attribute_const__\s/ /g;
36 $line =~ s/\s__attribute_const__$//g; 37 $line =~ s/\s__attribute_const__$//g;
37 $line =~ s/^#include <linux\/compiler.h>//; 38 $line =~ s/^#include <linux\/compiler.h>//;
38 printf $outfile "%s", $line; 39 printf OUTFILE "%s", $line;
39 } 40 }
40 close $outfile; 41 close OUTFILE;
41 close $infile; 42 close INFILE;
42 system $unifdef . " $tmpfile > $installdir/$file"; 43 system $unifdef . " $tmpfile > $installdir/$file";
43 unlink $tmpfile; 44 unlink $tmpfile;
44} 45}
diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c
index d9cc6901d680..aadc5223dcdb 100644
--- a/scripts/mod/sumversion.c
+++ b/scripts/mod/sumversion.c
@@ -290,6 +290,15 @@ static int parse_file(const char *fname, struct md4_ctx *md)
290 release_file(file, len); 290 release_file(file, len);
291 return 1; 291 return 1;
292} 292}
293/* Check whether the file is a static library or not */
294static int is_static_library(const char *objfile)
295{
296 int len = strlen(objfile);
297 if (objfile[len - 2] == '.' && objfile[len - 1] == 'a')
298 return 1;
299 else
300 return 0;
301}
293 302
294/* We have dir/file.o. Open dir/.file.o.cmd, look for deps_ line to 303/* We have dir/file.o. Open dir/.file.o.cmd, look for deps_ line to
295 * figure out source file. */ 304 * figure out source file. */
@@ -420,7 +429,8 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen)
420 while ((fname = strsep(&sources, " ")) != NULL) { 429 while ((fname = strsep(&sources, " ")) != NULL) {
421 if (!*fname) 430 if (!*fname)
422 continue; 431 continue;
423 if (!parse_source_files(fname, &md)) 432 if (!(is_static_library(fname)) &&
433 !parse_source_files(fname, &md))
424 goto release; 434 goto release;
425 } 435 }
426 436
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index ffd61fe0c1ad..2500886fb90a 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -57,15 +57,17 @@ fi
57echo "%build" 57echo "%build"
58 58
59if ! $PREBUILT; then 59if ! $PREBUILT; then
60echo "make clean && make %{_smp_mflags}" 60echo "make clean && make %{?_smp_mflags}"
61echo "" 61echo ""
62fi 62fi
63 63
64echo "%install" 64echo "%install"
65echo "%ifarch ia64" 65echo "%ifarch ia64"
66echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules' 66echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules'
67echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware'
67echo "%else" 68echo "%else"
68echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib/modules' 69echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib/modules'
70echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware'
69echo "%endif" 71echo "%endif"
70 72
71echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags} modules_install' 73echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags} modules_install'
@@ -92,5 +94,6 @@ echo "%files"
92echo '%defattr (-, root, root)' 94echo '%defattr (-, root, root)'
93echo "%dir /lib/modules" 95echo "%dir /lib/modules"
94echo "/lib/modules/$KERNELRELEASE" 96echo "/lib/modules/$KERNELRELEASE"
97echo "/lib/firmware"
95echo "/boot/*" 98echo "/boot/*"
96echo "" 99echo ""
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 83b75126c9f7..72d233528ade 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -9,11 +9,13 @@ usage() {
9cd "${1:-.}" || usage 9cd "${1:-.}" || usage
10 10
11# Check for git and a git repo. 11# Check for git and a git repo.
12if head=`git rev-parse --verify HEAD 2>/dev/null`; then 12if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
13 # Do we have an untagged version? 13 # Do we have an untagged version?
14 if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then 14 if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
15 if tag=`git describe 2>/dev/null`; then 15 if tag=`git describe 2>/dev/null`; then
16 echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' 16 echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
17 else
18 printf '%s%s' -g $head
17 fi 19 fi
18 fi 20 fi
19 21
@@ -55,7 +57,7 @@ if rev=`svn info 2>/dev/null | grep '^Revision'`; then
55 57
56 # Are there uncommitted changes? 58 # Are there uncommitted changes?
57 if [ $changes != 0 ]; then 59 if [ $changes != 0 ]; then
58 printf -- '-svn%s%s%s' "$rev" -dirty "$changes" 60 printf -- '-svn%s%s' "$rev" -dirty
59 else 61 else
60 printf -- '-svn%s' "$rev" 62 printf -- '-svn%s' "$rev"
61 fi 63 fi