Hi all,
Today's linux-next build (powerpc ppc64_defconfig) failed like this:
cc1: error: include/linux/autoconf.h: No such file or directory
(while building the boot wrappers - lots more of the same)
Caused by commit ac4c2a3bbe5db5fc570b1d0ee1e474db7cb22585 ("zlib:
optimize inffast when copying direct from output"). autoconf.h moved
from include/linux to include/generated in commit
264a26838056fc2d759f58bec2e720e01fcb1bdb ("kbuild: move autoconf.h to
include/generated") which was in linux-next since 14 Dec 2009 and in
Linus' tree since 18 Dec 2009.
I added the following patch for today:
From: Stephen Rothwell <[email protected]>
Date: Tue, 12 Jan 2010 10:23:43 +1100
Subject: [PATCH] powerpc: fix boot Makefile for autoconf.h moving
autoconf.h moved from include/linux to include/generated
Signed-off-by: Stephen Rothwell <[email protected]>
---
arch/powerpc/boot/Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 826a30a..fb32a8e 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -34,7 +34,7 @@ BOOTCFLAGS += -fno-stack-protector
endif
BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj)
-BOOTCFLAGS += -include include/linux/autoconf.h -Iarch/powerpc/include
+BOOTCFLAGS += -include include/generated/autoconf.h -Iarch/powerpc/include
BOOTCFLAGS += -Iinclude
DTS_FLAGS ?= -p 1024
--
1.6.6
However, this then produced these errors:
arch/powerpc/boot/inffast.c:7:27: error: asm/unaligned.h: No such file or directory
arch/powerpc/boot/inffast.c:8:27: error: asm/byteorder.h: No such file or directory
arch/powerpc/boot/inffast.c: In function 'inflate_fast':
arch/powerpc/boot/inffast.c:263: warning: implicit declaration of function 'get_unaligned'
arch/powerpc/boot/inffast.c:277:2: error: #error __BIG_ENDIAN nor __LITTLE_ENDIAN is defined
So I just reverted the original commit (after removing my fix above).
This latter build problem is probably only noticed if you build with a
separate object directory (i.e. with O=.. on the make command). The
previous PowerPC maintainer tells me that defining __KERNEL__ in the
BOOTFLAGS is wrong and should have been noticed.
--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/
Stephen Rothwell <[email protected]> wrote on 12/01/2010 00:58:05:
>
> Hi all,
>
> Today's linux-next build (powerpc ppc64_defconfig) failed like this:
>
> cc1: error: include/linux/autoconf.h: No such file or directory
>
> (while building the boot wrappers - lots more of the same)
>
> Caused by commit ac4c2a3bbe5db5fc570b1d0ee1e474db7cb22585 ("zlib:
> optimize inffast when copying direct from output"). autoconf.h moved
> from include/linux to include/generated in commit
> 264a26838056fc2d759f58bec2e720e01fcb1bdb ("kbuild: move autoconf.h to
> include/generated") which was in linux-next since 14 Dec 2009 and in
> Linus' tree since 18 Dec 2009.
>
> I added the following patch for today:
>
> From: Stephen Rothwell <[email protected]>
> Date: Tue, 12 Jan 2010 10:23:43 +1100
> Subject: [PATCH] powerpc: fix boot Makefile for autoconf.h moving
>
> autoconf.h moved from include/linux to include/generated
>
> Signed-off-by: Stephen Rothwell <[email protected]>
> ---
> arch/powerpc/boot/Makefile | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> index 826a30a..fb32a8e 100644
> --- a/arch/powerpc/boot/Makefile
> +++ b/arch/powerpc/boot/Makefile
> @@ -34,7 +34,7 @@ BOOTCFLAGS += -fno-stack-protector
> endif
>
> BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj)
> -BOOTCFLAGS += -include include/linux/autoconf.h -Iarch/powerpc/include
> +BOOTCFLAGS += -include include/generated/autoconf.h -Iarch/powerpc/include
> BOOTCFLAGS += -Iinclude
>
> DTS_FLAGS ?= -p 1024
> --
> 1.6.6
>
> However, this then produced these errors:
>
> arch/powerpc/boot/inffast.c:7:27: error: asm/unaligned.h: No such file or directory
> arch/powerpc/boot/inffast.c:8:27: error: asm/byteorder.h: No such file or directory
> arch/powerpc/boot/inffast.c: In function 'inflate_fast':
> arch/powerpc/boot/inffast.c:263: warning: implicit declaration of function
> 'get_unaligned'
> arch/powerpc/boot/inffast.c:277:2: error: #error __BIG_ENDIAN nor
> __LITTLE_ENDIAN is defined
>
> So I just reverted the original commit (after removing my fix above).
>
> This latter build problem is probably only noticed if you build with a
> separate object directory (i.e. with O=.. on the make command). The
> previous PowerPC maintainer tells me that defining __KERNEL__ in the
> BOOTFLAGS is wrong and should have been noticed.
I guess that the above problem will fixed by adding $(srctree):
BOOTCFLAGS += -include include/generated/autoconf.h -I$(srctree)/arch/powerpc/include
BOOTCFLAGS += -I$(srctree)/include
But what to do with the __KERNEL__ define. If it isn't allowed I
don't know what to do.
Jocke
Stephen Rothwell <[email protected]> wrote on 12/01/2010 00:58:05:
>
> Hi all,
>
> Today's linux-next build (powerpc ppc64_defconfig) failed like this:
>
> cc1: error: include/linux/autoconf.h: No such file or directory
>
> (while building the boot wrappers - lots more of the same)
>
> Caused by commit ac4c2a3bbe5db5fc570b1d0ee1e474db7cb22585 ("zlib:
> optimize inffast when copying direct from output"). autoconf.h moved
> from include/linux to include/generated in commit
> 264a26838056fc2d759f58bec2e720e01fcb1bdb ("kbuild: move autoconf.h to
> include/generated") which was in linux-next since 14 Dec 2009 and in
> Linus' tree since 18 Dec 2009.
>
[SNIP]
>
> This latter build problem is probably only noticed if you build with a
> separate object directory (i.e. with O=.. on the make command). The
> previous PowerPC maintainer tells me that defining __KERNEL__ in the
> BOOTFLAGS is wrong and should have been noticed.
Is this any better w.r.t __KERNEL__?
>From 1a79993a42e17be665d3488663d81c0513b8bbfe Mon Sep 17 00:00:00 2001
From: Joakim Tjernlund <[email protected]>
Date: Tue, 12 Jan 2010 13:31:58 +0100
Subject: [PATCH] powerpc: move __KERNEL__ define in bootwrapper.
Apparently using -D__KERNEL__ in BOOTCFLAGS is a bad thing.
Move __KERNEL__ into inffast.c where it is needed.
Signed-off-by: Joakim Tjernlund <[email protected]>
---
arch/powerpc/boot/Makefile | 2 +-
lib/zlib_inflate/inffast.c | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 79ebd6f..766fb88 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -20,7 +20,7 @@
all: $(obj)/zImage
BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
- -fno-strict-aliasing -Os -msoft-float -pipe -D__KERNEL__\
+ -fno-strict-aliasing -Os -msoft-float -pipe \
-fomit-frame-pointer -fno-builtin -fPIC -nostdinc \
-isystem $(shell $(CROSS32CC) -print-file-name=include)
BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
diff --git a/lib/zlib_inflate/inffast.c b/lib/zlib_inflate/inffast.c
index 05e1559..919c162 100644
--- a/lib/zlib_inflate/inffast.c
+++ b/lib/zlib_inflate/inffast.c
@@ -2,7 +2,9 @@
* Copyright (C) 1995-2004 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-
+#ifndef __KERNEL__
+#define __KERNEL__
+#endif
#include <linux/zutil.h>
#include <asm/unaligned.h>
#include <asm/byteorder.h>
--
1.6.4.4