2005-11-10 21:35:39

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: Zachary Amsden <[email protected]>
Signed-off-by: Sam Ravnborg <[email protected]>

diff --git a/Makefile b/Makefile
index 3152d63..83a3185 100644
--- a/Makefile
+++ b/Makefile
@@ -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

Signed-off-by: Uwe Zeisberger <[email protected]>
Signed-off-by: Sam Ravnborg <[email protected]>

diff --git a/Makefile b/Makefile
index 2dac801..3152d63 100644
--- a/Makefile
+++ b/Makefile
@@ -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


2005-11-10 21:46:56

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH] Kbuild fixes



On Thu, 10 Nov 2005, Sam Ravnborg wrote:
>
> 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

2005-11-10 22:15:45

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH] Kbuild fixes

On Thu, Nov 10, 2005 at 01:46:35PM -0800, Linus Torvalds wrote:
>
>
> On Thu, 10 Nov 2005, Sam Ravnborg wrote:
> >
> > 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

2005-12-01 16:25:14

by Andreas Schwab

[permalink] [raw]
Subject: Re: [PATCH] Kbuild fixes

Sam Ravnborg <[email protected]> writes:

> 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.

Signed-off-by: Andreas Schwab <[email protected]>

Index: linux-2.6.14/Makefile
===================================================================
--- linux-2.6.14.orig/Makefile 2005-12-01 17:10:33.998015103 +0100
+++ linux-2.6.14/Makefile 2005-12-01 17:11:39.605921389 +0100
@@ -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.

--
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."

2005-12-02 07:29:07

by Uwe Zeisberger

[permalink] [raw]
Subject: Re: [PATCH] Kbuild fixes

Hallo Andreas,

Andreas Schwab wrote:
> Sam Ravnborg <[email protected]> writes:
>
> > 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.

Signed-off-by: Uwe Zeisberger <[email protected]>

---

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

applies-to: bf816f7c7055127415fc3b718e260855df815d55
02a17e7669dcc6abd51fefc65af2278e95e4855f
diff --git a/Makefile b/Makefile
index e7a0443..77b51b8 100644
--- a/Makefile
+++ b/Makefile
@@ -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

--
Uwe Zeisberger

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