* [Qemu-devel] Re: [Qemu-commits] [COMMIT 74d753a] linux-user: strace now handles guest stringscorrectly [v2]
[not found] ` <761ea48b0906170032g318457e4p81d028375971f2b2@mail.gmail.com>
@ 2009-06-17 12:41 ` Martin Mohring
0 siblings, 0 replies; 3+ messages in thread
From: Martin Mohring @ 2009-06-17 12:41 UTC (permalink / raw)
To: Laurent Desnogues
Cc: Anthony Liguori, Riku Voipio, Mika Westerberg, qemu-devel
Laurent Desnogues wrote:
> On Wed, Jun 17, 2009 at 9:18 AM, Riku Voipio<riku.voipio@iki.fi> wrote:
>
>> On Wed, Jun 17, 2009 at 02:27:06AM +0400, malc wrote:
>>
>>> On Tue, 16 Jun 2009, Anthony Liguori wrote:
>>> On my system the above line causes gcc to emit:
>>>
>>> In file included from /home/malc/x/rcs/git/qemu/linux-user/strace.c:12:
>>> /usr/include/linux/futex.h:48: error: field `__user' has incomplete type
>>> /usr/include/linux/futex.h:48: error: syntax error before '*' token
>>> /usr/include/linux/futex.h:63: error: field `list' has incomplete type
>>> /usr/include/linux/futex.h:83: error: field `__user' has incomplete type
>>> /usr/include/linux/futex.h:83: error: syntax error before '*' token
>>> make[1]: *** [strace.o] Error 1
>>>
>>> Following fixes it, but i wonder if there's better way:
>>>
>> It doesn't look like your kernel headers have been sanitized beforing installing.
>> futex.h exposed to userspace shouldn't have __user anywhere.
>>
>> Previously distros did that by hand, nowadays you can do a "make headers_install"
>> in the kernel tree itself.
>>
>
> I got something different on my CentOS 5.3 x86_64:
>
> /usr/include/linux/futex.h:108: error: expected ‘)’ before ‘*’ token
> /usr/include/linux/futex.h:112: error: expected ‘)’ before ‘*’ token
>
> Apparently it lacks u32 definition.
>
>
> Laurent
>
I did some bigger compile test after the big user mode patch pull from
yesterday for all the patches Riku and me had collected in the past
weeks. I applied already the "__user patch". Also I had to disable
"-Werror" option, because there are still too much warnings inside now
causing an error.
Results:
CentOS 5 / RHEL 5 (i586/x86_64): - CentOS 5 was already reported
> In file included from
> /usr/src/redhat/BUILD/qemu-0.11git2009.06.16.1935/linux-user/strace.c:12:
> /usr/include/linux/futex.h:96: error: expected ')' before '*' token
> /usr/include/linux/futex.h:100: error: expected ')' before '*' token
Debian Etch/Lenny (i586/x86_64): builds
Fedora 9/10 (i586/x86_64): builds
SLES 11/openSUSE 11.0/openSUSE 11.1 (i586/x86_64): builds
Ubuntu 8.10/9.04 (i586/x86_64): builds
Regards, Martin
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] Re: [Qemu-commits] [COMMIT 74d753a] linux-user: strace now handles guest stringscorrectly [v2]
[not found] ` <4A38449B.5050204@us.ibm.com>
@ 2009-06-18 19:51 ` Riku Voipio
2009-06-18 22:53 ` malc
0 siblings, 1 reply; 3+ messages in thread
From: Riku Voipio @ 2009-06-18 19:51 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel
On Tue, Jun 16, 2009 at 08:19:23PM -0500, Anthony Liguori wrote:
> malc wrote:
>>
>> On my system the above line causes gcc to emit:
>>
>> In file included from /home/malc/x/rcs/git/qemu/linux-user/strace.c:12:
>> /usr/include/linux/futex.h:48: error: field `__user' has incomplete type
>> /usr/include/linux/futex.h:48: error: syntax error before '*' token
>> /usr/include/linux/futex.h:63: error: field `list' has incomplete type
>> /usr/include/linux/futex.h:83: error: field `__user' has incomplete type
>> /usr/include/linux/futex.h:83: error: syntax error before '*' token
>> make[1]: *** [strace.o] Error 1
> We had the same problem with usb-linux.c. It's broken system headers,
> the __user stuff is supposed to get removed as part of the headers
> installation.
> It builds fine on my system (Fedora 10).
Howabout something like this:
commit eb8387cb0eda32a18880664eb5f0ca5c8bf05b45
Author: Riku Voipio <riku.voipio@iki.fi>
Date: Thu Jun 18 22:44:31 2009 +0300
Subject: linux-user: include futex defines directly
Since some common distributions have broken linux/futex.h, stop
including it. Instead add the defines directly.
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
diff --git a/linux-user/strace.c b/linux-user/strace.c
index 5ea9acb..6090dcc 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -8,7 +8,6 @@
#include <sys/types.h>
#include <sys/mount.h>
#include <sys/mman.h>
-#include <linux/futex.h>
#include <unistd.h>
#include "qemu.h"
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 53a11ab..11564fd 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -85,7 +85,6 @@
#include "qemu-common.h"
#if defined(USE_NPTL)
-#include <linux/futex.h>
#define CLONE_NPTL_FLAGS2 (CLONE_SETTLS | \
CLONE_PARENT_SETTID | CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID)
#else
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 24217e4..acb781f 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2120,3 +2120,20 @@ struct target_mq_attr {
#include "socket.h"
#include "errno_defs.h"
+
+#define FUTEX_WAIT 0
+#define FUTEX_WAKE 1
+#define FUTEX_FD 2
+#define FUTEX_REQUEUE 3
+#define FUTEX_CMP_REQUEUE 4
+#define FUTEX_WAKE_OP 5
+#define FUTEX_LOCK_PI 6
+#define FUTEX_UNLOCK_PI 7
+#define FUTEX_TRYLOCK_PI 8
+#define FUTEX_WAIT_BITSET 9
+#define FUTEX_WAKE_BITSET 10
+
+#define FUTEX_PRIVATE_FLAG 128
+#define FUTEX_CLOCK_REALTIME 256
+#define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
+
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Qemu-devel] Re: [Qemu-commits] [COMMIT 74d753a] linux-user: strace now handles guest stringscorrectly [v2]
2009-06-18 19:51 ` Riku Voipio
@ 2009-06-18 22:53 ` malc
0 siblings, 0 replies; 3+ messages in thread
From: malc @ 2009-06-18 22:53 UTC (permalink / raw)
To: Riku Voipio; +Cc: Anthony Liguori, qemu-devel
On Thu, 18 Jun 2009, Riku Voipio wrote:
> On Tue, Jun 16, 2009 at 08:19:23PM -0500, Anthony Liguori wrote:
> > malc wrote:
> >>
> >> On my system the above line causes gcc to emit:
> >>
> >> In file included from /home/malc/x/rcs/git/qemu/linux-user/strace.c:12:
> >> /usr/include/linux/futex.h:48: error: field `__user' has incomplete type
> >> /usr/include/linux/futex.h:48: error: syntax error before '*' token
> >> /usr/include/linux/futex.h:63: error: field `list' has incomplete type
> >> /usr/include/linux/futex.h:83: error: field `__user' has incomplete type
> >> /usr/include/linux/futex.h:83: error: syntax error before '*' token
> >> make[1]: *** [strace.o] Error 1
>
> > We had the same problem with usb-linux.c. It's broken system headers,
> > the __user stuff is supposed to get removed as part of the headers
> > installation.
>
> > It builds fine on my system (Fedora 10).
>
> Howabout something like this:
>
> commit eb8387cb0eda32a18880664eb5f0ca5c8bf05b45
> Author: Riku Voipio <riku.voipio@iki.fi>
> Date: Thu Jun 18 22:44:31 2009 +0300
> Subject: linux-user: include futex defines directly
>
> Since some common distributions have broken linux/futex.h, stop
> including it. Instead add the defines directly.
>
> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
>
[..snip..]
Works for me.
--
mailto:av1474@comtv.ru
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-18 22:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200906161934.n5GJYBvD030723@d01av04.pok.ibm.com>
[not found] ` <Pine.LNX.4.64.0906170224150.3846@linmac.oyster.ru>
[not found] ` <20090617071833.GA5636@kos.to>
[not found] ` <761ea48b0906170032g318457e4p81d028375971f2b2@mail.gmail.com>
2009-06-17 12:41 ` [Qemu-devel] Re: [Qemu-commits] [COMMIT 74d753a] linux-user: strace now handles guest stringscorrectly [v2] Martin Mohring
[not found] ` <4A38449B.5050204@us.ibm.com>
2009-06-18 19:51 ` Riku Voipio
2009-06-18 22:53 ` malc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).