Skip to contentSkip to conversation

tools/misc/xencov.c: build failure on NetBSD

DISCUSSION Christoph Egger 3 participants 8 messages May 14, 2013 – May 30, 2013

lore
Share & tools
lore
#0 lore raw

Hi,

tools/misc/xencov.c fails to build.
NetBSD does not have MAP_LOCKED.

Christoph

#1 lore raw
Quoted 8 lines · Christoph Egger <chegger <at> amazon.de> writes:

Hi,

tools/misc/xencov.c fails to build.
NetBSD does not have MAP_LOCKED.

Christoph

I wanted to test 4.3 on NetBSD but ended up with this problem too... In fact this happened before in other parts of the code...
http://lists.xen.org/archives/html/xen-devel/2012-06/msg00576.html

I guess this would fix it...

#ifdef __NetBSD__
/* MAP_LOCKED is Linux specific. MAP_WIRED is NetBSD's equivalent. */ #define MAP_LOCKED MAP_WIRED
#endif

Sadly I came across another error, still searching if it was already posted, otherwise I will!

#2 lore raw
Quoted 3 lines

Sadly I came across another error, still searching if it was already posted, otherwise I will!

Acctually the other error was about libxl (array subscript has type 'char' ) this was already mentioned!

Quoted 4 lines
#5 lore raw
In reply to Miguel Clara
Quoted 8 lines · Miguel Clara
Quoted 6 lines · Christoph Egger <chegger <at> amazon.de> writes:

Hi,

tools/misc/xencov.c fails to build.
NetBSD does not have MAP_LOCKED.

Quoted 8 lines
Quoted 2 lines

Christoph

I wanted to test 4.3 on NetBSD but ended up with this problem too... In fact this happened before in other parts of the code...
http://lists.xen.org/archives/html/xen-devel/2012-06/msg00576.html

I guess this would fix it...

Please can you confirm and if so submit a patch

See http://wiki.xen.org/wiki/Submitting_Xen_Patches for some hints on how to do that.

Quoted 18 lines

#ifdef __NetBSD__
/* MAP_LOCKED is Linux specific. MAP_WIRED is NetBSD's equivalent. */ #define MAP_LOCKED MAP_WIRED
#endif

Sadly I came across another error, still searching if it was already posted, otherwise I will!

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw
In reply to Miguel Clara
Quoted 6 lines · Miguel Clara
Quoted 3 lines

Sadly I came across another error, still searching if it was already posted, otherwise I will!

Acctually the other error was about libxl (array subscript has type 'char' ) this was already mentioned!

DO you have a reference? Was there a patch?

Ian.

#6 lore raw
In reply to Ian Campbell

For now I simply added the code to tools/misc/xencov.c

Not sure if its the best way to do it.

Quoted 16 lines · Ian Campbell
Quoted 15 lines · Miguel Clara
Quoted 8 lines · Christoph Egger <chegger <at> amazon.de> writes:

Hi,

tools/misc/xencov.c fails to build.
NetBSD does not have MAP_LOCKED.

Christoph

I wanted to test 4.3 on NetBSD but ended up with this problem too... In fact this happened before in other parts of the code...
http://lists.xen.org/archives/html/xen-devel/2012-06/msg00576.html

Quoted 27 lines
Quoted 1 line

I guess this would fix it...

Please can you confirm and if so submit a patch

See http://wiki.xen.org/wiki/Submitting_Xen_Patches for some hints on how to do that.

Quoted 18 lines

#ifdef __NetBSD__
/* MAP_LOCKED is Linux specific. MAP_WIRED is NetBSD's equivalent. */ #define MAP_LOCKED MAP_WIRED
#endif

Sadly I came across another error, still searching if it was already posted, otherwise I will!

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

xencov.c_netbsd.patch renamed from misc/xencov.c +5 -0
@@ -26,6 +26,11 @@
 #include <err.h>
 #include <sys/mman.h>
 
+#ifdef __NetBSD__
+/* MAP_LOCKED is Linux specific. MAP_WIRED is NetBSD's equivalent. */
+#define MAP_LOCKED MAP_WIRED
+#endif
+
 static xc_interface *gcov_xch = NULL;
 
 static void gcov_init(void)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
In reply to Ian Campbell

here: http://www.gossamer-threads.com/lists/xen/devel/282660

- fix error: array subscript has type 'char'

Quoted 12 lines · Ian Campbell
Quoted 6 lines · Miguel Clara
Quoted 3 lines

Sadly I came across another error, still searching if it was already posted, otherwise I will!

Acctually the other error was about libxl (array subscript has type 'char' ) this was already mentioned!

DO you have a reference? Was there a patch?

Ian.

#7 lore raw
In reply to Miguel Clara
Quoted 36 lines · Miguel Clara

For now I simply added the code to tools/misc/xencov.c

Not sure if its the best way to do it.

Quoted 31 lines · Ian Campbell
Quoted 8 lines · Miguel Clara
Quoted 6 lines · Christoph Egger <chegger <at> amazon.de> writes:

Hi,

tools/misc/xencov.c fails to build.
NetBSD does not have MAP_LOCKED.

Quoted 8 lines
Quoted 2 lines

Christoph

I wanted to test 4.3 on NetBSD but ended up with this problem too... In fact this happened before in other parts of the code...
http://lists.xen.org/archives/html/xen-devel/2012-06/msg00576.html

I guess this would fix it...

Please can you confirm and if so submit a patch

See http://wiki.xen.org/wiki/Submitting_Xen_Patches for some hints on how to do that.

Quoted 8 lines

#ifdef __NetBSD__
/* MAP_LOCKED is Linux specific. MAP_WIRED is NetBSD's equivalent. */ #define MAP_LOCKED MAP_WIRED
#endif

Sadly I came across another error, still searching if it was already posted, otherwise I will!

I send this as a proper patch. Please add your Signed-off-by.

Christoph