diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-30 15:55:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-30 15:55:49 -0400 |
commit | 65fc716fa673cf98fb5887180fd3c52ca0371198 (patch) | |
tree | 8f0924bdb63bafec89ece7f4fab36d31a7e9e2b6 | |
parent | 814b3bed63c23f310121befa0fe004a20dec95b2 (diff) | |
parent | 15a2ee74d22674c58f347b16b3af5601fa4e15db (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-- | Makefile | 8 | ||||
-rw-r--r-- | include/linux/init.h | 6 | ||||
-rw-r--r-- | scripts/Makefile.modpost | 2 | ||||
-rwxr-xr-x | scripts/checksyscalls.sh | 4 | ||||
-rw-r--r-- | scripts/headers_check.pl | 10 | ||||
-rw-r--r-- | scripts/headers_install.pl | 17 | ||||
-rw-r--r-- | scripts/mod/sumversion.c | 12 | ||||
-rwxr-xr-x | scripts/package/mkspec | 5 | ||||
-rwxr-xr-x | scripts/setlocalversion | 6 |
9 files changed, 48 insertions, 22 deletions
@@ -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 | ||
964 | define check-symlink | 965 | define 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 |
974 | endef | 979 | endef |
975 | 980 | ||
@@ -1431,7 +1436,8 @@ ALLSOURCE_ARCHS := $(SRCARCH) | |||
1431 | define find-sources | 1436 | define 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 | ||
115 | syscall_list() { | 115 | syscall_list() { |
116 | sed -n -e '/^\#define/ { s/[^_]*__NR_\([^[:space:]]*\).*/\ | 116 | sed -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 | ||
19 | use strict; | 19 | use strict; |
20 | use warnings; | ||
21 | 20 | ||
22 | my ($dir, $arch, @files) = @ARGV; | 21 | my ($dir, $arch, @files) = @ARGV; |
23 | 22 | ||
@@ -27,14 +26,15 @@ my $lineno = 0; | |||
27 | my $filename; | 26 | my $filename; |
28 | 27 | ||
29 | foreach my $file (@files) { | 28 | foreach 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 | } |
39 | exit $ret; | 39 | exit $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 | ||
19 | use strict; | 19 | use strict; |
20 | use warnings; | ||
21 | 20 | ||
22 | my ($readdir, $installdir, $arch, @files) = @ARGV; | 21 | my ($readdir, $installdir, $arch, @files) = @ARGV; |
23 | 22 | ||
24 | my $unifdef = "scripts/unifdef -U__KERNEL__"; | 23 | my $unifdef = "scripts/unifdef -U__KERNEL__"; |
25 | 24 | ||
26 | foreach my $file (@files) { | 25 | foreach 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 */ | ||
294 | static 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 | |||
57 | echo "%build" | 57 | echo "%build" |
58 | 58 | ||
59 | if ! $PREBUILT; then | 59 | if ! $PREBUILT; then |
60 | echo "make clean && make %{_smp_mflags}" | 60 | echo "make clean && make %{?_smp_mflags}" |
61 | echo "" | 61 | echo "" |
62 | fi | 62 | fi |
63 | 63 | ||
64 | echo "%install" | 64 | echo "%install" |
65 | echo "%ifarch ia64" | 65 | echo "%ifarch ia64" |
66 | echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules' | 66 | echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules' |
67 | echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware' | ||
67 | echo "%else" | 68 | echo "%else" |
68 | echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib/modules' | 69 | echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib/modules' |
70 | echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware' | ||
69 | echo "%endif" | 71 | echo "%endif" |
70 | 72 | ||
71 | echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags} modules_install' | 73 | echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags} modules_install' |
@@ -92,5 +94,6 @@ echo "%files" | |||
92 | echo '%defattr (-, root, root)' | 94 | echo '%defattr (-, root, root)' |
93 | echo "%dir /lib/modules" | 95 | echo "%dir /lib/modules" |
94 | echo "/lib/modules/$KERNELRELEASE" | 96 | echo "/lib/modules/$KERNELRELEASE" |
97 | echo "/lib/firmware" | ||
95 | echo "/boot/*" | 98 | echo "/boot/*" |
96 | echo "" | 99 | echo "" |
diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 83b75126c9f7..72d233528ade 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion | |||
@@ -9,11 +9,13 @@ usage() { | |||
9 | cd "${1:-.}" || usage | 9 | cd "${1:-.}" || usage |
10 | 10 | ||
11 | # Check for git and a git repo. | 11 | # Check for git and a git repo. |
12 | if head=`git rev-parse --verify HEAD 2>/dev/null`; then | 12 | if 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 |