Skip to contentSkip to conversation

compile problem

uml-devel Jiri Olsa 2 participants 5 messages Feb 10, 2008 – Feb 13, 2008 User-mode Linux (UML)

lore
Share & tools
lore

Jiri Olsa

author
#0 lore raw

Hi,

I have problem with last Linus' git tree:

scripts/kconfig/conf -s arch/um/Kconfig
SYMLINK arch/um/include/kern_constants.h
SYMLINK arch/um/include/sysdep

  CHK     arch/um/include/uml-config.h
  UPD     arch/um/include/uml-config.h
  CC      arch/um/sys-i386/user-offsets.s
In file included from /usr/include/asm/ptrace.h:5,
                 from arch/um/sys-i386/user-offsets.c:7:

/usr/include/asm/ptrace-abi.h:92: error: expected specifier-qualifier-list before 'u32' arch/um/sys-i386/user-offsets.c: In function 'foo':
arch/um/sys-i386/user-offsets.c:20: error: 'struct sigcontext' has no member named 'eip' arch/um/sys-i386/user-offsets.c:21: error: 'struct sigcontext' has no member named 'esp' arch/um/sys-i386/user-offsets.c:28: error: 'struct sigcontext' has no member named 'eflags' arch/um/sys-i386/user-offsets.c:29: error: 'struct sigcontext' has no member named 'eax' arch/um/sys-i386/user-offsets.c:30: error: 'struct sigcontext' has no member named 'ebx' arch/um/sys-i386/user-offsets.c:31: error: 'struct sigcontext' has no member named 'ecx' arch/um/sys-i386/user-offsets.c:32: error: 'struct sigcontext' has no member named 'edx' arch/um/sys-i386/user-offsets.c:33: error: 'struct sigcontext' has no member named 'edi' arch/um/sys-i386/user-offsets.c:34: error: 'struct sigcontext' has no member named 'esi' arch/um/sys-i386/user-offsets.c:35: error: 'struct sigcontext' has no member named 'ebp' make[1]: *** [arch/um/sys-i386/user-offsets.s] Error 1
make: *** [arch/um/sys-i386/user-offsets.s] Error 2

v2.6.24 is working for me...

thanks,
Jiri Olsa

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw
Quoted 7 lines · Jiri Olsa

Hi,

I have problem with last Linus' git tree:

scripts/kconfig/conf -s arch/um/Kconfig
SYMLINK arch/um/include/kern_constants.h
SYMLINK arch/um/include/sysdep

Quoted 6 lines
  CHK     arch/um/include/uml-config.h
  UPD     arch/um/include/uml-config.h
  CC      arch/um/sys-i386/user-offsets.s
In file included from /usr/include/asm/ptrace.h:5,
                 from arch/um/sys-i386/user-offsets.c:7:

/usr/include/asm/ptrace-abi.h:92: error: expected specifier-qualifier-list before 'u32'

This looks like a bug in your headers. ptrace-abi includes <asm/types.h>, apparently to get the likes of u32, but they're not there.

Quoted 3 lines

arch/um/sys-i386/user-offsets.c: In function 'foo':
arch/um/sys-i386/user-offsets.c:20: error: 'struct sigcontext' has no member named 'eip'

This is a bit of a problem. You installed new headers, which have the 'e' removed from the register names, but I can't just change UML because that will break compilation on current hosts with existing headers.

Jeff

Signature · 10 lines
Work email - jdike at linux dot intel dot com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#4 lore raw
In reply to Jiri Olsa
Quoted 2 lines · Jiri Olsa

arch/um/sys-i386/user-offsets.c:20: error: 'struct sigcontext' has no member named 'eip' arch/um/sys-i386/user-offsets.c:21: error: 'struct sigcontext' has no member named 'esp'

This turns out not to be such a big problem after all. This stuff isn't used, so it can just be deleted.

Try the patch below.

Jeff

