Skip to contentSkip to conversation

2.6.13-bs3 amd64 compilation broken?

uml-devel Antoine Martin 4 participants 4 messages Oct 7, 2005 – Oct 9, 2005 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

I tried twice to be sure, but compile fails near the end:

CC arch/um/sys-x86_64/stub_segv.o
arch/um/sys-x86_64/stub_segv.c: In function `stub_segv_handler':
arch/um/sys-x86_64/stub_segv.c:41: warning: implicit declaration of function `container_of'
arch/um/sys-x86_64/stub_segv.c:41: error: parse error before "struct" make[1]: *** [arch/um/sys-x86_64/stub_segv.o] Error 1
make: *** [arch/um/sys-x86_64] Error 2

Antoine

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw
Quoted 14 lines · Antoine Martin

I tried twice to be sure, but compile fails near the end:

CC arch/um/sys-x86_64/stub_segv.o
arch/um/sys-x86_64/stub_segv.c: In function `stub_segv_handler':
arch/um/sys-x86_64/stub_segv.c:41: warning: implicit declaration of function `container_of'
arch/um/sys-x86_64/stub_segv.c:41: error: parse error before "struct" make[1]: *** [arch/um/sys-x86_64/stub_segv.o] Error 1
make: *** [arch/um/sys-x86_64] Error 2

Antoine

Quoted 11 lines

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

I've got no such errors compiling 2.6.13-bs9 (probably one version further, I'm not sure about the version). Try the latest 'bs patch' and the latest vanilla kernel version (2.6.13-3) and the error should be gone.

Signature · 17 lines
Saudações

Alan Menegotto
Depto de Informática
Grupo Centro Clínico
Fone: (51) 3287-9234



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#2 lore raw
Quoted 11 lines · Alan Menegotto
Quoted 10 lines · Antoine Martin

I tried twice to be sure, but compile fails near the end:

CC arch/um/sys-x86_64/stub_segv.o
arch/um/sys-x86_64/stub_segv.c: In function `stub_segv_handler':
arch/um/sys-x86_64/stub_segv.c:41: warning: implicit declaration of function `container_of'
arch/um/sys-x86_64/stub_segv.c:41: error: parse error before "struct" make[1]: *** [arch/um/sys-x86_64/stub_segv.o] Error 1
make: *** [arch/um/sys-x86_64] Error 2

Quoted 5 lines
Quoted 1 line

Antoine

I've got no such errors compiling 2.6.13-bs9 (probably one version further, I'm not sure about the version). Try the latest 'bs patch' and the latest vanilla kernel version (2.6.13-3) and the error should be gone.

Probably you tried 2.6.12-bs9 - 2.6.13 latest -bs is 3.

Also, this was added in -bs3, to fix another problem.

Try the attached patch.

Signature · 3 lines
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

uml: compile-time fix for x86_64 frame pointer fix

From: Paolo 'Blaisorblade' Giarrusso <[email protected]>

This should fix the compile-time error on x86_64. We can't get container_of from host headers, since it's new in 2.6. offsetof, instead, is ANSI C. But it's untested.

Jeff, stick this with the original patch when sending it upstream (it's introduced by your fix for frame-pointer-less x86_64 binaries).

After Antoine Martin tested this on his build environment, anyway.

arch/um/sys-x86_64/stub_segv.c +6 -0
Index: linux-2.6.13/arch/um/sys-x86_64/stub_segv.c
===================================================================
@@ -9,6 +9,7 @@
 #include "uml-config.h"
 #include "sysdep/sigcontext.h"
 #include "sysdep/faultinfo.h"
+#include <stddef.h>
 
 /* Copied from sys-x86_64/signal.c - Can't find an equivalent definition
  * in the libc headers anywhere.
@@ -20,6 +21,11 @@ struct rt_sigframe
         struct siginfo info;
 };
 
+/* Copied here from <linux/kernel.h> - we're userspace. */
+#define container_of(ptr, type, member) ({			\
+        const typeof( ((type *)0)->member ) *__mptr = (ptr);	\
+        (type *)( (char *)__mptr - offsetof(type,member) );})
+
 void __attribute__ ((__section__ (".__syscall_stub")))
 stub_segv_handler(int sig)
 {
#3 lore raw
Quoted 2 lines · Blaisorblade

Jeff, stick this with the original patch when sending it upstream (it's introduced by your fix for frame-pointer-less x86_64 binaries).

Done, thanks.

Jeff

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel