From c8447161470d0292cc96b4f28f03a8eedb7806e9 Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Thu, 3 Jun 2010 10:54:58 +0200 Subject: Makefile: clarify a comment os user writes: From the last comment, arch makefile will override vmlinux. It seems vmlinux will not be checked by `make'. But from my test, although `all:' will be re-defined in arch Makefile (ARM arch), vmlinux will still be checked and the commands associated will be executed. Should we use another word instead of "overridden"? Reported-by: os user Signed-off-by: Michal Marek --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ea5f0be..46040e8 100644 --- a/Makefile +++ b/Makefile @@ -526,7 +526,7 @@ endif # $(dot-config) # The all: target is the default when no target is given on the # command line. # This allow a user to issue only 'make' to build a kernel including modules -# Defaults vmlinux but it is usually overridden in the arch makefile +# Defaults to vmlinux, but the arch makefile usually adds further targets all: vmlinux ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE -- cgit v1.1 From 8e5564e6c7554902301543e731354ad2ad58ae53 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Mon, 31 May 2010 11:13:21 -0300 Subject: perf tools: Make target to generate self contained source tarball MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Useful for when people want to try some version of the perf tools and don't wants to download the kernel tarball. Here is a session using this new target: [root@emilia linux-2.6-tip]# make help | grep -i perf perf-tar-src-pkg - Build perf-2.6.35-rc1.tar source tarball perf-targz-src-pkg - Build perf-2.6.35-rc1.tar.gz source tarball perf-tarbz2-src-pkg - Build perf-2.6.35-rc1.tar.bz2 source tarball [root@emilia linux-2.6-tip]# make perf-tarbz2-src-pkg TAR [root@emilia linux-2.6-tip]# ls -la perf-2.6.35-rc1.tar.bz2 -rw-r--r-- 1 root root 295731 May 31 11:18 perf-2.6.35-rc1.tar.bz2 [root@emilia linux-2.6-tip]# tar xf perf-2.6.35-rc1.tar.bz2 [root@emilia linux-2.6-tip]# cd perf-2.6.35-rc1 [root@emilia perf-2.6.35-rc1]# ls arch HEAD include lib tools [root@emilia perf-2.6.35-rc1]# cd tools/perf [root@emilia perf]# make -j9 2>&1 | tail CC arch/x86/util/dwarf-regs.o CC util/probe-finder.o CC util/newt.o CC util/scripting-engines/trace-event-perl.o CC scripts/perl/Perf-Trace-Util/Context.o CC perf.o CC builtin-help.o AR libperf.a LINK perf rm .perf.dev.null [root@emilia perf]# ./perf record -a sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.262 MB perf.data (~11457 samples) ] [root@emilia perf]# ./perf report | head -12 # Events: 6K cycles # # Overhead Command Shared Object Symbol # ........ ............... .................. ...... # 4.73% perf [kernel.kallsyms] [k] format_decode 4.49% perf libc-2.12.so [.] _IO_file_underflow_internal 4.38% init [kernel.kallsyms] [k] mwait_idle 3.29% perf [kernel.kallsyms] [k] vsnprintf 2.38% init [kernel.kallsyms] [k] sched_clock_local 2.35% init [kernel.kallsyms] [k] apic_timer_interrupt 1.86% sirq-timer/5 [kernel.kallsyms] [k] find_busiest_group [root@emilia perf]# Acked-by: Michal Marek Acked-by: Sam Ravnborg Cc: David S. Miller Cc: Frédéric Weisbecker Cc: Ingo Molnar Cc: Michal Marek Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Sam Ravnborg Cc: Stephane Eranian Cc: Tom Zanussi LKML-Reference: <20100528185357.GA28009@ghostprotocols.net> Signed-off-by: Arnaldo Carvalho de Melo --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 6e39ec7..0ab0c6f3 100644 --- a/Makefile +++ b/Makefile @@ -411,7 +411,7 @@ endif no-dot-config-targets := clean mrproper distclean \ cscope TAGS tags help %docs check% \ include/linux/version.h headers_% \ - kernelrelease kernelversion + kernelrelease kernelversion %src-pkg config-targets := 0 mixed-targets := 0 -- cgit v1.1 From bafb67470b294810f62db40b348643062255702b Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Mon, 7 Jun 2010 07:44:25 -0300 Subject: perf tools: Allow building perf source tarballs on non-configured tree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So that we don't require that the kernel be configured first, and as we don't use KERNELRELEASE at all in the -src-pkg targets, we need o add a new wildcard for targets ending in src-pkg: On a make mrproper'ed kernel we get this without this patch: [linux-2.6-tip]$ LANG= make perf-tarbz2-src-pkg /bin/sh: include/config/kernel.release: No such file or directory make: *** [include/config/kernel.release] Error 1 [acme@emilia linux-2.6-tip]$ Acked-by: Michal Marek Cc: Eduardo Habkost Cc: David S. Miller Cc: Frédéric Weisbecker Cc: Ingo Molnar Cc: Michal Marek Cc: Mike Galbraith Cc: Paul Mackerras Cc: Sam Ravnborg Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Tom Zanussi LKML-Reference: <20100604173552.GA875@ghostprotocols.net> Signed-off-by: Arnaldo Carvalho de Melo --- Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0ab0c6f3..6e186a1 100644 --- a/Makefile +++ b/Makefile @@ -1215,6 +1215,8 @@ distclean: mrproper # rpm target kept for backward compatibility package-dir := $(srctree)/scripts/package +%src-pkg: FORCE + $(Q)$(MAKE) $(build)=$(package-dir) $@ %pkg: include/config/kernel.release FORCE $(Q)$(MAKE) $(build)=$(package-dir) $@ rpm: include/config/kernel.release FORCE -- cgit v1.1 From 74425eee71eb44c9f370bd922f72282b69bb0eab Mon Sep 17 00:00:00 2001 From: Nicolas Palix Date: Sun, 6 Jun 2010 17:15:01 +0200 Subject: Add a target to use the Coccinelle checker A 'coccicheck' target is added. It can be called with four different modes. Each one generates a different kind of output, i.e. context, patch, org, report, according to the corresponding mode to be activated. The new target calls the 'coccicheck' front-end in the 'scripts' directory with the MODE argument. Every SmPL file in the subdirectories of 'scripts/coccinelle' is then given to the front-end and applied to the entire source tree. The four modes behave as follows: 'report' generates a list in the following format: file:line:column-column: message 'patch' proposes a fix, when possible. 'context' highlights lines of interest and their context in a diff-like style. Lines of interest are indicated with '-'. 'org' generates a report in the Org mode format of Emacs. Signed-off-by: Nicolas Palix Signed-off-by: Julia Lawall Acked-by: Sam Ravnborg Acked-by: Joerg Roedel Signed-off-by: Michal Marek --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ea5f0be..5a4bf98 100644 --- a/Makefile +++ b/Makefile @@ -412,7 +412,7 @@ endif # of make so .config is not included in this case either (for *config). no-dot-config-targets := clean mrproper distclean \ - cscope TAGS tags help %docs check% \ + cscope TAGS tags help %docs check% coccicheck \ include/linux/version.h headers_% \ kernelrelease kernelversion @@ -1279,8 +1279,9 @@ help: @echo ' includecheck - Check for duplicate included header files' @echo ' export_report - List the usages of all exported symbols' @echo ' headers_check - Sanity check on exported headers' - @echo ' headerdep - Detect inclusion cycles in headers'; \ - echo '' + @echo ' headerdep - Detect inclusion cycles in headers' + @$(MAKE) -f $(srctree)/scripts/Makefile.help checker-help + @echo '' @echo 'Kernel packaging:' @$(MAKE) $(build)=$(package-dir) help @echo '' @@ -1439,6 +1440,9 @@ versioncheck: -name '*.[hcS]' -type f -print | sort \ | xargs $(PERL) -w $(srctree)/scripts/checkversion.pl +coccicheck: + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/$@ + namespacecheck: $(PERL) $(srctree)/scripts/namespace.pl -- cgit v1.1 From 01ab17887f4cdcb8bb5a5d1bc3b160d186e6e99b Mon Sep 17 00:00:00 2001 From: Amerigo Wang Date: Mon, 28 Jun 2010 10:45:21 +0800 Subject: Makefile: "make kernelrelease" should show the correct full kernel version After commit 85a256d8e0116c8f5ad276730830f5d4d473344d, 'make kernelrelease' doesn't show the correct full kernel version. This patch fixes it, 'make kernelrelease' will show the same version name with the one you finally get. Cc: David Rientjes Cc: Michal Marek Signed-off-by: Amerigo Wang [mmarek: merged with 0915512 and added dependency on include/config/kernel.release] Signed-off-by: Michal Marek --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a86ac8c..dceb4f1 100644 --- a/Makefile +++ b/Makefile @@ -414,7 +414,7 @@ endif no-dot-config-targets := clean mrproper distclean \ cscope TAGS tags help %docs check% \ include/linux/version.h headers_% \ - kernelrelease kernelversion + kernelversion config-targets := 0 mixed-targets := 0 @@ -1395,9 +1395,9 @@ checkstack: $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \ $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH) -kernelrelease: - $(if $(wildcard include/config/kernel.release), $(Q)echo $(KERNELRELEASE), \ - $(error kernelrelease not valid - run 'make prepare' to update it)) +kernelrelease: include/config/kernel.release + @echo $(KERNELRELEASE) + kernelversion: @echo $(KERNELVERSION) -- cgit v1.1 From d6f4ceb796ebf1a8c8a9ad4a8ea0d181aaec7de6 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Wed, 14 Jul 2010 15:43:52 +0200 Subject: Kbuild: Add option to set -femit-struct-debug-baseonly Newer gcc has a -femit-struct-debug-baseonly option that dramatically reduces the size of object files with debug info. What it does is to only emit type information for structures when the structures are defined in the same file or in a header file. This means the type information for most headers are not included. This is not good when the type information is actually needed (e.g. with kgdb or systemtap) But often kernel hackers only care about line numbers and don't need all the type information anyways. In this case setting the option can be a big win: A build dir for a specific x86-64 configuration with gcc 4.5 shrunk from 2.3G to 1.2G. The compilation was also nearly a minute faster. Signed-off-by: Andi Kleen [mmarek: reformatted help text] Signed-off-by: Michal Marek --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index dceb4f1..e1dfb90 100644 --- a/Makefile +++ b/Makefile @@ -557,6 +557,10 @@ KBUILD_CFLAGS += -g KBUILD_AFLAGS += -gdwarf-2 endif +ifdef CONFIG_DEBUG_INFO_REDUCED +KBUILD_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) +endif + ifdef CONFIG_FUNCTION_TRACER KBUILD_CFLAGS += -pg endif -- cgit v1.1 From 6588169d516560f68672e2928680b71c647b7806 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Wed, 28 Jul 2010 17:33:09 +0200 Subject: kbuild: allow assignment to {A,C,LD}FLAGS_MODULE on the command line It is now possible to assign options to AS, CC and LD on the command line - which is only used when building modules. {A,C,LD}FLAGS_MODULE was all used both in the top-level Makefile in the arch makefiles, thus users had no way to specify additional options to AS, CC, LD when building modules without overriding the original value. Introduce a new set of variables KBUILD_{A,C,LD}FLAGS_MODULE that is used by arch specific files and free up {A,C,LD}FLAGS_MODULE so they can be assigned on the command line. All arch Makefiles that used the old variables has been updated. Note: Previously we had a MODFLAGS variable for both AS and CC. But in favour of consistency this was dropped. So in some cases arch Makefile has one assignmnet replaced by two assignmnets. Note2: MODFLAGS was not documented and is dropped without any notice. I do not expect much/any breakage from this. Signed-off-by: Sam Ravnborg Cc: Denys Vlasenko Cc: Haavard Skinnemoen Cc: Mike Frysinger Cc: Tony Luck Cc: Geert Uytterhoeven Cc: Ralf Baechle Cc: Benjamin Herrenschmidt Cc: Martin Schwidefsky Cc: Chen Liqin Acked-by: Mike Frysinger [blackfin] Acked-by: Haavard Skinnemoen [avr32] Signed-off-by: Michal Marek --- Makefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e1dfb90..3dbd62b 100644 --- a/Makefile +++ b/Makefile @@ -332,10 +332,9 @@ CHECK = sparse CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ -Wbitwise -Wno-return-void $(CF) -MODFLAGS = -DMODULE -CFLAGS_MODULE = $(MODFLAGS) -AFLAGS_MODULE = $(MODFLAGS) -LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds +CFLAGS_MODULE = +AFLAGS_MODULE = +LDFLAGS_MODULE = CFLAGS_KERNEL = AFLAGS_KERNEL = CFLAGS_GCOV = -fprofile-arcs -ftest-coverage @@ -355,6 +354,9 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -Wno-format-security \ -fno-delete-null-pointer-checks KBUILD_AFLAGS := -D__ASSEMBLY__ +KBUILD_AFLAGS_MODULE := -DMODULE +KBUILD_CFLAGS_MODULE := -DMODULE +KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) @@ -369,6 +371,7 @@ export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE +export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE # When compiling out-of-tree modules, put MODVERDIR in the module # tree rather than in the kernel tree. The kernel tree might @@ -607,7 +610,7 @@ endif # Use --build-id when available. LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ $(call cc-ldoption, -Wl$(comma)--build-id,)) -LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) +KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) ifeq ($(CONFIG_STRIP_ASM_SYMS),y) -- cgit v1.1 From 80c00ba942ee39c9a95c06959223560400bbb86e Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Wed, 28 Jul 2010 19:11:27 +0200 Subject: kbuild: allow assignment to {A,C}FLAGS_KERNEL on the command line It is now possible to assign options to AS and CC on the command line - which is only used for built-in code. {A,C}FLAGS_KERNEL was used both in the top-level Makefile in the arch makefiles, thus users had no way to specify additional options to AS, CC without overriding the original value. Introduce a new set of variables KBUILD_{A,C}FLAGS_KERNEL that is used by arch specific files and free up {A,C}FLAGS_KERNEL so they can be assigned on the command line. All arch Makefiles that used the old variables has been updated. Signed-off-by: Sam Ravnborg Cc: Tony Luck Cc: Hirokazu Takata Signed-off-by: Michal Marek --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3dbd62b..7af9d54 100644 --- a/Makefile +++ b/Makefile @@ -353,6 +353,8 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -Werror-implicit-function-declaration \ -Wno-format-security \ -fno-delete-null-pointer-checks +KBUILD_AFLAGS_KERNEL := +KBUILD_CFLAGS_KERNEL := KBUILD_AFLAGS := -D__ASSEMBLY__ KBUILD_AFLAGS_MODULE := -DMODULE KBUILD_CFLAGS_MODULE := -DMODULE @@ -372,6 +374,7 @@ export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE +export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL # When compiling out-of-tree modules, put MODVERDIR in the module # tree rather than in the kernel tree. The kernel tree might @@ -1481,6 +1484,7 @@ cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \ $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*) a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ + $(KBUILD_AFLAGS_KERNEL) \ $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(KBUILD_CPPFLAGS) \ $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) -- cgit v1.1 From 235caa235cb6f88fd04bc58a288f45463e5361c7 Mon Sep 17 00:00:00 2001 From: Yegor Yefremov Date: Wed, 4 Aug 2010 14:16:15 +0200 Subject: Fix CONFIG_CROSS_COMPILE issue in .config Signed-off-by: Yegor Yefremov Signed-off-by: Michal Marek --- Makefile | 1 - 1 file changed, 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 968ac2a..f78450e 100644 --- a/Makefile +++ b/Makefile @@ -189,7 +189,6 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile export KBUILD_BUILDHOST := $(SUBARCH) ARCH ?= $(SUBARCH) -CROSS_COMPILE ?= CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%) # Architecture as present in compile.h -- cgit v1.1 From da5cabf80e2433131bf0ed8993abc0f7ea618c73 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 15 Aug 2010 17:41:37 -0700 Subject: Linux 2.6.36-rc1 --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 788111d..f3bdff8 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 -SUBLEVEL = 35 -EXTRAVERSION = +SUBLEVEL = 36 +EXTRAVERSION = -rc1 NAME = Sheep on Meth # *DOCUMENTATION* -- cgit v1.1