2006-10-24 07:31:26

by Mitch

[permalink] [raw]
Subject: More uml build failures on 2.16.19-rc3 and 2.6.18.1

I'm still having build failures on 2.6.18.1 and even the latest -rc3

Anyone ?
M

home /usr/src/sources/kernel/linux-2.6.18% !ma
make ARCH=um
SYMLINK arch/um/include/kern_constants.h
CC arch/um/sys-i386/user-offsets.s
arch/um/sys-i386/user-offsets.c: In function 'foo':
arch/um/sys-i386/user-offsets.c:19: warning: implicit declaration of
function 'offsetof'
arch/um/sys-i386/user-offsets.c:19: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:20: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:21: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:22: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:23: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:24: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:25: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:26: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:27: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:28: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:29: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:30: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:31: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:32: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:33: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:34: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:35: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:36: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:37: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:38: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:39: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:40: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:41: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:42: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:43: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:44: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:45: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:46: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:47: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:48: error: syntax error before 'struct'
make[1]: *** [arch/um/sys-i386/user-offsets.s] Error 1
make: *** [arch/um/sys-i386/user-offsets.s] Error 2


2006-10-24 07:41:13

by Pekka Enberg

[permalink] [raw]
Subject: Re: More uml build failures on 2.16.19-rc3 and 2.6.18.1

On 10/24/06, Mitch <[email protected]> wrote:
> I'm still having build failures on 2.6.18.1 and even the latest -rc3

Did you remember to do make mrproper? If yes, can we have your .config, please.

2006-10-24 08:36:01

by Mitch

[permalink] [raw]
Subject: Re: More uml build failures on 2.16.19-rc3 and 2.6.18.1

Maybe my compiler. Anyone building with 4.0.3 ?

home /usr/src/sources/kernel/linux-2.6.18% make ARCH=um CC=gcc\ -v
Using built-in specs.
SYMLINK arch/um/include/kern_constants.h
CC arch/um/sys-i386/user-offsets.s
Using built-in specs.
Target: i686-linux
Configured with: ../gcc-4.0.3/configure --disable-static --prefix=/usr
--disable-nls --with-system-zlib i686-linux
Thread model: posix
gcc version 4.0.3
/usr/libexec/gcc/i686-linux/4.0.3/cc1 -quiet -v -Iarch/um/include
-I/usr/src/sources/kernel/linux-2.6.18/arch/um/include/skas
-D__arch_um__ -DSUBARCH="i386" -Dvmap=kernel_vmap
-Din6addr_loopback=kernel_in6addr_loopback -D_FILE_OFFSET_BITS=64
-D_GNU_SOURCE -D_LARGEFILE64_SOURCE -MD
arch/um/sys-i386/.user-offsets.s.d arch/um/sys-i386/user-offsets.c
-quiet -dumpbase user-offsets.c -march=i686 -mpreferred-stack-boundary=2
-auxbase-strip arch/um/sys-i386/user-offsets.s -Os -Wall -Wundef
-Wstrict-prototypes -Wno-trigraphs -version -fno-strict-aliasing
-fno-common -ffreestanding -fverbose-asm -o arch/um/sys-i386/user-offsets.s
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/i686-linux/4.0.3/../../../../i686-linux/include"
#include "..." search starts here:
#include <...> search starts here:
arch/um/include
/usr/src/sources/kernel/linux-2.6.18/arch/um/include/skas
/usr/lib/gcc/i686-linux/4.0.3/include
/usr/include
End of search list.
GNU C version 4.0.3 (i686-linux)
compiled by GNU C version 3.4.6.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
arch/um/sys-i386/user-offsets.c: In function 'foo':
arch/um/sys-i386/user-offsets.c:19: warning: implicit declaration of
function 'offsetof'
arch/um/sys-i386/user-offsets.c:19: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:20: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:21: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:22: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:23: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:24: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:25: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:26: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:27: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:28: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:29: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:30: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:31: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:32: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:33: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:34: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:35: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:36: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:37: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:38: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:39: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:40: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:41: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:42: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:43: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:44: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:45: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:46: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:47: error: syntax error before 'struct'
arch/um/sys-i386/user-offsets.c:48: error: syntax error before 'struct'
make[1]: *** [arch/um/sys-i386/user-offsets.s] Error 1
make: *** [arch/um/sys-i386/user-offsets.s] Error 2
The mail in /var/mail/mitch has been read.
home /usr/src/sources/kernel/linux-2.6.18%




