Commit 65fc716f authored by Linus Torvalds's avatar Linus Torvalds

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
parents 814b3bed 15a2ee74
...@@ -961,6 +961,7 @@ export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH) ...@@ -961,6 +961,7 @@ export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH)
# The asm symlink changes when $(ARCH) changes. # The asm symlink changes when $(ARCH) changes.
# Detect this and ask user to run make mrproper # Detect this and ask user to run make mrproper
# If asm is a stale symlink (point to dir that does not exist) remove it
define check-symlink define check-symlink
set -e; \ set -e; \
if [ -L include/asm ]; then \ if [ -L include/asm ]; then \
...@@ -970,6 +971,10 @@ define check-symlink ...@@ -970,6 +971,10 @@ define check-symlink
echo " set ARCH or save .config and run 'make mrproper' to fix it"; \ echo " set ARCH or save .config and run 'make mrproper' to fix it"; \
exit 1; \ exit 1; \
fi; \ fi; \
test -e $$asmlink || rm include/asm; \
elif [ -d include/asm ]; then \
echo "ERROR: $@ is a directory but a symlink was expected";\
exit 1; \
fi fi
endef endef
...@@ -1431,7 +1436,8 @@ ALLSOURCE_ARCHS := $(SRCARCH) ...@@ -1431,7 +1436,8 @@ ALLSOURCE_ARCHS := $(SRCARCH)
define find-sources define find-sources
( for arch in $(ALLSOURCE_ARCHS) ; do \ ( for arch in $(ALLSOURCE_ARCHS) ; do \
find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \ find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \
-name $1 -print; \ -wholename $(__srctree)arch/$${arch}/include/asm -type d -prune \
-o -name $1 -print; \
done ; \ done ; \
find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \ find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
-name $1 -print; \ -name $1 -print; \
......
...@@ -112,21 +112,25 @@ ...@@ -112,21 +112,25 @@
#define __FINIT .previous #define __FINIT .previous
#define __INITDATA .section ".init.data","aw" #define __INITDATA .section ".init.data","aw"
#define __INITRODATA .section ".init.rodata","a"
#define __FINITDATA .previous #define __FINITDATA .previous
#define __DEVINIT .section ".devinit.text", "ax" #define __DEVINIT .section ".devinit.text", "ax"
#define __DEVINITDATA .section ".devinit.data", "aw" #define __DEVINITDATA .section ".devinit.data", "aw"
#define __DEVINITRODATA .section ".devinit.rodata", "a"
#define __CPUINIT .section ".cpuinit.text", "ax" #define __CPUINIT .section ".cpuinit.text", "ax"
#define __CPUINITDATA .section ".cpuinit.data", "aw" #define __CPUINITDATA .section ".cpuinit.data", "aw"
#define __CPUINITRODATA .section ".cpuinit.rodata", "a"
#define __MEMINIT .section ".meminit.text", "ax" #define __MEMINIT .section ".meminit.text", "ax"
#define __MEMINITDATA .section ".meminit.data", "aw" #define __MEMINITDATA .section ".meminit.data", "aw"
#define __MEMINITRODATA .section ".meminit.rodata", "a"
/* silence warnings when references are OK */ /* silence warnings when references are OK */
#define __REF .section ".ref.text", "ax" #define __REF .section ".ref.text", "ax"
#define __REFDATA .section ".ref.data", "aw" #define __REFDATA .section ".ref.data", "aw"
#define __REFCONST .section ".ref.rodata", "aw" #define __REFCONST .section ".ref.rodata", "a"
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
/* /*
......
...@@ -82,7 +82,7 @@ modpost = scripts/mod/modpost \ ...@@ -82,7 +82,7 @@ modpost = scripts/mod/modpost \
$(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \ $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \
$(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \ $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
$(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \ $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
$(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e %,$(EXTRA_SYMBOLS))) \ $(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e %,$(KBUILD_EXTRA_SYMBOLS))) \
$(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
$(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \ $(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \
$(if $(CONFIG_MARKERS),-K $(kernelmarkersfile)) \ $(if $(CONFIG_MARKERS),-K $(kernelmarkersfile)) \
......
...@@ -113,10 +113,10 @@ EOF ...@@ -113,10 +113,10 @@ EOF
} }
syscall_list() { syscall_list() {
sed -n -e '/^\#define/ { s/[^_]*__NR_\([^[:space:]]*\).*/\ sed -n -e '/^\#define/ s/[^_]*__NR_\([^[:space:]]*\).*/\
\#if !defined \(__NR_\1\) \&\& !defined \(__IGNORE_\1\)\ \#if !defined \(__NR_\1\) \&\& !defined \(__IGNORE_\1\)\
\#warning syscall \1 not implemented\ \#warning syscall \1 not implemented\
\#endif/p }' $1 \#endif/p' $1
} }
(ignore_list && syscall_list ${srctree}/arch/x86/include/asm/unistd_32.h) | \ (ignore_list && syscall_list ${srctree}/arch/x86/include/asm/unistd_32.h) | \
......
#!/usr/bin/perl #!/usr/bin/perl -w
# #
# headers_check.pl execute a number of trivial consistency checks # headers_check.pl execute a number of trivial consistency checks
# #
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
# 2) TODO: check for leaked CONFIG_ symbols # 2) TODO: check for leaked CONFIG_ symbols
use strict; use strict;
use warnings;
my ($dir, $arch, @files) = @ARGV; my ($dir, $arch, @files) = @ARGV;
...@@ -27,14 +26,15 @@ my $lineno = 0; ...@@ -27,14 +26,15 @@ my $lineno = 0;
my $filename; my $filename;
foreach my $file (@files) { foreach my $file (@files) {
local *FH;
$filename = $file; $filename = $file;
open(my $fh, '<', "$filename") or die "$filename: $!\n"; open(FH, "<$filename") or die "$filename: $!\n";
$lineno = 0; $lineno = 0;
while ($line = <$fh>) { while ($line = <FH>) {
$lineno++; $lineno++;
check_include(); check_include();
} }
close $fh; close FH;
} }
exit $ret; exit $ret;
......
#!/usr/bin/perl #!/usr/bin/perl -w
# #
# headers_install prepare the listed header files for use in # headers_install prepare the listed header files for use in
# user space and copy the files to their destination. # user space and copy the files to their destination.
...@@ -17,28 +17,29 @@ ...@@ -17,28 +17,29 @@
# 3) Drop all sections defined out by __KERNEL__ (using unifdef) # 3) Drop all sections defined out by __KERNEL__ (using unifdef)
use strict; use strict;
use warnings;
my ($readdir, $installdir, $arch, @files) = @ARGV; my ($readdir, $installdir, $arch, @files) = @ARGV;
my $unifdef = "scripts/unifdef -U__KERNEL__"; my $unifdef = "scripts/unifdef -U__KERNEL__";
foreach my $file (@files) { foreach my $file (@files) {
local *INFILE;
local *OUTFILE;
my $tmpfile = "$installdir/$file.tmp"; my $tmpfile = "$installdir/$file.tmp";
open(my $infile, '<', "$readdir/$file") open(INFILE, "<$readdir/$file")
or die "$readdir/$file: $!\n"; or die "$readdir/$file: $!\n";
open(my $outfile, '>', "$tmpfile") or die "$tmpfile: $!\n"; open(OUTFILE, ">$tmpfile") or die "$tmpfile: $!\n";
while (my $line = <$infile>) { while (my $line = <INFILE>) {
$line =~ s/([\s(])__user\s/$1/g; $line =~ s/([\s(])__user\s/$1/g;
$line =~ s/([\s(])__force\s/$1/g; $line =~ s/([\s(])__force\s/$1/g;
$line =~ s/([\s(])__iomem\s/$1/g; $line =~ s/([\s(])__iomem\s/$1/g;
$line =~ s/\s__attribute_const__\s/ /g; $line =~ s/\s__attribute_const__\s/ /g;
$line =~ s/\s__attribute_const__$//g; $line =~ s/\s__attribute_const__$//g;
$line =~ s/^#include <linux\/compiler.h>//; $line =~ s/^#include <linux\/compiler.h>//;
printf $outfile "%s", $line; printf OUTFILE "%s", $line;
} }
close $outfile; close OUTFILE;
close $infile; close INFILE;
system $unifdef . " $tmpfile > $installdir/$file"; system $unifdef . " $tmpfile > $installdir/$file";
unlink $tmpfile; unlink $tmpfile;
} }
......
...@@ -290,6 +290,15 @@ static int parse_file(const char *fname, struct md4_ctx *md) ...@@ -290,6 +290,15 @@ static int parse_file(const char *fname, struct md4_ctx *md)
release_file(file, len); release_file(file, len);
return 1; return 1;
} }
/* Check whether the file is a static library or not */
static int is_static_library(const char *objfile)
{
int len = strlen(objfile);
if (objfile[len - 2] == '.' && objfile[len - 1] == 'a')
return 1;
else
return 0;
}
/* We have dir/file.o. Open dir/.file.o.cmd, look for deps_ line to /* We have dir/file.o. Open dir/.file.o.cmd, look for deps_ line to
* figure out source file. */ * figure out source file. */
...@@ -420,7 +429,8 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen) ...@@ -420,7 +429,8 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen)
while ((fname = strsep(&sources, " ")) != NULL) { while ((fname = strsep(&sources, " ")) != NULL) {
if (!*fname) if (!*fname)
continue; continue;
if (!parse_source_files(fname, &md)) if (!(is_static_library(fname)) &&
!parse_source_files(fname, &md))
goto release; goto release;
} }
......
...@@ -57,15 +57,17 @@ fi ...@@ -57,15 +57,17 @@ fi
echo "%build" echo "%build"
if ! $PREBUILT; then if ! $PREBUILT; then
echo "make clean && make %{_smp_mflags}" echo "make clean && make %{?_smp_mflags}"
echo "" echo ""
fi fi
echo "%install" echo "%install"
echo "%ifarch ia64" echo "%ifarch ia64"
echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules' echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules'
echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware'
echo "%else" echo "%else"
echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib/modules' echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib/modules'
echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware'
echo "%endif" echo "%endif"
echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags} modules_install' echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags} modules_install'
...@@ -92,5 +94,6 @@ echo "%files" ...@@ -92,5 +94,6 @@ echo "%files"
echo '%defattr (-, root, root)' echo '%defattr (-, root, root)'
echo "%dir /lib/modules" echo "%dir /lib/modules"
echo "/lib/modules/$KERNELRELEASE" echo "/lib/modules/$KERNELRELEASE"
echo "/lib/firmware"
echo "/boot/*" echo "/boot/*"
echo "" echo ""
...@@ -9,11 +9,13 @@ usage() { ...@@ -9,11 +9,13 @@ usage() {
cd "${1:-.}" || usage cd "${1:-.}" || usage
# Check for git and a git repo. # Check for git and a git repo.
if head=`git rev-parse --verify HEAD 2>/dev/null`; then if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
# Do we have an untagged version? # Do we have an untagged version?
if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
if tag=`git describe 2>/dev/null`; then if tag=`git describe 2>/dev/null`; then
echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
else
printf '%s%s' -g $head
fi fi
fi fi
...@@ -55,7 +57,7 @@ if rev=`svn info 2>/dev/null | grep '^Revision'`; then ...@@ -55,7 +57,7 @@ if rev=`svn info 2>/dev/null | grep '^Revision'`; then
# Are there uncommitted changes? # Are there uncommitted changes?
if [ $changes != 0 ]; then if [ $changes != 0 ]; then
printf -- '-svn%s%s%s' "$rev" -dirty "$changes" printf -- '-svn%s%s' "$rev" -dirty
else else
printf -- '-svn%s' "$rev" printf -- '-svn%s' "$rev"
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment