]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 Apr 2015 18:19:18 +0000 (11:19 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 Apr 2015 18:19:18 +0000 (11:19 -0700)
Pull kbuild updates from Michal Marek:
 "Here is the first round of kbuild changes for v4.1-rc1:

   - kallsyms fix for ARM and cleanup

   - make dep(end) removed (developers have no sense of nostalgia these
     days...)

   - include Makefiles by relative path

   - stop useless rebuilds of asm-offsets.h and bounds.h"

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  Kbuild: kallsyms: drop special handling of pre-3.0 GCC symbols
  Kbuild: kallsyms: ignore veneers emitted by the ARM linker
  kbuild: ia64: use $(src)/Makefile.gate rather than particular path
  kbuild: include $(src)/Makefile rather than $(obj)/Makefile
  kbuild: use relative path more to include Makefile
  kbuild: use relative path to include Makefile
  kbuild: do not add $(bounds-file) and $(offsets-file) to targets
  kbuild: remove warning about "make depend"
  kbuild: Don't reset timestamps in include/generated if not needed

Kbuild
Makefile
arch/arm/boot/Makefile
arch/ia64/kernel/Makefile
arch/mips/Makefile
arch/um/Makefile
arch/x86/Makefile
arch/x86/Makefile.um
scripts/Makefile.dtbinst
scripts/Makefile.fwinst
scripts/kallsyms.c

diff --git a/Kbuild b/Kbuild
index ab8ded92e870f55290d4d8283e4cbb1b849f8a58..6f0d82a9245d897c89a63819e857f474ab93066e 100644 (file)
--- a/Kbuild
+++ b/Kbuild
@@ -13,8 +13,9 @@ define sed-y
        s:->::; p;}"
 endef
 
-quiet_cmd_offsets = GEN     $@
-define cmd_offsets
+# Use filechk to avoid rebuilds when a header changes, but the resulting file
+# does not
+define filechk_offsets
        (set -e; \
         echo "#ifndef $2"; \
         echo "#define $2"; \
@@ -24,9 +25,9 @@ define cmd_offsets
         echo " * This file was generated by Kbuild"; \
         echo " */"; \
         echo ""; \
-        sed -ne $(sed-y) $<; \
+        sed -ne $(sed-y); \
         echo ""; \
-        echo "#endif" ) > $@
+        echo "#endif" )
 endef
 
 #####
@@ -35,16 +36,15 @@ endef
 bounds-file := include/generated/bounds.h
 
 always  := $(bounds-file)
-targets := $(bounds-file) kernel/bounds.s
+targets := kernel/bounds.s
 
 # We use internal kbuild rules to avoid the "is up to date" message from make
 kernel/bounds.s: kernel/bounds.c FORCE
        $(Q)mkdir -p $(dir $@)
        $(call if_changed_dep,cc_s_c)
 
-$(obj)/$(bounds-file): kernel/bounds.s Kbuild
-       $(Q)mkdir -p $(dir $@)
-       $(call cmd,offsets,__LINUX_BOUNDS_H__)
+$(obj)/$(bounds-file): kernel/bounds.s FORCE
+       $(call filechk,offsets,__LINUX_BOUNDS_H__)
 
 #####
 # 2) Generate asm-offsets.h
@@ -53,7 +53,6 @@ $(obj)/$(bounds-file): kernel/bounds.s Kbuild
 offsets-file := include/generated/asm-offsets.h
 
 always  += $(offsets-file)
-targets += $(offsets-file)
 targets += arch/$(SRCARCH)/kernel/asm-offsets.s
 
 # We use internal kbuild rules to avoid the "is up to date" message from make
@@ -62,8 +61,8 @@ arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \
        $(Q)mkdir -p $(dir $@)
        $(call if_changed_dep,cc_s_c)
 
