WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Make libelf build on Solaris

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Make libelf build on Solaris
From: john.levon@xxxxxxx
Date: Sun, 28 Jan 2007 09:38:30 -0700
Delivery-date: Sun, 28 Jan 2007 09:38:51 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User john.levon@xxxxxxx
# Date 1170001675 28800
# Node ID 132cc7bc2a356aa058b8550b90d5bb491fe0ea8c
# Parent  a484197f951e32da001f56faf6b140c9ac297897
Make libelf build on Solaris.

libelf has a number of Linuxisms. Fix them up.

Signed-off-by: John Levon <john.levon@xxxxxxx>

diff --git a/xen/common/libelf/libelf-private.h 
b/xen/common/libelf/libelf-private.h
--- a/xen/common/libelf/libelf-private.h
+++ b/xen/common/libelf/libelf-private.h
@@ -33,7 +33,14 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef __sun__
+#include <sys/byteorder.h>
+#define bswap_16(x) BSWAP_16(x)
+#define bswap_32(x) BSWAP_32(x)
+#define bswap_64(x) BSWAP_64(x)
+#else
 #include <byteswap.h>
+#endif
 #include <xen/elfnote.h>
 #include <xen/libelf.h>
 
diff --git a/xen/include/public/libelf.h b/xen/include/public/libelf.h
--- a/xen/include/public/libelf.h
+++ b/xen/include/public/libelf.h
@@ -7,6 +7,14 @@
 #include <public/features.h>
 typedef uint64_t off_t;
 
+#else /* !__XEN__ */
+
+#include <stddef.h>
+#include <inttypes.h>
+
+#endif
+
+#ifndef BYTE_ORDER
 #define LITTLE_ENDIAN 1234
 #define BIG_ENDIAN    4321
 #if defined(__i386__) || defined(__x86_64) || defined(__ia64__)
@@ -14,13 +22,7 @@ typedef uint64_t off_t;
 #elif defined(__powerpc__)
 #define BYTE_ORDER BIG_ENDIAN
 #endif
-
-#else /* !__XEN__ */
-
-#include <stddef.h>
-#include <inttypes.h>
-
-#endif
+#endif /* !BYTE_ORDER */
 
 #undef ELFSIZE
 #include "elfstructs.h"

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>