Signature · 95 lines
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	2007-11-14 10:33:29.000000000 -0500
+++ linux-2.6.22/arch/um/sys-i386/user-offsets.c	2008-02-11 20:10:56.000000000 -0500
@@ -17,36 +17,9 @@
 
 void foo(void)
 {
-	OFFSET(HOST_SC_IP, sigcontext, eip);
-	OFFSET(HOST_SC_SP, sigcontext, esp);
-	OFFSET(HOST_SC_FS, sigcontext, fs);
-	OFFSET(HOST_SC_GS, sigcontext, gs);
-	OFFSET(HOST_SC_DS, sigcontext, ds);
-	OFFSET(HOST_SC_ES, sigcontext, es);
-	OFFSET(HOST_SC_SS, sigcontext, ss);
-	OFFSET(HOST_SC_CS, sigcontext, cs);
-	OFFSET(HOST_SC_EFLAGS, sigcontext, eflags);
-	OFFSET(HOST_SC_EAX, sigcontext, eax);
-	OFFSET(HOST_SC_EBX, sigcontext, ebx);
-	OFFSET(HOST_SC_ECX, sigcontext, ecx);
-	OFFSET(HOST_SC_EDX, sigcontext, edx);
-	OFFSET(HOST_SC_EDI, sigcontext, edi);
-	OFFSET(HOST_SC_ESI, sigcontext, esi);
-	OFFSET(HOST_SC_EBP, sigcontext, ebp);
 	OFFSET(HOST_SC_TRAPNO, sigcontext, trapno);
 	OFFSET(HOST_SC_ERR, sigcontext, err);
 	OFFSET(HOST_SC_CR2, sigcontext, cr2);
-	OFFSET(HOST_SC_FPSTATE, sigcontext, fpstate);
-	OFFSET(HOST_SC_SIGMASK, sigcontext, oldmask);
-	OFFSET(HOST_SC_FP_CW, _fpstate, cw);
-	OFFSET(HOST_SC_FP_SW, _fpstate, sw);
-	OFFSET(HOST_SC_FP_TAG, _fpstate, tag);
-	OFFSET(HOST_SC_FP_IPOFF, _fpstate, ipoff);
-	OFFSET(HOST_SC_FP_CSSEL, _fpstate, cssel);
-	OFFSET(HOST_SC_FP_DATAOFF, _fpstate, dataoff);
-	OFFSET(HOST_SC_FP_DATASEL, _fpstate, datasel);
-	OFFSET(HOST_SC_FP_ST, _fpstate, _st);
-	OFFSET(HOST_SC_FXSR_ENV, _fpstate, _fxsr_env);
 
 	DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_fpregs_struct));
 	DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fpxregs_struct));
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	2007-11-14 10:33:29.000000000 -0500
+++ linux-2.6.22/arch/um/sys-x86_64/user-offsets.c	2008-02-11 19:21:27.000000000 -0500
@@ -19,37 +19,9 @@
 
 void foo(void)
 {
-	OFFSET(HOST_SC_RBX, sigcontext, rbx);
-	OFFSET(HOST_SC_RCX, sigcontext, rcx);
-	OFFSET(HOST_SC_RDX, sigcontext, rdx);
-	OFFSET(HOST_SC_RSI, sigcontext, rsi);
-	OFFSET(HOST_SC_RDI, sigcontext, rdi);
-	OFFSET(HOST_SC_RBP, sigcontext, rbp);
-	OFFSET(HOST_SC_RAX, sigcontext, rax);
-	OFFSET(HOST_SC_R8, sigcontext, r8);
-	OFFSET(HOST_SC_R9, sigcontext, r9);
-	OFFSET(HOST_SC_R10, sigcontext, r10);
-	OFFSET(HOST_SC_R11, sigcontext, r11);
-	OFFSET(HOST_SC_R12, sigcontext, r12);
-	OFFSET(HOST_SC_R13, sigcontext, r13);
-	OFFSET(HOST_SC_R14, sigcontext, r14);
-	OFFSET(HOST_SC_R15, sigcontext, r15);
-	OFFSET(HOST_SC_IP, sigcontext, rip);
-	OFFSET(HOST_SC_SP, sigcontext, rsp);
 	OFFSET(HOST_SC_CR2, sigcontext, cr2);
 	OFFSET(HOST_SC_ERR, sigcontext, err);
 	OFFSET(HOST_SC_TRAPNO, sigcontext, trapno);
-	OFFSET(HOST_SC_CS, sigcontext, cs);
-	OFFSET(HOST_SC_FS, sigcontext, fs);
-	OFFSET(HOST_SC_GS, sigcontext, gs);
-	OFFSET(HOST_SC_EFLAGS, sigcontext, eflags);
-	OFFSET(HOST_SC_SIGMASK, sigcontext, oldmask);
-#if 0
-	OFFSET(HOST_SC_ORIG_RAX, sigcontext, orig_rax);
-	OFFSET(HOST_SC_DS, sigcontext, ds);
-	OFFSET(HOST_SC_ES, sigcontext, es);
-	OFFSET(HOST_SC_SS, sigcontext, ss);
-#endif
 
 	DEFINE(HOST_FP_SIZE, sizeof(struct _fpstate) / sizeof(unsigned long));
 	DEFINE(HOST_XFP_SIZE, 0);

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
author
#2 lore raw
In reply to Jeff Dike

Hi,

<asm/types.h> declares u32 only if there's __KERNEL__ defined, which is not case of UML compile.

I found out the ptrace-abi.h is changed in the 2.6.24.1 and differs with the Linus tree among others with adding following structure:

struct ptrace_bts_config {
        /* requested or actual size of BTS buffer in bytes */
        u32 size;
        /* bitmask of below flags */
        u32 flags;
        /* buffer overflow signal */
        u32 signal;
        /* actual size of bts_struct in bytes */
        u32 bts_size;
};

so thats where the u32 cames from in the Linus' tree.

Now when I know why my Linus' tree wont compile, I'd like to know why yours does :) (I used your patch regarding the foo function errors as well...)
Maybe I have smth wrong with my headers, I use following symlinks:

