From 70cfe02682ff16bd8c1fec0d2374bd4dbceae54f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ozan=20=C3=87a=C4=9Flayan?= Date: Tue, 14 Aug 2012 19:00:54 +0300 Subject: [PATCH 1/5] kbuild: Remove useless warning while appending KCFLAGS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a respin of an older patch sent by Sam Ravnborg: http://www.gossamer-threads.com/lists/linux/kernel/1530602 This patch removes the annoying warning: Makefile:708: "WARNING: Appending $KCFLAGS (-Wno-sign-compare) from command line to kernel $CFLAGS" which is printed every time I use KCFLAFS. The commit which introduced the warning: 69ee0b3 kbuild: do not pick up CFLAGS from the environment tells about the problems when people have CFLAGS in their environment, then switches to KCFLAFS which should be enough to solve the issue, but it anyway introduces a warning. Drop this warning. Signed-off-by: Ozan Çağlayan Signed-off-by: Michal Marek --- Makefile | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index ddf5be952e4..fe8ab312402 100644 --- a/Makefile +++ b/Makefile @@ -648,22 +648,9 @@ ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y) endif # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments -# But warn user when we do so -warn-assign = \ -$(warning "WARNING: Appending $$K$(1) ($(K$(1))) from $(origin K$(1)) to kernel $$$(1)") - -ifneq ($(KCPPFLAGS),) - $(call warn-assign,CPPFLAGS) - KBUILD_CPPFLAGS += $(KCPPFLAGS) -endif -ifneq ($(KAFLAGS),) - $(call warn-assign,AFLAGS) - KBUILD_AFLAGS += $(KAFLAGS) -endif -ifneq ($(KCFLAGS),) - $(call warn-assign,CFLAGS) - KBUILD_CFLAGS += $(KCFLAGS) -endif +KBUILD_CPPFLAGS += $(KCPPFLAGS) +KBUILD_AFLAGS += $(KAFLAGS) +KBUILD_CFLAGS += $(KCFLAGS) # Use --build-id when available. LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ From ef591a550644062af5106e35fac112dee8463312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EA=B1=B4=ED=98=B8?= Date: Wed, 29 Aug 2012 22:58:12 +0900 Subject: [PATCH 2/5] scripts/Makefile.modpost: error in finding modules from .mod files. This error may happen when the user's id or path includes .ko string. For example, user's id is xxx.ko and building test.ko module, the test.mod file lists ko name and all object files. /home/xxx.ko/kernel_dev/device/drivers/test.ko /home/xxx.ko/kernel_dev/device/drivers/test_main.o /home/xxx.ko/kernel_dev/device/drivers/test_io.o ... Current Makefile.modpost and Makefile.modinst find and list up not only test.ko but also other object files. because all of object file's path includes .ko string. This is a patch to fix it. Signed-off-by: Gunho Lee Signed-off-by: Michal Marek --- scripts/Makefile.modinst | 2 +- scripts/Makefile.modpost | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index efa5d940e63..3d13d3a3edf 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst @@ -9,7 +9,7 @@ include scripts/Kbuild.include # -__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod))) +__modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod))) modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o))) PHONY += $(modules) diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 08dce14f2dc..a1cb0222ebe 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -60,7 +60,7 @@ kernelsymfile := $(objtree)/Module.symvers modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers # Step 1), find all modules listed in $(MODVERDIR)/ -__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod))) +__modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod))) modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o))) # Stop after building .o files if NOFINAL is set. Makes compile tests quicker From b589c8ae095b3d4f4181a6aefb26df5e762d6499 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Sat, 8 Sep 2012 12:47:59 -0700 Subject: [PATCH 3/5] Kbuild: use normal compression settings for tar*-pkg For large kernel configurations (like a distribution kernel) targz-pkg takes a quite long time to just do the compression. I clocked it at 15+mins for a SUSE kernel like config on a fast system. And tarxz and bzip2 are even slower. The main reason is that the script that is doing the taring sets the highest compression level (-9). When I change it to just use the defaults the gzip time for the same kernel goes down to ~3 mins. I haven't tested xz and bzip, but I expect those to be much faster too. I'm not willing to wait that long for a small compression gain. So just change the script to use the defaults. Signed-off-by: Andi Kleen Reviewed-by: Fengguang Wu Signed-off-by: Michal Marek --- scripts/package/buildtar | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/package/buildtar b/scripts/package/buildtar index 8a7b15598ea..632377f9dd3 100644 --- a/scripts/package/buildtar +++ b/scripts/package/buildtar @@ -28,15 +28,15 @@ case "${1}" in file_ext="" ;; targz-pkg) - compress="gzip -c9" + compress="gzip" file_ext=".gz" ;; tarbz2-pkg) - compress="bzip2 -c9" + compress="bzip2" file_ext=".bz2" ;; tarxz-pkg) - compress="xz -c9" + compress="xz" file_ext=".xz" ;; *) From 76b27645a5bba85bd26896811c7a25ecc37b3731 Mon Sep 17 00:00:00 2001 From: Jonathan Kliegman Date: Thu, 4 Oct 2012 16:32:19 -0400 Subject: [PATCH 4/5] modpost: Permit .GCC.command.line sections Allow .GCC.command.line sections in modules to prevent modpost warnings: WARNING: sound/usb/snd-usbmidi-lib.o (.GCC.command.line): unexpected non-allocatable section. Did you forget to use "ax"/"aw" in a .S file? Note that for example contains section definitions for use in .S files. Signed-off-by: Jonathan Kliegman Signed-off-by: Michal Marek --- scripts/mod/modpost.c | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 68e9f5ed0a6..cd5803c647f 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -821,6 +821,7 @@ static const char *section_white_list[] = ".debug*", ".zdebug*", /* Compressed debug sections. */ ".GCC-command-line", /* mn10300 */ + ".GCC.command.line", /* record-gcc-switches, non mn10300 */ ".mdebug*", /* alpha, score, mips etc. */ ".pdr", /* alpha, score, mips etc. */ ".stab*", From 415c2c525fab214ab75413aadbc67b4ee9cf212e Mon Sep 17 00:00:00 2001 From: Daniel Santos Date: Fri, 28 Sep 2012 18:20:02 -0500 Subject: [PATCH 5/5] compiler-gcc4.h: correct verion check for __compiletime_error __attribute__((error(msg))) was introduced in gcc 4.3 (not 4.4) and as I was unable to find any gcc bugs pertaining to it, I'm presuming that it has functioned as advertised since 4.3.0. Signed-off-by: Daniel Santos Signed-off-by: Andrew Morton Tested-by: David Rientjes Signed-off-by: Michal Marek --- include/linux/compiler-gcc4.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 2f4079175af..10ce4fafea6 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h @@ -52,7 +52,7 @@ #if __GNUC_MINOR__ > 0 #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) #endif -#if __GNUC_MINOR__ >= 4 && !defined(__CHECKER__) +#if __GNUC_MINOR__ >= 3 && !defined(__CHECKER__) #define __compiletime_warning(message) __attribute__((warning(message))) #define __compiletime_error(message) __attribute__((error(message))) #endif