-$(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild
-       $(call cmd,offsets,__ASM_OFFSETS_H__)
+$(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
+       $(call filechk,offsets,__ASM_OFFSETS_H__)
 
 #####
 # 3) Check for missing system calls
index 9b76ce1e08bbb80d15e3f2ee4859157323a23ee0..6cc5b243422459cb3ec4317274ebc26c69e0e595 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,9 +10,10 @@ NAME = Hurr durr I'ma sheep
 # Comments in this file are targeted only to the developer, do not
 # expect to learn how to build the kernel reading this file.
 
-# Do not use make's built-in rules and variables
-# (this increases performance and avoids hard-to-debug behaviour);
-MAKEFLAGS += -rR
+# o Do not use make's built-in rules and variables
+#   (this increases performance and avoids hard-to-debug behaviour);
+# o Look for make include files relative to root of kernel src
+MAKEFLAGS += -rR --include-dir=$(CURDIR)
 
 # Avoid funny character set dependencies
 unexport LC_ALL
@@ -344,12 +345,9 @@ endif
 export COMPILER
 endif
 
-# Look for make include files relative to root of kernel src
-MAKEFLAGS += --include-dir=$(srctree)
-
 # We need some generic definitions (do not try to remake the file).
-$(srctree)/scripts/Kbuild.include: ;
-include $(srctree)/scripts/Kbuild.include
+scripts/Kbuild.include: ;
+include scripts/Kbuild.include
 
 # Make variables (CC, etc...)
 AS             = $(CROSS_COMPILE)as
@@ -533,7 +531,7 @@ ifeq ($(config-targets),1)
 # Read arch specific Makefile to set KBUILD_DEFCONFIG as needed.
 # KBUILD_DEFCONFIG may point out an alternative default configuration
 # used for 'make defconfig'
-include $(srctree)/arch/$(SRCARCH)/Makefile
+include arch/$(SRCARCH)/Makefile
 export KBUILD_DEFCONFIG KBUILD_KCONFIG
 
 config: scripts_basic outputmakefile FORCE
@@ -609,7 +607,7 @@ endif # $(dot-config)
 # Defaults to vmlinux, but the arch makefile usually adds further targets
 all: vmlinux
 
-include $(srctree)/arch/$(SRCARCH)/Makefile
+include arch/$(SRCARCH)/Makefile
 
 KBUILD_CFLAGS  += $(call cc-option,-fno-delete-null-pointer-checks,)
 
@@ -782,8 +780,8 @@ ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y)
        KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO
 endif
 
-include $(srctree)/scripts/Makefile.kasan
-include $(srctree)/scripts/Makefile.extrawarn
+include scripts/Makefile.kasan
+include scripts/Makefile.extrawarn
 
 # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
 KBUILD_CPPFLAGS += $(KCPPFLAGS)
@@ -1026,12 +1024,6 @@ headerdep:
        $(Q)find $(srctree)/include/ -name '*.h' | xargs --max-args 1 \
        $(srctree)/scripts/headerdep.pl -I$(srctree)/include
 
-# ---------------------------------------------------------------------------
-
-PHONY += depend dep
-depend dep:
-       @echo '*** Warning: make $@ is unnecessary now.'
-
 # ---------------------------------------------------------------------------
 # Firmware install
 INSTALL_FW_PATH=$(INSTALL_MOD_PATH)/lib/firmware
index ec2f8065f955c5c31a69888bf261c58ea56ffb6d..9eca7aee927f3081975d7372a66a358565c33c56 100644 (file)
@@ -12,7 +12,7 @@
 #
 
 ifneq ($(MACHINE),)
-include $(srctree)/$(MACHINE)/Makefile.boot
+include $(MACHINE)/Makefile.boot
 endif
 
 # Note: the following conditions must always be true:
index 20678a9ed11a83081083b2aca0ac8bd84b5b9fcb..d68b5cf81e3177c20df6af7d95bb4ce08171b43a 100644 (file)
@@ -51,7 +51,7 @@ obj-$(CONFIG_BINFMT_ELF)      += elfcore.o
 CFLAGS_traps.o  += -mfixed-range=f2-f5,f16-f31
 
 # The gate DSO image is built using a special linker script.
-include $(srctree)/arch/ia64/kernel/Makefile.gate
+include $(src)/Makefile.gate
 # tell compiled for native
 CPPFLAGS_gate.lds += -D__IA64_GATE_PARAVIRTUALIZED_NATIVE
 
index 8f57fc72d62c8334d35e91ca48f1aa6ead7d08d4..d152dfbc360dcf0d58e0b2ea0aa3572440583d70 100644 (file)
@@ -225,7 +225,7 @@ endif
 #
 # Board-dependent options and extra files
 #
-include $(srctree)/arch/mips/Kbuild.platforms
+include arch/mips/Kbuild.platforms
 
 ifdef CONFIG_PHYSICAL_START
 load-y                                 = $(CONFIG_PHYSICAL_START)
index e4b1a9639c4ddfab7db3d91a080272b9c00fdba8..17d4460b1af3aeb1f5071c6c34bd452fd4da5952 100644 (file)
@@ -43,8 +43,8 @@ endif
 
 HOST_DIR := arch/$(HEADER_ARCH)
 
-include $(srctree)/$(ARCH_DIR)/Makefile-skas
-include $(srctree)/$(HOST_DIR)/Makefile.um
+include $(ARCH_DIR)/Makefile-skas
+include $(HOST_DIR)/Makefile.um
 
 core-y += $(HOST_DIR)/um/
 
@@ -73,7 +73,7 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
        $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include
 
 #This will adjust *FLAGS accordingly to the platform.
-include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
+include $(ARCH_DIR)/Makefile-os-$(OS)
 
 KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include \
                   -I$(srctree)/$(HOST_DIR)/include/uapi \
index 5ba2d9ce82dcb8f72d5184004756c1d917e8a3fe..2fda005bb33443c1684546dff0620f8db48e7c5c 100644 (file)
@@ -63,7 +63,7 @@ ifeq ($(CONFIG_X86_32),y)
                                $(call cc-option,-fno-unit-at-a-time))
 
         # CPU-specific tuning. Anything which can be shared with UML should go here.