/usr/include/linux -> $(kernel)/include/linux /usr/include/asm -> $(kernel)/include/asm-x86 /usr/include/asm-generic -> $(kernel)/include/asm-generic

thanks,
jirka

Quoted 23 lines · Jeff Dike
Quoted 7 lines · Jiri Olsa

Hi,

I have problem with last Linus' git tree:

scripts/kconfig/conf -s arch/um/Kconfig
SYMLINK arch/um/include/kern_constants.h
SYMLINK arch/um/include/sysdep

Quoted 6 lines
  CHK     arch/um/include/uml-config.h
  UPD     arch/um/include/uml-config.h
  CC      arch/um/sys-i386/user-offsets.s
In file included from /usr/include/asm/ptrace.h:5,
                 from arch/um/sys-i386/user-offsets.c:7:

/usr/include/asm/ptrace-abi.h:92: error: expected specifier-qualifier-list before 'u32'

This looks like a bug in your headers. ptrace-abi includes <asm/types.h>, apparently to get the likes of u32, but they're not there.

Quoted 3 lines

arch/um/sys-i386/user-offsets.c: In function 'foo':
arch/um/sys-i386/user-offsets.c:20: error: 'struct sigcontext' has no member named 'eip'

Quoted 7 lines

This is a bit of a problem. You installed new headers, which have the 'e' removed from the register names, but I can't just change UML because that will break compilation on current hosts with existing headers.

Jeff

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#3 lore raw
Quoted 2 lines · Jiri Olsa

<asm/types.h> declares u32 only if there's __KERNEL__ defined, which is not case of UML compile.

And anything else that uses ptrace.

Quoted 1 line

Now when I know why my Linus' tree wont compile, I'd like to know why yours does :)

Because you have this header installed as your system ptrace-abi...

Quoted 5 lines

(I used your patch regarding the foo function errors as well...) Maybe I have smth wrong with my headers, I use following symlinks:

/usr/include/linux -> $(kernel)/include/linux
/usr/include/asm -> $(kernel)/include/asm-x86

This is the one - you're not supposed to do that any more. No distro has done this in probably 10 years. You're supposed to use the sanitized libc headers that come with your distro.

Jeff

Signature · 10 lines
Work email - jdike at linux dot intel dot com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel