All of lore.kernel.org
 help / color / mirror / Atom feed
From: Blaisorblade <blaisorblade@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net
Cc: Alan Menegotto <macnish@gmail.com>
Subject: Re: [uml-devel] 2.6.13-bs3 amd64 compilation broken?
Date: Fri, 7 Oct 2005 19:37:27 +0200	[thread overview]
Message-ID: <200510071937.27810.blaisorblade@yahoo.it> (raw)
In-Reply-To: <43467BEE.7000503@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]

On Friday 07 October 2005 15:45, Alan Menegotto wrote:
> Antoine Martin wrote:
> >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

> 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.
-- 
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

[-- Attachment #2: uml-early-x86_64-crash-fix-compile --]
[-- Type: text/x-diff, Size: 1444 bytes --]

uml: compile-time fix for x86_64 frame pointer fix

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

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.

Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Index: linux-2.6.13/arch/um/sys-x86_64/stub_segv.c
===================================================================
--- linux-2.6.13.orig/arch/um/sys-x86_64/stub_segv.c
+++ 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)
 {

  reply	other threads:[~2005-10-07 17:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-07 14:28 [uml-devel] 2.6.13-bs3 amd64 compilation broken? Antoine Martin
2005-10-07 13:45 ` Alan Menegotto
2005-10-07 17:37   ` Blaisorblade [this message]
2005-10-09 18:24     ` Jeff Dike

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200510071937.27810.blaisorblade@yahoo.it \
    --to=blaisorblade@yahoo.it \
    --cc=macnish@gmail.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.