Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 27 Feb 2013 20:25:47 +0000 (12:25 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 27 Feb 2013 20:25:47 +0000 (12:25 -0800)
Pull kbuild changes from Michal Marek:

 - Alias generation in modpost is cross-compile safe.

 - kernel/timeconst.h is now generated using a bc script instead of
   perl.

 - scripts/link-vmlinux.sh now works with an alternative
   $KCONFIG_CONFIG.

 - destination-y for exported headers is supported in Kbuild files
   again.

 - depmod is called with -P $CONFIG_SYMBOL_PREFIX on architectures that
   need it.

 - CONFIG_DEBUG_INFO_REDUCED disables var-tracking

 - scripts/setlocalversion works with too much translated locales ;)

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kbuild: Fix reading of .config in link-vmlinux.sh
  kbuild: Unset language specific variables in setlocalversion script
  Kbuild: Disable var tracking with CONFIG_DEBUG_INFO_REDUCED
  depmod: pass -P $CONFIG_SYMBOL_PREFIX
  kbuild: Fix destination-y for installed headers
  scripts/link-vmlinux.sh: source variables from KCONFIG_CONFIG
  kernel: Replace timeconst.pl with a bc script
  mod/file2alias: make modalias generation safe for cross compiling

1  2 
Makefile
kernel/Makefile
scripts/mod/modpost.c

diff --combined Makefile
+++ b/Makefile
@@@ -1,8 -1,8 +1,8 @@@
  VERSION = 3
  PATCHLEVEL = 8
  SUBLEVEL = 0
 -EXTRAVERSION = -rc1
 -NAME = Terrified Chipmunk
 +EXTRAVERSION =
 +NAME = Unicycling Gorilla
  
  # *DOCUMENTATION*
  # To see a list of typical targets execute "make help"
@@@ -165,12 -165,11 +165,12 @@@ export srctree objtree VPAT
  # then ARCH is assigned, getting whatever value it gets normally, and 
  # SUBARCH is subsequently ignored.
  
 -SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
 +SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
 +                                -e s/sun4u/sparc64/ \
                                  -e s/arm.*/arm/ -e s/sa110/arm/ \
                                  -e s/s390x/s390/ -e s/parisc64/parisc/ \
                                  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
 -                                -e s/sh[234].*/sh/ )
 +                                -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ )
  
  # Cross compiling and selecting different set of gcc/bin-utils
  # ---------------------------------------------------------------------------
  # "make" in the configured kernel build directory always uses that.
  # Default value for CROSS_COMPILE is not to prefix executables
  # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
- export KBUILD_BUILDHOST := $(SUBARCH)
  ARCH          ?= $(SUBARCH)
  CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
  
@@@ -620,7 -618,8 +619,8 @@@ KBUILD_AFLAGS      += -gdwarf-
  endif
  
  ifdef CONFIG_DEBUG_INFO_REDUCED
- KBUILD_CFLAGS         += $(call cc-option, -femit-struct-debug-baseonly)
+ KBUILD_CFLAGS         += $(call cc-option, -femit-struct-debug-baseonly) \
+                  $(call cc-option,-fno-var-tracking)
  endif
  
  ifdef CONFIG_FUNCTION_TRACER
@@@ -720,11 -719,11 +720,11 @@@ endif # INSTALL_MOD_STRI
  export mod_strip_cmd
  
  
 -ifeq ($(CONFIG_MODULE_SIG),y)
 +ifdef CONFIG_MODULE_SIG_ALL
  MODSECKEY = ./signing_key.priv
  MODPUBKEY = ./signing_key.x509
  export MODPUBKEY
 -mod_sign_cmd = perl $(srctree)/scripts/sign-file $(MODSECKEY) $(MODPUBKEY)
 +mod_sign_cmd = perl $(srctree)/scripts/sign-file $(CONFIG_MODULE_SIG_HASH) $(MODSECKEY) $(MODPUBKEY)
  else
  mod_sign_cmd = true
  endif
