Skip to contentSkip to conversation

Kbuild fixes

PATCH In review Sam Ravnborg 4 participants 5 messages Nov 10, 2005 – Dec 2, 2005 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Kbuild fixes

Hi Linus.

Two kbuild fixes.

[PATCH] kbuild: build breaks after -imacros was introduced [PATCH] kbuild: make kernelrelease in unconfigured kernel prints an error

The use of -imacros is know to break for at least two distinct users. akpm being one of them.

Sam

please pull from:

master.kernel.org/pub/scm/linux/kernel/git/sam/kbuild.git

Patch'es included below.

 Makefile   |    2 +-
 b/Makefile |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Author: Zachary Amsden <[email protected]>

[PATCH] kbuild: build breaks after -imacros was introduced

I have to revert the recent addition of -imacros to the Makefile to get my tool chain to build. Without the change, below, I get:

Note that this looks entirely like a toolchain bug. Here is the offending command:

[pid 12163] execve("/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/tradcpp0", ["/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/tradcpp0", "-lang-asm", "-nostdinc", "-Iinclude", "-Iinclude/asm-i386/mach-default", "-D__GNUC__=3", "-D__GNUC_MINOR__=2", "-D__GNUC_PATCHLEVEL__=2", "-D__GXX_ABI_VERSION=102", "-D__ELF__", "-Dunix", "-D__gnu_linux__", "-Dlinux", "-D__ELF__", "-D__unix__", "-D__gnu_linux__", "-D__linux__", "-D__unix", "-D__linux", "-Asystem=posix", "-D__NO_INLINE__", "-D__STDC_HOSTED__=1", "-Acpu=i386", "-Amachine=i386", "-Di386", "-D__i386", "-D__i386__", "-D__tune_i386__", "-D__KERNEL__", "-D__ASSEMBLY__", "-isystem", "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include", "-imacros", "include/linux/autoconf.h", "-MD", "arch/i386/kernel/.entry.o.d", "arch/i386/kernel/entry.S", "-o", "/tmp/ccOlsFJR.s"]

Which should execute properly, I think. But it does not:

zach-dev:linux-2.6.14-zach-work $ make
CHK include/linux/version.h
CHK include/linux/compile.h
CHK usr/initramfs_list
AS arch/i386/kernel/entry.o
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/tradcpp0: output filename specified twice make[1]: *** [arch/i386/kernel/entry.o] Error 1
make: *** [arch/i386/kernel] Error 2

gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

Deprecating the -imacros fixes the build for me. It does not appear to be a simple argument overflow problem in trapcpp0, since deprecating all the defines reproduces the problem as well. Also, switching -imacros to -include fixes the problem.

Makefile +1 -1
index 3152d63..83a3185 100644
@@ -347,7 +347,7 @@ AFLAGS_KERNEL	=
 # Needed to be compatible with the O= option
 LINUXINCLUDE    := -Iinclude \
                    $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
-		   -imacros include/linux/autoconf.h
+		   -include include/linux/autoconf.h
 
 CPPFLAGS        := -D__KERNEL__ $(LINUXINCLUDE)
 

Author: Uwe Zeisberger <[email protected]>

[PATCH] kbuild: make kernelrelease in unconfigured kernel prints an error

Do not include .config for target kernelrelease

Makefile +1 -1
index 2dac801..3152d63 100644
@@ -407,7 +407,7 @@ outputmakefile:
 # 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% kernelrelease
 
 config-targets := 0
 mixed-targets  := 0
#1 lore raw
Quoted 4 lines · Sam Ravnborg

please pull from:

master.kernel.org/pub/scm/linux/kernel/git/sam/kbuild.git

Grr. That's not a valid git URL.

Hint.. There's a missing colon there.

Linus

#2 lore raw
Quoted 9 lines · Linus Torvalds
Quoted 4 lines · Sam Ravnborg

please pull from:

master.kernel.org/pub/scm/linux/kernel/git/sam/kbuild.git

Grr. That's not a valid git URL.

Ups..

git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild.git

or

master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git

It must be a disease coming from sitting in front of Windoze boxes all day starring in Outlook :-(

Sam

#3 lore raw
In reply to Sam Ravnborg
Quoted 5 lines · Sam Ravnborg

Author: Uwe Zeisberger <[email protected]>

[PATCH] kbuild: make kernelrelease in unconfigured kernel prints an error

Do not include .config for target kernelrelease

This is wrong. KERNELRELEASE depends on CONFIG_LOCALVERSION, thus you need .config.

Makefile +1 -1
Index: linux-2.6.14/Makefile
===================================================================
@@ -412,7 +412,7 @@ outputmakefile:
 # 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% kernelrelease
+			 cscope TAGS tags help %docs check%
 
 config-targets := 0
 mixed-targets  := 0

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#4 lore raw

Hallo Andreas,

Quoted 10 lines · Andreas Schwab
Quoted 5 lines · Sam Ravnborg

Author: Uwe Zeisberger <[email protected]>

[PATCH] kbuild: make kernelrelease in unconfigured kernel prints an error

Do not include .config for target kernelrelease

This is wrong. KERNELRELEASE depends on CONFIG_LOCALVERSION, thus you need .config.

James Cloos already indicated that on lkml[1]. I prepared a patch but didn't sent it to lkml.

Maybe you're happy with the following patch, too? With it .config is included if it exists and no error occurs if not.

{{{
Include .config for target kernelrelease if it exists

With this fix the value of CONFIG_LOCALVERSION is appended to the output of make kernelrelease. The git tag is *not* appended (yet) without a .config.

---

 Makefile |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

applies-to: bf816f7c7055127415fc3b718e260855df815d55 02a17e7669dcc6abd51fefc65af2278e95e4855f

Makefile +14 -3
index e7a0443..77b51b8 100644
@@ -407,16 +407,23 @@ outputmakefile:
 # Detect when mixed targets is specified, and make a second invocation
 # 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% kernelrelease
+no-dot-config-targets  := clean mrproper distclean \
+			  cscope TAGS tags help %docs check%
+
+opt-dot-config-targets := kernelrelease
 
 config-targets := 0
 mixed-targets  := 0
 dot-config     := 1
+opt-dot-config := 0
 
-ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
+ifneq ($(filter $(no-dot-config-targets) $(opt-dot-config-targets), $(MAKECMDGOALS)),)
 	ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
 		dot-config := 0
+	else
+		ifeq ($(filter-out $(opt-dot-config-targets), $(MAKECMDGOALS)),)
+			opt-dot-config := 1
+		endif
 	endif
 endif
 
@@ -483,7 +490,11 @@ ifeq ($(dot-config),1)
 # oldconfig if changes are detected.
 -include .config.cmd
 
+ifeq ($(opt-dot-config),1)
+-include .config
+else
 include .config
+endif
 
 # If .config needs to be updated, it will be done via the dependency
 # that autoconf has on .config.

---
0.99.9g
}}}

[1] http://groups.google.com/group/linux.kernel/browse_thread/thread/25b426027bf5fdba/e5931ac731528c1f?q=Cloos&rnum=2#e5931ac731528c1f

Signature · 3 lines
Uwe Zeisberger

http://www.google.com/search?q=sin%28pi%2F2%29