-------- Original Message --------
Subject: Re: [Fwd: Re: More uml build failures on 2.16.19-rc3 and 2.6.18.1]
Date: Tue, 24 Oct 2006 11:31:06 +0300
From: Pekka Enberg <[email protected]>
To: Mitch <[email protected]>
CC: [email protected],
[email protected]
References: <[email protected]>

Hi,

On 10/24/06, Mitch <[email protected]> wrote:
> Yup, did do 'make mrproper'. config attached.

Works for me. Perhaps the UML people can figure out what's going on.

Pekka

2006-10-24 13:22:23

by Jeff Dike

[permalink] [raw]
Subject: Re: More uml build failures on 2.16.19-rc3 and 2.6.18.1

On Tue, Oct 24, 2006 at 11:31:19AM +0400, Mitch wrote:
> I'm still having build failures on 2.6.18.1 and even the latest -rc3
>
> home /usr/src/sources/kernel/linux-2.6.18% !ma
> make ARCH=um
> SYMLINK arch/um/include/kern_constants.h
> CC arch/um/sys-i386/user-offsets.s
> arch/um/sys-i386/user-offsets.c: In function 'foo':
> arch/um/sys-i386/user-offsets.c:19: warning: implicit declaration of
> function 'offsetof'

The last time I saw this, someone had replaced the glibc kernel
headers with a link to include/ within a kernel pool. There, offsetof
is wrapped in #ifdef __KERNEL__, and inaccessible to userspace.

The glibc headers have a usable offsetof, so fix that, and UML should
build.

Jeff

2006-10-24 21:01:08

by Mitch

[permalink] [raw]
Subject: Re: More uml build failures on 2.16.19-rc3 and 2.6.18.1

I've definetly not done any such change on my machine. Remember with the
same compile, same environment, if i go back to 2.6.18 i can build uml
fine. If i move to 2.6.18.1 or above it breaks...

I do notice my gcc stddef does have this defined

% grep offsetof /usr/lib/gcc/i686-linux/4.0.3/include/stddef.h
#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)

And i notice my compiler has it inbuilt, so maybe this is a gcc 4.0.3
issue ?

% strings /usr/libexec/gcc/i686-linux/4.0.3/cc1|grep offsetof
offsetof_member_designator
__builtin_offsetof
fold_offsetof_1
-Winvalid-offsetof
Warn about invalid uses of the "offsetof" macro


-------- Original Message --------
Subject: Re: More uml build failures on 2.16.19-rc3 and 2.6.18.1
Date: Tue, 24 Oct 2006 09:20:25 -0400
From: Jeff Dike <[email protected]>
To: Mitch <[email protected]>
CC: [email protected]
References: <[email protected]>

On Tue, Oct 24, 2006 at 11:31:19AM +0400, Mitch wrote:
> I'm still having build failures on 2.6.18.1 and even the latest -rc3
>
> home /usr/src/sources/kernel/linux-2.6.18% !ma
> make ARCH=um
> SYMLINK arch/um/include/kern_constants.h
> CC arch/um/sys-i386/user-offsets.s
> arch/um/sys-i386/user-offsets.c: In function 'foo':
> arch/um/sys-i386/user-offsets.c:19: warning: implicit declaration of
> function 'offsetof'

The last time I saw this, someone had replaced the glibc kernel
headers with a link to include/ within a kernel pool. There, offsetof
is wrapped in #ifdef __KERNEL__, and inaccessible to userspace.

The glibc headers have a usable offsetof, so fix that, and UML should
build.

Jeff

2006-10-25 15:43:17

by Jeff Dike

[permalink] [raw]
Subject: Re: More uml build failures on 2.16.19-rc3 and 2.6.18.1

On Wed, Oct 25, 2006 at 01:00:55AM +0400, Mitch wrote:
> I've definetly not done any such change on my machine. Remember with the
> same compile, same environment, if i go back to 2.6.18 i can build uml
> fine. If i move to 2.6.18.1 or above it breaks...

You're sure about that? I just looked through the 2.6.18.1 changelog and
I see nothing that would cause this.

