Skip to contentSkip to conversation

Fix build on FreeBSD

PATCH In review Nathan Whitehorn 3 participants 4 messages May 31, 2011 – Jun 7, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix build on FreeBSD

Add some includes required to build qemu on FreeBSD.

---
 bsd-user/syscall.c |    2 ++
 iohandler.c        |    1 +
 os-posix.c         |    4 ++++
 3 files changed, 7 insertions(+), 0 deletions(-)
bsd-user/syscall.c +0 -0
index eb1cdf2..7b49f54 100644
@@ -212,9 +212,11 @@ static int sysctl_oldcvt(void *holdp, size_t holdlen, uint3

2_t kind)

         *(uint64_t *)holdp = tswap64(*(unsigned long *)holdp);
         break;
 #endif
+#ifdef CTLTYPE_QUAD
     case CTLTYPE_QUAD:
         *(uint64_t *)holdp = tswap64(*(uint64_t *)holdp);
         break;
+#endif
     case CTLTYPE_STRING:
         break;
     default:
iohandler.c +1 -0
index 2b82421..7266aca 100644
@@ -29,6 +29,7 @@
 
 #ifndef _WIN32
 #include <sys/wait.h>
+#include <signal.h>
 #endif
 
 typedef struct IOHandlerRecord {
os-posix.c +4 -0
index 3204197..13b7229 100644
@@ -44,6 +44,10 @@
 #include <sys/syscall.h>
 #endif
 
+#ifdef CONFIG_BSD
+#include <sys/sysctl.h>
+#endif
+
 #ifdef CONFIG_EVENTFD
 #include <sys/eventfd.h>
 #endif
#1 lore raw

Am 31.05.2011 um 16:57 schrieb Nathan Whitehorn:

Quoted 1 line

Add some includes required to build qemu on FreeBSD.

Missing Sob.

Quoted 5 lines

---

bsd-user/syscall.c |    2 ++
iohandler.c        |    1 +
os-posix.c         |    4 ++++
3 files changed, 7 insertions(+), 0 deletions(-)

[...]

iohandler.c line 35

Quoted 12 lines
iohandler.c +1 -0
index 2b82421..7266aca 100644
@@ -29,6 +29,7 @@
 
 #ifndef _WIN32
 #include <sys/wait.h>
+#include <signal.h>
 #endif
 
 typedef struct IOHandlerRecord {

This is independent of the other BSD issues (that I cannot judge) and affects Darwin and Haiku as well. Did you check that with your patch Win32 does not need the header?

Alexandre (cc'ed) posted a slightly different patch, adding it in qemu-common.h instead.

Andreas

#2 lore raw
Quoted 5 lines · Andreas Färber

Am 31.05.2011 um 16:57 schrieb Nathan Whitehorn:

Quoted 1 line

Add some includes required to build qemu on FreeBSD.

Missing Sob.

Oops, I'll resubmit.

Quoted 17 lines
Quoted 5 lines

---

bsd-user/syscall.c |    2 ++
iohandler.c        |    1 +
os-posix.c         |    4 ++++
3 files changed, 7 insertions(+), 0 deletions(-)

[...]

Quoted 11 lines
iohandler.c +1 -0
index 2b82421..7266aca 100644
@@ -29,6 +29,7 @@
 
 #ifndef _WIN32
 #include <sys/wait.h>
+#include <signal.h>
 #endif
 
Quoted 5 lines

iohandler.c line 35

Quoted 1 line
iohandler.c +0 -0
 typedef struct IOHandlerRecord {

This is independent of the other BSD issues (that I cannot judge) and affects Darwin and Haiku as well. Did you check that with your patch Win32 does not need the header?

Alexandre (cc'ed) posted a slightly different patch, adding it in qemu-common.h instead.

Ah, that's fine then. I have no idea about Win32, I just know it won't compile on FreeBSD without it, since it hasn't been included yet as a side effect. -Nathan

#3 lore raw

Hi Nathan,

Quoted 37 lines · Nathan Whitehorn
Quoted 6 lines · Andreas Färber

Am 31.05.2011 um 16:57 schrieb Nathan Whitehorn:

Quoted 1 line

Add some includes required to build qemu on FreeBSD.

Missing Sob.

Oops, I'll resubmit.

Quoted 27 lines
Quoted 5 lines

---
bsd-user/syscall.c |    2 ++ iohandler.c        |    1 + os-posix.c         |    4 ++++

3 files changed, 7 insertions(+), 0 deletions(-)

[...]

iohandler.c line 35

Quoted 13 lines
iohandler.c +1 -0
index 2b82421..7266aca 100644
@@ -29,6 +29,7 @@
 
 #ifndef _WIN32
 #include <sys/wait.h>
+#include <signal.h>
 #endif
 
 typedef struct IOHandlerRecord {

This is independent of the other BSD issues (that I cannot judge) and affects Darwin and Haiku as well. Did you check that with your patch Win32 does not need the header?

Alexandre (cc'ed) posted a slightly different patch, adding it in qemu-common.h instead.

Normally, the following patch should solve this particular missing header. It's already been added to the trivial patches queue by Stefan.
http://patchwork.ozlabs.org/patch/98325/

Alexandre