Commit e965b8ce authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

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
parents a95cb3cd 50ab9a69
...@@ -335,15 +335,6 @@ endif ...@@ -335,15 +335,6 @@ endif
export KBUILD_MODULES KBUILD_BUILTIN export KBUILD_MODULES KBUILD_BUILTIN
export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD 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). # We need some generic definitions (do not try to remake the file).
scripts/Kbuild.include: ; scripts/Kbuild.include: ;
include scripts/Kbuild.include include scripts/Kbuild.include
...@@ -670,6 +661,13 @@ endif ...@@ -670,6 +661,13 @@ endif
endif endif
KBUILD_CFLAGS += $(stackp-flag) 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) ifeq ($(COMPILER),clang)
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,) KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,)
......
...@@ -45,6 +45,9 @@ CFLAGS_kobject.o += -DDEBUG ...@@ -45,6 +45,9 @@ CFLAGS_kobject.o += -DDEBUG
CFLAGS_kobject_uevent.o += -DDEBUG CFLAGS_kobject_uevent.o += -DDEBUG
endif 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_IOMAP) += iomap.o
obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o
obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o
......
/*
* 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>
...@@ -82,7 +82,7 @@ kallsyms() ...@@ -82,7 +82,7 @@ kallsyms()
kallsymopt="${kallsymopt} --all-symbols" kallsymopt="${kallsymopt} --all-symbols"
fi 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" kallsymopt="${kallsymopt} --page-offset=$CONFIG_PAGE_OFFSET"
fi fi
...@@ -111,7 +111,6 @@ sortextable() ...@@ -111,7 +111,6 @@ sortextable()
} }
# Delete output files in case of error # Delete output files in case of error
trap cleanup SIGHUP SIGINT SIGQUIT SIGTERM ERR
cleanup() cleanup()
{ {
rm -f .old_version rm -f .old_version
...@@ -124,6 +123,20 @@ cleanup() ...@@ -124,6 +123,20 @@ cleanup()
rm -f vmlinux.o 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 # Use "make V=1" to debug this script
...@@ -231,7 +244,6 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then ...@@ -231,7 +244,6 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then
if ! cmp -s System.map .tmp_System.map; then if ! cmp -s System.map .tmp_System.map; then
echo >&2 Inconsistent kallsyms data echo >&2 Inconsistent kallsyms data
echo >&2 Try "make KALLSYMS_EXTRA_PASS=1" as a workaround echo >&2 Try "make KALLSYMS_EXTRA_PASS=1" as a workaround
cleanup
exit 1 exit 1
fi fi
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