Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 189616 - build of a user mode linux kernel failed for 2.6.2x
Summary: build of a user mode linux kernel failed for 2.6.2x
Status: RESOLVED DUPLICATE of bug 182089
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-20 17:07 UTC by Toralf Förster
Modified: 2007-08-22 07:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2007-08-20 17:07:36 UTC
Regardless of the sources I tried (plain Vanilla, Gentoo or latest git version) I cannot build an UML. I always get:

n22 /usr/src/linux-2.6.21-gentoo-r4 # make linux ARCH=um
scripts/kconfig/conf -s arch/um/Kconfig
net/bluetooth/hidp/Kconfig:4:warning: 'select' used by config symbol 'BT_HIDP' refer 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:4: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


Reproducible: Always
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-08-20 17:38:48 UTC

*** This bug has been marked as a duplicate of bug 170544 ***
Comment 2 Toralf Förster gentoo-dev 2007-08-22 07:32:49 UTC
After I applied the patch (see below) I run into another compile error.
I'd like to reopen this bug b/c
(1) there is an issue with current kernels too
(2) there is another issue beside the inlcude of user.h
(3) I cannot reopen the original bug #170544


Here's what I got from Jeff Dike:

On Mon, Aug 20, 2007 at 05:30:37PM +0200, Toralf Förster wrote:
> I found this in /usr/include/sys/user.h (the file was installed from
> glibc-2.5-r4): 

sys/user works for me - try the patch below.

                                Jeff

-- 
Work email - jdike at linux dot intel dot com

Index: linux-2.6.22/arch/um/sys-i386/user-offsets.c
===================================================================
--- linux-2.6.22.orig/arch/um/sys-i386/user-offsets.c
+++ linux-2.6.22/arch/um/sys-i386/user-offsets.c
@@ -2,9 +2,9 @@
 #include <stddef.h>
 #include <signal.h>
 #include <sys/poll.h>
+#include <sys/user.h>
 #include <sys/mman.h>
 #include <asm/ptrace.h>
-#include <asm/user.h>
 
 #define DEFINE(sym, val) \
        asm volatile("\n->" #sym " %0 " #val : : "i" (val))
@@ -48,8 +48,8 @@ void foo(void)
        OFFSET(HOST_SC_FP_ST, _fpstate, _st);
        OFFSET(HOST_SC_FXSR_ENV, _fpstate, _fxsr_env);
 
-       DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_i387_struct));
-       DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fxsr_struct));
+       DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_fpregs_struct));
+       DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fpxregs_struct));
 
        DEFINE(HOST_IP, EIP);
        DEFINE(HOST_SP, UESP);
Index: linux-2.6.22/arch/um/sys-x86_64/user-offsets.c
===================================================================
--- linux-2.6.22.orig/arch/um/sys-x86_64/user-offsets.c
+++ linux-2.6.22/arch/um/sys-x86_64/user-offsets.c
@@ -3,17 +3,10 @@
 #include <signal.h>
 #include <sys/poll.h>
 #include <sys/mman.h>
+#include <sys/user.h>
 #define __FRAME_OFFSETS
 #include <asm/ptrace.h>
 #include <asm/types.h>
-/* For some reason, x86_64 defines u64 and u32 only in <pci/types.h>, which I
- * refuse to include here, even though they're used throughout the headers.
- * These are used in asm/user.h, and that include can't be avoided because of
- * the sizeof(struct user_regs_struct) below.
- */
-typedef __u64 u64;
-typedef __u32 u32;
-#include <asm/user.h>
 
 #define DEFINE(sym, val) \
         asm volatile("\n->" #sym " %0 " #val : : "i" (val))
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-08-22 07:38:15 UTC
Yes, as said on the other bug, this is known upstream but not fixed in vanilla kernel yet; so you'll have to wait until it gets in, or use the patched usermode-sources meanwhile.

*** This bug has been marked as a duplicate of bug 182089 ***