From: Antoine M. <an...@na...> - 2007-07-13 11:07:36
|
# make ARCH=um SUBARCH=i386 scripts/kconfig/conf -s arch/um/Kconfig net/bluetooth/hidp/Kconfig:4:warning: 'select' used by config symbol 'BT_HIDP' refers to undefined symbol 'HID' SYMLINK arch/um/include/kern_constants.h SYMLINK include/asm-um/arch SYMLINK arch/um/include/sysdep SYMLINK arch/um/os SYMLINK include/asm-um/archparam.h SYMLINK include/asm-um/system.h SYMLINK include/asm-um/sigcontext.h SYMLINK include/asm-um/processor.h SYMLINK include/asm-um/ptrace.h SYMLINK include/asm-um/module.h SYMLINK include/asm-um/vm-flags.h SYMLINK include/asm-um/elf.h SYMLINK include/asm-um/host_ldt.h CHK arch/um/include/uml-config.h UPD arch/um/include/uml-config.h CC arch/um/sys-i386/user-offsets.s arch/um/sys-i386/user-offsets.c:7:22: error: asm/user.h: No such file or directory arch/um/sys-i386/user-offsets.c: In function 'foo': arch/um/sys-i386/user-offsets.c:51: error: invalid application of 'sizeof' to incomplete type 'struct user_i387_struct' arch/um/sys-i386/user-offsets.c:52: error: invalid application of 'sizeof' to incomplete type 'struct user_fxsr_struct' arch/um/sys-i386/user-offsets.c:70: error: invalid application of 'sizeof' to incomplete type 'struct user_regs_struct' make[1]: *** [arch/um/sys-i386/user-offsets.s] Error 1 make: *** [arch/um/sys-i386/user-offsets.s] Error 2 This used to work fine - I am sure the fix is quite simple, but I do not have any spare time ATM. Antoine |
From: Antoine M. <an...@na...> - 2007-07-13 12:03:55
|
I had updated the kernel headers and these include files have been removed. Until UML uses some other trick, this works for me for the 64-bit build: cp /usr/src/linux-2.6.22.1/include/asm/user.h /usr/include/asm/user.h cp /usr/src/linux-2.6.22.1/include/asm/page.h /usr/include/asm/page.h cp /usr/src/linux-2.6.22.1/include/linux/const.h /usr/include/linux/const.h But for the 32-bit cross build (make ARCH=um SUBARCH=i386) I still get this error: # make ARCH=um SUBARCH=i386 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:52: error: invalid application of 'sizeof' to incomplete type 'struct user_fxsr_struct' make[1]: *** [arch/um/sys-i386/user-offsets.s] Error 1 make: *** [arch/um/sys-i386/user-offsets.s] Error 2 Antoine Martin wrote: > # make ARCH=um SUBARCH=i386 scripts/kconfig/conf -s > arch/um/Kconfig > net/bluetooth/hidp/Kconfig:4:warning: 'select' used by config symbol > 'BT_HIDP' refers to undefined symbol 'HID' > SYMLINK arch/um/include/kern_constants.h > SYMLINK include/asm-um/arch > SYMLINK arch/um/include/sysdep > SYMLINK arch/um/os > SYMLINK include/asm-um/archparam.h > SYMLINK include/asm-um/system.h > SYMLINK include/asm-um/sigcontext.h > SYMLINK include/asm-um/processor.h > SYMLINK include/asm-um/ptrace.h > SYMLINK include/asm-um/module.h > SYMLINK include/asm-um/vm-flags.h > SYMLINK include/asm-um/elf.h > SYMLINK include/asm-um/host_ldt.h > CHK arch/um/include/uml-config.h > UPD arch/um/include/uml-config.h > CC arch/um/sys-i386/user-offsets.s > arch/um/sys-i386/user-offsets.c:7:22: error: asm/user.h: No such file > or directory > arch/um/sys-i386/user-offsets.c: In function 'foo': > arch/um/sys-i386/user-offsets.c:51: error: invalid application of > 'sizeof' to incomplete type 'struct user_i387_struct' > arch/um/sys-i386/user-offsets.c:52: error: invalid application of > 'sizeof' to incomplete type 'struct user_fxsr_struct' > arch/um/sys-i386/user-offsets.c:70: error: invalid application of > 'sizeof' to incomplete type 'struct user_regs_struct' > make[1]: *** [arch/um/sys-i386/user-offsets.s] Error 1 > make: *** [arch/um/sys-i386/user-offsets.s] Error 2 > > > This used to work fine - I am sure the fix is quite simple, but I do > not have any spare time ATM. > > Antoine > |
From: Jeff D. <jd...@ad...> - 2007-07-13 15:57:35
|
On Fri, Jul 13, 2007 at 01:03:21PM +0100, Antoine Martin wrote: > I had updated the kernel headers and these include files have been removed. > Until UML uses some other trick, this works for me for the 64-bit build: > > cp /usr/src/linux-2.6.22.1/include/asm/user.h /usr/include/asm/user.h > cp /usr/src/linux-2.6.22.1/include/asm/page.h /usr/include/asm/page.h > cp /usr/src/linux-2.6.22.1/include/linux/const.h /usr/include/linux/const.h asm/user,h looks like a problem. The only other way I see to get the size of the FP registers is elf_fpregset_t and elf_fpxregset_t in asm/elf.h, which is exported. However, those are defined in terms of user_i387_struct and user_fxsr_struct in user.h, and it gets them with #include <asm/user.h> So, we seem to have a situation where an exported header includes a non-exported one, or the include is filtered out and we have a type with an unknown size. Could you check this there by seeing if something like this builds (with user.h removed): #include <asm/elf.h> int main(void){ printf("%d %d\n", sizeof(elf_fpregset_t), sizeof(elf_fpxregset_t)); } > cp /usr/src/linux-2.6.22.1/include/asm/page.h /usr/include/asm/page.h This one is easily fixed. > cp /usr/src/linux-2.6.22.1/include/linux/const.h /usr/include/linux/const.h What's with this? I don't include that anywhere in UML. Can you get rid of page.h and const.h (you'll have to leave user.h unfortunately) again and try the patch below? It builds for me on both i386 and x86_64. Jeff Index: linux-2.6.21-mm/arch/um/include/sysdep-i386/stub.h =================================================================== --- linux-2.6.21-mm.orig/arch/um/include/sysdep-i386/stub.h 2007-02-04 13:44:54.000000000 -0500 +++ linux-2.6.21-mm/arch/um/include/sysdep-i386/stub.h 2007-07-13 11:42:00.000000000 -0400 @@ -9,7 +9,6 @@ #include <sys/mman.h> #include <asm/ptrace.h> #include <asm/unistd.h> -#include <asm/page.h> #include "stub-data.h" #include "kern_constants.h" #include "uml-config.h" @@ -19,7 +18,7 @@ extern void stub_clone_handler(void); #define STUB_SYSCALL_RET EAX #define STUB_MMAP_NR __NR_mmap2 -#define MMAP_OFFSET(o) ((o) >> PAGE_SHIFT) +#define MMAP_OFFSET(o) ((o) >> UM_KERN_PAGE_SHIFT) static inline long stub_syscall0(long syscall) { Index: linux-2.6.21-mm/arch/um/os-Linux/main.c =================================================================== --- linux-2.6.21-mm.orig/arch/um/os-Linux/main.c 2007-07-06 13:03:34.000000000 -0400 +++ linux-2.6.21-mm/arch/um/os-Linux/main.c 2007-07-13 11:07:07.000000000 -0400 @@ -12,7 +12,6 @@ #include <sys/resource.h> #include <sys/mman.h> #include <sys/user.h> -#include <asm/page.h> #include "kern_util.h" #include "as-layout.h" #include "mem_user.h" Index: linux-2.6.21-mm/arch/um/os-Linux/skas/mem.c =================================================================== --- linux-2.6.21-mm.orig/arch/um/os-Linux/skas/mem.c 2007-07-02 21:29:06.000000000 -0400 +++ linux-2.6.21-mm/arch/um/os-Linux/skas/mem.c 2007-07-13 11:07:20.000000000 -0400 @@ -9,7 +9,6 @@ #include <unistd.h> #include <sys/mman.h> #include <sys/wait.h> -#include <asm/page.h> #include <asm/unistd.h> #include "mem_user.h" #include "mem.h" Index: linux-2.6.21-mm/arch/um/os-Linux/start_up.c =================================================================== --- linux-2.6.21-mm.orig/arch/um/os-Linux/start_up.c 2007-07-13 10:18:42.000000000 -0400 +++ linux-2.6.21-mm/arch/um/os-Linux/start_up.c 2007-07-13 11:07:29.000000000 -0400 @@ -19,7 +19,6 @@ #include <sys/mman.h> #include <sys/resource.h> #include <asm/unistd.h> -#include <asm/page.h> #include <sys/types.h> #include "kern_util.h" #include "user.h" Index: linux-2.6.21-mm/arch/um/os-Linux/tt.c =================================================================== --- linux-2.6.21-mm.orig/arch/um/os-Linux/tt.c 2007-06-28 11:39:48.000000000 -0400 +++ linux-2.6.21-mm/arch/um/os-Linux/tt.c 2007-07-13 11:07:44.000000000 -0400 @@ -17,7 +17,6 @@ #include <sys/mman.h> #include <asm/ptrace.h> #include <asm/unistd.h> -#include <asm/page.h> #include "kern_util.h" #include "user.h" #include "signal_kern.h" Index: linux-2.6.21-mm/arch/um/sys-i386/ptrace_user.c =================================================================== --- linux-2.6.21-mm.orig/arch/um/sys-i386/ptrace_user.c 2007-07-06 13:03:34.000000000 -0400 +++ linux-2.6.21-mm/arch/um/sys-i386/ptrace_user.c 2007-07-13 11:00:07.000000000 -0400 @@ -8,8 +8,6 @@ #include <errno.h> #include <unistd.h> #include "ptrace_user.h" -/* Grr, asm/user.h includes asm/ptrace.h, so has to follow ptrace_user.h */ -#include <asm/user.h> #include "kern_util.h" #include "sysdep/thread.h" #include "user.h" Index: linux-2.6.21-mm/arch/um/include/common-offsets.h =================================================================== --- linux-2.6.21-mm.orig/arch/um/include/common-offsets.h 2007-06-28 16:11:24.000000000 -0400 +++ linux-2.6.21-mm/arch/um/include/common-offsets.h 2007-07-13 11:41:51.000000000 -0400 @@ -10,6 +10,7 @@ OFFSET(HOST_TASK_PID, task_struct, pid); DEFINE(UM_KERN_PAGE_SIZE, PAGE_SIZE); DEFINE(UM_KERN_PAGE_MASK, PAGE_MASK); +DEFINE(UM_KERN_PAGE_SHIFT, PAGE_SHIFT); DEFINE(UM_NSEC_PER_SEC, NSEC_PER_SEC); DEFINE_STR(UM_KERN_EMERG, KERN_EMERG); |
From: Antoine M. <an...@na...> - 2007-07-13 17:42:28
|
Jeff Dike wrote: > On Fri, Jul 13, 2007 at 01:03:21PM +0100, Antoine Martin wrote: > >> I had updated the kernel headers and these include files have been removed. >> Until UML uses some other trick, this works for me for the 64-bit build: >> >> cp /usr/src/linux-2.6.22.1/include/asm/user.h /usr/include/asm/user.h >> cp /usr/src/linux-2.6.22.1/include/asm/page.h /usr/include/asm/page.h >> cp /usr/src/linux-2.6.22.1/include/linux/const.h /usr/include/linux/const.h >> > > asm/user,h looks like a problem. The only other way I see to get the > size of the FP registers is elf_fpregset_t and elf_fpxregset_t in > asm/elf.h, which is exported. However, those are defined in terms of > user_i387_struct and user_fxsr_struct in user.h, and it gets them with > > #include <asm/user.h> > > So, we seem to have a situation where an exported header includes a > non-exported one, or the include is filtered out and we have a type > with an unknown size. > > Could you check this there by seeing if something like this builds > (with user.h removed): > > #include <asm/elf.h> > > int main(void){ > printf("%d %d\n", sizeof(elf_fpregset_t), sizeof(elf_fpxregset_t)); > My kernel headers are also missing elf.h, so this doesn't work either... It is included in page.h: CC arch/um/sys-i386/user-offsets.s In file included from /usr/include/asm/user.h:5, from arch/um/sys-i386/user-offsets.c:7: /usr/include/asm/page.h:4:25: error: linux/const.h: No such file or directory arch/um/sys-i386/user-offsets.c: In function 'foo': arch/um/sys-i386/user-offsets.c:52: error: invalid application of 'sizeof' to incomplete type 'struct user_fxsr_struct' make[1]: *** [arch/um/sys-i386/user-offsets.s] Error 1 make: *** [arch/um/sys-i386/user-offsets.s] Error 2 > Can you get rid of page.h and const.h (you'll have to leave user.h > unfortunately) again and try the patch below? It builds for me on > both i386 and x86_64. > I get the same error as above because user.h includes asm/page.h I tried removing the include from user.h, but then I get: 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:52: error: invalid application of 'sizeof' to incomplete type 'struct user_fxsr_struct' make[1]: *** [arch/um/sys-i386/user-offsets.s] Error 1 make: *** [arch/um/sys-i386/user-offsets.s] Error 2 Antoine |
From: Jeff D. <jd...@ad...> - 2007-07-13 18:44:44
|
On Fri, Jul 13, 2007 at 06:41:24PM +0100, Antoine Martin wrote: > >Could you check this there by seeing if something like this builds > >(with user.h removed): > > > >#include <asm/elf.h> > > > >int main(void){ > > printf("%d %d\n", sizeof(elf_fpregset_t), sizeof(elf_fpxregset_t)); > > > My kernel headers are also missing elf.h, so this doesn't work either... elf.h is supposedly exported in 2.6.22, although I guess someone took the comment seriously: # These probably shouldn't be exported unifdef-y += shmparam.h unifdef-y += elf.h unifdef-y += page.h So, I have no idea how userspace is supposed to figure out how big a buffer to pass to PTRACE_GETFPREGS and PTRACE_GETFPXREGS. I think the headers are broken here. > It is included in page.h: > > CC arch/um/sys-i386/user-offsets.s > In file included from /usr/include/asm/user.h:5, > from arch/um/sys-i386/user-offsets.c:7: > /usr/include/asm/page.h:4:25: error: linux/const.h: No such file or > directory This is just broken, then. The headers should at least have no dangling includes. > I get the same error as above because user.h includes asm/page.h Hummm, I guess the header tidying people need to fix a bunch of things. I'll make whatever changes needed in UML to not use illicit headers, but I do need complete interface definitions, as with the FP stuff. Jeff -- Work email - jdike at linux dot intel dot com |
From: Antoine M. <an...@na...> - 2007-07-14 09:23:37
|
>> My kernel headers are also missing elf.h, so this doesn't work either... >> > > elf.h is supposedly exported in 2.6.22, although I guess someone took the > comment seriously: > > # These probably shouldn't be exported > unifdef-y += shmparam.h > unifdef-y += elf.h > unifdef-y += page.h > > So, I have no idea how userspace is supposed to figure out how big a > buffer to pass to PTRACE_GETFPREGS and PTRACE_GETFPXREGS. I think the > headers are broken here. > > >> It is included in page.h: >> >> CC arch/um/sys-i386/user-offsets.s >> In file included from /usr/include/asm/user.h:5, >> from arch/um/sys-i386/user-offsets.c:7: >> /usr/include/asm/page.h:4:25: error: linux/const.h: No such file or >> directory >> > > This is just broken, then. The headers should at least have no > dangling includes. > page.h wasn't there to start with, I added it by hand - so it isn't as bad, but building without page.h looks hard... > >> I get the same error as above because user.h includes asm/page.h >> > > Hummm, I guess the header tidying people need to fix a bunch of > things. I'll make whatever changes needed in UML to not use illicit > headers, but I do need complete interface definitions, as with the FP > stuff. > I don't mind bugging people to get to the bottom of this, do you know where to knock? I can't find anything in MAINTAINERS. Antoine |
From: Jeff D. <jd...@ad...> - 2007-07-14 12:00:35
|
On Sat, Jul 14, 2007 at 10:23:25AM +0100, Antoine Martin wrote: > I don't mind bugging people to get to the bottom of this, do you know > where to knock? > I can't find anything in MAINTAINERS. Did you install the headers directly from a kernel tree, or is this the result of a distro upgrade? Jeff -- Work email - jdike at linux dot intel dot com |
From: Antoine M. <an...@na...> - 2007-07-15 17:09:10
|
Jeff Dike wrote: > On Sat, Jul 14, 2007 at 10:23:25AM +0100, Antoine Martin wrote: > >> I don't mind bugging people to get to the bottom of this, do you know >> where to knock? >> I can't find anything in MAINTAINERS. >> > > Did you install the headers directly from a kernel tree, or is this > the result of a distro upgrade? > These are the Gentoo packages which are very close to mainline and I can't find the upstream location for the headers so I guess I will be filing a bug with Gentoo... We'll see where that leads. Antoine |
From: Daniel G. <da...@ge...> - 2007-07-19 01:13:03
|
On Sun, 2007-07-15 at 18:08 +0100, Antoine Martin wrote: > Jeff Dike wrote: > > On Sat, Jul 14, 2007 at 10:23:25AM +0100, Antoine Martin wrote: > > > >> I don't mind bugging people to get to the bottom of this, do you know > >> where to knock? > >> I can't find anything in MAINTAINERS. > >> > > > > Did you install the headers directly from a kernel tree, or is this > > the result of a distro upgrade? > > > These are the Gentoo packages which are very close to mainline and I > can't find the upstream location for the headers so I guess I will be > filing a bug with Gentoo... We'll see where that leads. > Actually, the Gentoo headers are not particularly close to the kernel headers. They are heavily "sanitized", meaning that all kinds of things that userspace is "not supposed to use" are removed. This makes it very hard for things like UML, that are heavily tied to the kernel, to build. Daniel |
From: Jeff D. <jd...@ad...> - 2007-07-19 01:25:40
|
On Wed, Jul 18, 2007 at 09:13:08PM -0400, Daniel Gryniewicz wrote: > Actually, the Gentoo headers are not particularly close to the kernel > headers. They are heavily "sanitized", meaning that all kinds of things > that userspace is "not supposed to use" are removed. This makes it very > hard for things like UML, that are heavily tied to the kernel, to build. UML isn't heavily tied to the kernel in the way that you mean, I think. However, it does explore some obscure parts of the API. For example, the elimination of user.h makes it impossible to use PTRACE_SETFP[X]REGS, as there is no way to tell what size buffer should be passed in. I'm all for minimizing the headers exported to userspace (and have made a small contribution in that direction - ptrace-abi.h). I'm happy to make UML stop using things it shouldn't. At the same time, it should be possible to use the full userspace API. Jeff -- Work email - jdike at linux dot intel dot com |
From: Antoine M. <an...@na...> - 2007-07-19 19:54:30
|
Daniel Gryniewicz wrote: > On Sun, 2007-07-15 at 18:08 +0100, Antoine Martin wrote: > >> Jeff Dike wrote: >> >>> On Sat, Jul 14, 2007 at 10:23:25AM +0100, Antoine Martin wrote: >>> >>> >>>> I don't mind bugging people to get to the bottom of this, do you know >>>> where to knock? >>>> I can't find anything in MAINTAINERS. >>>> >>>> >>> Did you install the headers directly from a kernel tree, or is this >>> the result of a distro upgrade? >>> >>> >> These are the Gentoo packages which are very close to mainline and I >> can't find the upstream location for the headers so I guess I will be >> filing a bug with Gentoo... We'll see where that leads. >> >> > > Actually, the Gentoo headers are not particularly close to the kernel > headers. My mistake. > They are heavily "sanitized", meaning that all kinds of things > that userspace is "not supposed to use" are removed. So in a sense, Gentoo kernel headers are ahead of the game. Which means that these changes are likely to become an issue not just for Gentoo users in the future. > This makes it very > hard for things like UML, that are heavily tied to the kernel, to build. > As Jeff pointed out, this is part of the userspace api: "the elimination of user.h makes it impossible to use PTRACE_SETFP[X]REGS, as there is no way to tell what size buffer should be passed in." Can you suggest a way to code around this issue or is this going to require an update to the Gentoo kernel headers? Let me know if I can help. Thanks Antoine |