Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 13 Apr 2014 01:22:27 +0000 (18:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 13 Apr 2014 01:22:27 +0000 (18:22 -0700)
Pull misc kbuild changes from Michal Marek:
 "Here is the non-critical part of kbuild:
   - One bogus coccinelle check removed, one check fixed not to suggest
     the obsolete PTR_RET macro
   - scripts/tags.sh does not index the generated *.mod.c files
   - new objdiff tool to list differences between two versions of an
     object file
   - A fix for scripts/bootgraph.pl"

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  scripts/coccinelle: Use PTR_ERR_OR_ZERO
  scripts/bootgraph.pl: Add graphic header
  scripts: objdiff: detect object code changes between two commits
  Coccicheck: Remove memcpy to struct assignment test
  scripts/tags.sh: Ignore *.mod.c

1  2 
Makefile

diff --combined Makefile
index 10812e495e8df7e3fcbf976e3dfd59dcee3a22a2,c68c23fe31b911b4c1433ecad15dfa21ff3a771a..e709613d68e5634bf82ab4c7977499b26cd5d1d2
+++ b/Makefile
@@@ -1,7 -1,7 +1,7 @@@
  VERSION = 3
  PATCHLEVEL = 14
  SUBLEVEL = 0
 -EXTRAVERSION = -rc1
 +EXTRAVERSION =
  NAME = Shuffling Zombie Juror
  
  # *DOCUMENTATION*
@@@ -120,10 -120,9 +120,10 @@@ ifneq ($(KBUILD_OUTPUT),
  # Invoke a second make in the output directory, passing relevant variables
  # check that the output directory actually exists
  saved-output := $(KBUILD_OUTPUT)
 -KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
 +KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
 +                                                              && /bin/pwd)
  $(if $(KBUILD_OUTPUT),, \
 -     $(error output directory "$(saved-output)" does not exist))
 +     $(error failed to create output directory "$(saved-output)"))
  
  PHONY += $(MAKECMDGOALS) sub-make
  
@@@ -248,11 -247,6 +248,11 @@@ HOSTCXX      = g+
  HOSTCFLAGS   = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
  HOSTCXXFLAGS = -O2
  
 +ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
 +HOSTCFLAGS  += -Wno-unused-value -Wno-unused-parameter \
 +              -Wno-missing-field-initializers -fno-delete-null-pointer-checks
 +endif
 +
  # Decide whether to build built-in, modular, or both.
  # Normally, just do built-in.
  
@@@ -329,14 -323,6 +329,14 @@@ endi
  
  export quiet Q KBUILD_VERBOSE
  
 +ifneq ($(CC),)
 +ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
 +COMPILER := clang
 +else
 +COMPILER := gcc
 +endif
 +export COMPILER
 +endif
  
  # Look for make include files relative to root of kernel src
  MAKEFLAGS += --include-dir=$(srctree)
@@@ -396,7 -382,7 +396,7 @@@ KBUILD_CFLAGS   := -Wall -Wundef -Wstri
                   -fno-strict-aliasing -fno-common \
                   -Werror-implicit-function-declaration \
                   -Wno-format-security \
 -                 -fno-delete-null-pointer-checks
 +                 $(call cc-option,-fno-delete-null-pointer-checks,)
  KBUILD_AFLAGS_KERNEL :=
  KBUILD_CFLAGS_KERNEL :=
  KBUILD_AFLAGS   := -D__ASSEMBLY__
@@@ -428,8 -414,9 +428,9 @@@ export MODVERDIR := $(if $(KBUILD_EXTMO
  
  # Files to ignore in find ... statements
  
- RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
-                  -o -name .pc -o -name .hg -o -name .git \) -prune -o
+ export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o    \
+                         -name CVS -o -name .pc -o -name .hg -o -name .git \) \
+                         -prune -o
  export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
                         --exclude CVS --exclude .pc --exclude .hg --exclude .git
  
@@@ -619,11 -606,10 +620,11 @@@ endi
  ifdef CONFIG_CC_STACKPROTECTOR_REGULAR
    stackp-flag := -fstack-protector
    ifeq ($(call cc-option, $(stackp-flag)),)
 -    $(warning Cannot use CONFIG_CC_STACKPROTECTOR: \
 -            -fstack-protector not supported by compiler))
 +    $(warning Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: \
 +             -fstack-protector not supported by compiler)
    endif
 -else ifdef CONFIG_CC_STACKPROTECTOR_STRONG
 +else
 +ifdef CONFIG_CC_STACKPROTECTOR_STRONG
    stackp-flag := -fstack-protector-strong
    ifeq ($(call cc-option, $(stackp-flag)),)
      $(warning Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: \
@@@ -633,27 -619,11 +634,27 @@@ els
    # Force off for distro compilers that enable stack protector by default.
    stackp-flag := $(call cc-option, -fno-stack-protector)
  endif
 +endif
  KBUILD_CFLAGS += $(stackp-flag)
  
 +ifeq ($(COMPILER),clang)
 +KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
 +KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,)
 +KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
 +KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
 +KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
 +# Quiet clang warning: comparison of unsigned expression < 0 is always false
 +KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
 +# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
 +# source of a reference will be _MergedGlobals and not on of the whitelisted names.
 +# See modpost pattern 2
 +KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
 +else
 +
  # This warning generated too much noise in a regular build.
  # Use make W=1 to enable this warning (see scripts/Makefile.build)
  KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
 +endif
  
  ifdef CONFIG_FRAME_POINTER
  KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
@@@ -757,13 -727,6 +758,13 @@@ export KBUILD_IMAGE ?= vmlinu
  # images. Default is /boot, but you can set it to other values
  export        INSTALL_PATH ?= /boot
  
 +#
 +# INSTALL_DTBS_PATH specifies a prefix for relocations required by build roots.
 +# Like INSTALL_MOD_PATH, it isn't defined in the Makefile, but can be passed as
 +# an argument if needed. Otherwise it defaults to the kernel install path
 +#
 +export INSTALL_DTBS_PATH ?= $(INSTALL_PATH)/dtbs/$(KERNELRELEASE)
 +
  #
  # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
  # relocations required by build roots.  This is not defined in the
@@@ -1103,12 -1066,12 +1104,12 @@@ CLEAN_DIRS  += $(MODVERDIR
  
  # Directories & files removed with 'make mrproper'
  MRPROPER_DIRS  += include/config usr/include include/generated          \
-                   arch/*/include/generated
+                   arch/*/include/generated .tmp_objdiff
  MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \
                  Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
                  signing_key.priv signing_key.x509 x509.genkey         \
                  extra_certificates signing_key.x509.keyid             \
 -                signing_key.x509.signer
 +                signing_key.x509.signer include/linux/version.h
  
  # clean - Delete most, but leave enough to build external modules
  #
@@@ -1147,7 -1110,8 +1148,7 @@@ distclean: mrprope
        @find $(srctree) $(RCS_FIND_IGNORE) \
                \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
                -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
 -              -o -name '.*.rej' \
 -              -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
 +              -o -name '.*.rej' -o -name '*%'  -o -name 'core' \) \
                -type f -print | xargs rm -f