> I do notice my gcc stddef does have this defined
>
> % grep offsetof /usr/lib/gcc/i686-linux/4.0.3/include/stddef.h
> #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)

I would do a -E build and make sure that this header, or another one that
defines offsetof is getting pulled in.

Jeff

2006-10-28 11:22:00

by Mitch

[permalink] [raw]
Subject: Re: More uml build failures on 2.16.19-rc3 and 2.6.18.1

Hi Jeff, all,

Sorry for the dealy but i've been out of the country.

Anyhow i did some investigation and i've figured out the bug.

Essentially if you try to compile a UML kernel on a 2.6.18.1 or above
*host* kernel it will fail with the error messages shown (essentially
offsetof macro undefined) because between 2.6.18 and 2.6.18.1 that macro
in /usr/include/linux/stddef.h is now wrapped in a #ifdef __KERNEL__ .
However since UML doesn't build it's sources with that defined we get an
undefined macro and a build failure.

So i'm partly right and partly wrong in my statement below. Yes i did
compile a guest UML kernel 2.6.18 fine on host kernel of 2.6.18, and i
believe i will be able to compile 2.6.18.1 and above also on a host
kernel of 2.6.18 but if i change my host kernel to 2.6.18.1 or above all
UML guest builds will fail.

Can someone confirm they can build guest UML kernels on a host kernel >=
2.6.18.1 ??

Thanks
M

-------- Original Message --------
Subject: Re: More uml build failures on 2.16.19-rc3 and 2.6.18.1
Date: Wed, 25 Oct 2006 11:41:30 -0400
From: Jeff Dike <[email protected]>
To: Mitch <[email protected]>
CC: [email protected]
References: <[email protected]>

On Wed, Oct 25, 2006 at 01:00:55AM +0400, Mitch wrote:
> I've definetly not done any such change on my machine. Remember with the
> same compile, same environment, if i go back to 2.6.18 i can build uml
> fine. If i move to 2.6.18.1 or above it breaks...

You're sure about that? I just looked through the 2.6.18.1 changelog and
I see nothing that would cause this.

> I do notice my gcc stddef does have this defined
>
> % grep offsetof /usr/lib/gcc/i686-linux/4.0.3/include/stddef.h
> #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)

I would do a -E build and make sure that this header, or another one that
defines offsetof is getting pulled in.

Jeff

2006-10-29 16:58:00

by Blaisorblade

[permalink] [raw]
Subject: Re: More uml build failures on 2.16.19-rc3 and 2.6.18.1

On Saturday 28 October 2006 13:21, Mitch wrote:
> Hi Jeff, all,
>
> Sorry for the dealy but i've been out of the country.
>
> Anyhow i did some investigation and i've figured out the bug.
>
> Essentially if you try to compile a UML kernel on a 2.6.18.1 or above
> *host* kernel

> it will fail with the error messages shown (essentially
> offsetof macro undefined) because between 2.6.18 and 2.6.18.1 that macro
> in /usr/include/linux/stddef.h is now wrapped in a #ifdef __KERNEL__ .
> However since UML doesn't build it's sources with that defined we get an
> undefined macro and a build failure.

Ok, we have one bug and one mistake on your part:
1) we should include <stddef.h> instead of <linux/stddef.h> in files using
host headers (I don't have the error message at hand, so please handle this
yourself, Jeff)
2) /usr/include/{linux,asm} being symlinks inside /usr/src/linux/include is an
unsupported configuration since ages. #1 is still a valid bug because when a
distribution will distribute glibc and kernheaders based on 2.6.18.1+/2.6.19
ones we'll break anyway.

> So i'm partly right and partly wrong in my statement below. Yes i did
> compile a guest UML kernel 2.6.18 fine on host kernel of 2.6.18, and i
> believe i will be able to compile 2.6.18.1 and above also on a host
> kernel of 2.6.18 but if i change my host kernel to 2.6.18.1 or above all
> UML guest builds will fail.
>
> Can someone confirm they can build guest UML kernels on a host kernel >=
> 2.6.18.1 ??
>
> Thanks
> M

--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade
http://www.user-mode-linux.org/~blaisorblade
Chiacchiera con i tuoi amici in tempo reale!
http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com