@@@ -1398,7 -1397,7 +1398,7 @@@ quiet_cmd_rmfiles = $(if $(wildcard $(r
  # Run depmod only if we have System.map and depmod is executable
  quiet_cmd_depmod = DEPMOD  $(KERNELRELEASE)
        cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \
-                    $(KERNELRELEASE)
+                    $(KERNELRELEASE) "$(patsubst "%",%,$(CONFIG_SYMBOL_PREFIX))"
  
  # Create temporary dir for module support files
  # clean it up only when building all modules
diff --combined kernel/Makefile
@@@ -127,11 -127,19 +127,19 @@@ $(obj)/config_data.h: $(obj)/config_dat
  
  $(obj)/time.o: $(obj)/timeconst.h
  
- quiet_cmd_timeconst  = TIMEC   $@
-       cmd_timeconst  = $(PERL) $< $(CONFIG_HZ) > $@
+ quiet_cmd_hzfile = HZFILE  $@
+       cmd_hzfile = echo "hz=$(CONFIG_HZ)" > $@
+ targets += hz.bc
+ $(obj)/hz.bc: $(objtree)/include/config/hz.h FORCE
+       $(call if_changed,hzfile)
+ quiet_cmd_bc  = BC      $@
+       cmd_bc  = bc -q $(filter-out FORCE,$^) > $@
  targets += timeconst.h
- $(obj)/timeconst.h: $(src)/timeconst.pl FORCE
-       $(call if_changed,timeconst)
+ $(obj)/timeconst.h: $(obj)/hz.bc $(src)/timeconst.bc FORCE
+       $(call if_changed,bc)
  
  ifeq ($(CONFIG_MODULE_SIG),y)
  #
@@@ -153,7 -161,23 +161,7 @@@ kernel/modsign_certificate.o: signing_k
  # fail and that the kernel may be used afterwards.
  #
  ###############################################################################
 -sign_key_with_hash :=
 -ifeq ($(CONFIG_MODULE_SIG_SHA1),y)
 -sign_key_with_hash := -sha1
 -endif
 -ifeq ($(CONFIG_MODULE_SIG_SHA224),y)
 -sign_key_with_hash := -sha224
 -endif
 -ifeq ($(CONFIG_MODULE_SIG_SHA256),y)
 -sign_key_with_hash := -sha256
 -endif
 -ifeq ($(CONFIG_MODULE_SIG_SHA384),y)
 -sign_key_with_hash := -sha384
 -endif
 -ifeq ($(CONFIG_MODULE_SIG_SHA512),y)
 -sign_key_with_hash := -sha512
 -endif
 -ifeq ($(sign_key_with_hash),)
 +ifndef CONFIG_MODULE_SIG_HASH
  $(error Could not determine digest type to use from kernel config)
  endif
  
@@@ -166,8 -190,8 +174,8 @@@ signing_key.priv signing_key.x509: x509
        @echo "### needs to be run as root, and uses a hardware random"
        @echo "### number generator if one is available."
        @echo "###"
 -      openssl req -new -nodes -utf8 $(sign_key_with_hash) -days 36500 -batch \
 -              -x509 -config x509.genkey \
 +      openssl req -new -nodes -utf8 -$(CONFIG_MODULE_SIG_HASH) -days 36500 \
 +              -batch -x509 -config x509.genkey \
                -outform DER -out signing_key.x509 \
                -keyout signing_key.priv
        @echo "###"
diff --combined scripts/mod/modpost.c
@@@ -830,8 -830,6 +830,8 @@@ static const char *section_white_list[
        ".toc*",
        ".xt.prop",                              /* xtensa */
        ".xt.lit",         /* xtensa */
 +      ".arcextmap*",                  /* arc */
 +      ".gnu.linkonce.arcext*",        /* arc : modules */
        NULL
  };
  
@@@ -2128,7 -2126,7 +2128,7 @@@ int main(int argc, char **argv
        struct ext_sym_list *extsym_iter;
        struct ext_sym_list *extsym_start = NULL;
  
-       while ((opt = getopt(argc, argv, "i:I:e:cmsSo:awM:K:")) != -1) {
+       while ((opt = getopt(argc, argv, "i:I:e:msSo:awM:K:")) != -1) {
                switch (opt) {
                case 'i':
                        kernel_read = optarg;
                        module_read = optarg;
                        external_module = 1;
                        break;
-               case 'c':
-                       cross_build = 1;
-                       break;
                case 'e':
                        external_module = 1;
                        extsym_iter =