-        include $(srctree)/arch/x86/Makefile_32.cpu
+        include arch/x86/Makefile_32.cpu
         KBUILD_CFLAGS += $(cflags-y)
 
         # temporary until string.h is fixed
index 95eba554baf9856f515d30150e66a5333ee04e18..5b7e898ffd9ab8d6db4c13282a4beb328012cb46 100644 (file)
@@ -18,7 +18,7 @@ LDS_EXTRA             := -Ui386
 export LDS_EXTRA
 
 # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y.
-include $(srctree)/arch/x86/Makefile_32.cpu
+include arch/x86/Makefile_32.cpu
 
 # prevent gcc from keeping the stack 16 byte aligned. Taken from i386.
 cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
index 909ed7a2ac61142371ee4c19f10096f3a1a07c46..1c15717e0d5686972c1130fb718d0bc445c08dad 100644 (file)
@@ -18,7 +18,7 @@ export dtbinst-root ?= $(obj)
 
 include include/config/auto.conf
 include scripts/Kbuild.include
-include $(srctree)/$(obj)/Makefile
+include $(src)/Makefile
 
 PHONY += __dtbs_install_prep
 __dtbs_install_prep:
index 5b698add4f31ca634a273ae890cf52471ce85537..b2729003525323975e33b3e57cc11274ab52085b 100644 (file)
@@ -13,7 +13,7 @@ src := $(obj)
 -include $(objtree)/.config
 
 include scripts/Kbuild.include
-include $(srctree)/$(obj)/Makefile
+include $(src)/Makefile
 
 include scripts/Makefile.host
 
index c6d33bd15b04acd0ea4fd56d59289d8e983a1c9f..8fa81e84e29510c053e5e52cefc5eb9e1da16887 100644 (file)
@@ -212,15 +212,22 @@ static int symbol_valid(struct sym_entry *s)
                "_SDA_BASE_",           /* ppc */
                "_SDA2_BASE_",          /* ppc */
                NULL };
+
+       static char *special_suffixes[] = {
+               "_veneer",              /* arm */
+               NULL };
+
        int i;
-       int offset = 1;
+       char *sym_name = (char *)s->sym + 1;
+
 
        if (s->addr < kernel_start_addr)
                return 0;
 
        /* skip prefix char */
-       if (symbol_prefix_char && *(s->sym + 1) == symbol_prefix_char)
-               offset++;
+       if (symbol_prefix_char && *sym_name == symbol_prefix_char)
+               sym_name++;
+
 
        /* if --all-symbols is not specified, then symbols outside the text
         * and inittext sections are discarded */
@@ -235,22 +242,26 @@ static int symbol_valid(struct sym_entry *s)
                 * rules.
                 */
                if ((s->addr == text_range_text->end &&
-                               strcmp((char *)s->sym + offset,
+                               strcmp(sym_name,
                                       text_range_text->end_sym)) ||
                    (s->addr == text_range_inittext->end &&
-                               strcmp((char *)s->sym + offset,
+                               strcmp(sym_name,
                                       text_range_inittext->end_sym)))
                        return 0;
        }
 
        /* Exclude symbols which vary between passes. */
-       if (strstr((char *)s->sym + offset, "_compiled."))
-               return 0;
-
        for (i = 0; special_symbols[i]; i++)
-               if( strcmp((char *)s->sym + offset, special_symbols[i]) == 0 )
+               if (strcmp(sym_name, special_symbols[i]) == 0)
                        return 0;
 
+       for (i = 0; special_suffixes[i]; i++) {
+               int l = strlen(sym_name) - strlen(special_suffixes[i]);
+
+               if (l >= 0 && strcmp(sym_name + l, special_suffixes[i]) == 0)
+                       return 0;
+       }
+
        return 1;
 }