]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 2 Jul 2015 21:58:12 +0000 (14:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 2 Jul 2015 21:58:12 +0000 (14:58 -0700)
Pull kbuild updates from Michal Marek:
 "Just a few kbuild core commits this time:

   - kallsyms fix for CONFIG_XIP_KERNEL

   - bashisms in scripts/link-vmlinux.sh fixed

   - workaround to make DEBUG_INFO_REDUCED more useful yet still space
     efficient

   - clang is not wrongly detected when cross-compiling"

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kbuild: include core debug info when DEBUG_INFO_REDUCED
  scripts: link-vmlinux: Don't pass page offset to kallsyms if XIP Kernel
  scripts: fix link-vmlinux.sh bash-ism
  Makefile: Fix detection of clang when cross-compiling

Makefile
lib/Makefile
lib/debug_info.c [new file with mode: 0644]
scripts/link-vmlinux.sh

index 6c6f14628f329d0ba10f5632fb362c818c437ff5..26ac0281bc74e9bd8a4a4aab1c7c7a0c19d4436c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -335,15 +335,6 @@ endif
 export KBUILD_MODULES KBUILD_BUILTIN
 export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD
 
-ifneq ($(CC),)
-ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
-COMPILER := clang
-else
-COMPILER := gcc
-endif
-export COMPILER
-endif
-
 # We need some generic definitions (do not try to remake the file).
 scripts/Kbuild.include: ;
 include scripts/Kbuild.include
@@ -670,6 +661,13 @@ endif
 endif
 KBUILD_CFLAGS += $(stackp-flag)
 
+ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
+COMPILER := clang
+else
+COMPILER := gcc
+endif
+export COMPILER
+
 ifeq ($(COMPILER),clang)
 KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
 KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,)
index ff37c8c2f7b24fbaa0bb6e04faa8aef5edd3dbbc..6897b527581a8d9fcb65b4a2e01815d3d34498ed 100644 (file)
@@ -45,6 +45,9 @@ CFLAGS_kobject.o += -DDEBUG
 CFLAGS_kobject_uevent.o += -DDEBUG
 endif
 
+obj-$(CONFIG_DEBUG_INFO_REDUCED) += debug_info.o
+CFLAGS_debug_info.o += $(call cc-option, -femit-struct-debug-detailed=any)
+
 obj-$(CONFIG_GENERIC_IOMAP) += iomap.o
 obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o
 obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o
diff --git a/lib/debug_info.c b/lib/debug_info.c
new file mode 100644 (file)
index 0000000..2edbe27
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * This file exists solely to ensure debug information for some core
+ * data structures is included in the final image even for
+ * CONFIG_DEBUG_INFO_REDUCED. Please do not add actual code. However,
+ * adding appropriate #includes is fine.
+ */
+#include <stdarg.h>
+
+#include <linux/cred.h>
+#include <linux/crypto.h>
+#include <linux/dcache.h>
+#include <linux/device.h>
+#include <linux/fs.h>
+#include <linux/fscache-cache.h>
+#include <linux/io.h>
+#include <linux/kallsyms.h>
+#include <linux/kernel.h>
+#include <linux/kobject.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/net.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/types.h>
+#include <net/addrconf.h>
+#include <net/sock.h>
+#include <net/tcp.h>
index 86a4fe75f453735936e3b218f885dcd887216659..1a10d8ac81620faad519d4f95ca8552ac4a958c1 100755 (executable)
@@ -82,7 +82,7 @@ kallsyms()
                kallsymopt="${kallsymopt} --all-symbols"
        fi
 
-       if [ -n "${CONFIG_ARM}" ] && [ -n "${CONFIG_PAGE_OFFSET}" ]; then
+       if [ -n "${CONFIG_ARM}" ] && [ -z "${CONFIG_XIP_KERNEL}" ] && [ -n "${CONFIG_PAGE_OFFSET}" ]; then
                kallsymopt="${kallsymopt} --page-offset=$CONFIG_PAGE_OFFSET"
        fi
 
@@ -111,7 +111,6 @@ sortextable()
 }
 
 # Delete output files in case of error
-trap cleanup SIGHUP SIGINT SIGQUIT SIGTERM ERR
 cleanup()
 {
        rm -f .old_version
@@ -124,6 +123,20 @@ cleanup()
        rm -f vmlinux.o
 }
 
+on_exit()
+{
+       if [ $? -ne 0 ]; then
+               cleanup
+       fi
+}
+trap on_exit EXIT
+
+on_signals()
+{
+       exit 1
+}
+trap on_signals HUP INT QUIT TERM
+
 #
 #
 # Use "make V=1" to debug this script
@@ -231,7 +244,6 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then
        if ! cmp -s System.map .tmp_System.map; then
                echo >&2 Inconsistent kallsyms data
                echo >&2 Try "make KALLSYMS_EXTRA_PASS=1" as a workaround
-               cleanup
                exit 1
        fi
 fi