All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blktap2: use HAVE_BYTESWAP_H and _BYTESWAP_H for uclibc compatibility
@ 2011-12-15 17:18 Roger Pau Monne
  2011-12-15 18:05 ` Roger Pau Monné
  0 siblings, 1 reply; 4+ messages in thread
From: Roger Pau Monne @ 2011-12-15 17:18 UTC (permalink / raw)
  To: xen-devel

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1323969492 -3600
# Node ID a01f1e2f654ea54bbf5d0a77b315b676cc494aa8
# Parent  0051e09f73efea06f2f28c0ece57194e286daedc
blktap2: use HAVE_BYTESWAP_H and _BYTESWAP_H for uclibc compatibility

uclibc defines _BYTESWAP_H instead of HAVE_BYTESWAP_H in byteswap.h:

http://git.uclibc.org/uClibc/tree/include/byteswap.h

Without this fix, blktap2 doesn't compile under uclibc and throws the
following error:

gcc  -O1 -fno-omit-frame-pointer -m64 -g -fno-strict-aliasing
-std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement
-Wno-unused-but-set-variable   -D__XEN_TOOLS__ -MMD -MF
.block-qcow.o.d  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-fno-optimize-sibling-calls -Werror -g -O0 -Wno-unused
-fno-strict-aliasing -I../include -I../drivers
-I/root/xen-unstable/tools/blktap2/drivers/../../../tools/libxc
-I/root/xen-unstable/tools/blktap2/drivers/../../../tools/include -I
/root/xen-unstable/tools/blktap2/drivers/../../../tools/memshr
-D_GNU_SOURCE -DUSE_NFS_LOCKS -fPIC -I
/root/xen-unstable/tools/blktap2/drivers/../../../tools/libaio/src  -c
-o block-qcow.o block-qcow.c  -I/usr/local/include
In file included from block-qcow.c:37:0:
bswap.h:23:0: error: "bswap_16" redefined [-Werror]
/usr/include/byteswap.h:30:0: note: this is the location of the
previous definition
bswap.h:31:0: error: "bswap_32" redefined [-Werror]
/usr/include/byteswap.h:33:0: note: this is the location of the
previous definition
bswap.h:41:0: error: "bswap_64" redefined [-Werror]
/usr/include/byteswap.h:37:0: note: this is the location of the
previous definition
cc1: all warnings being treated as errors

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>

diff -r 0051e09f73ef -r a01f1e2f654e tools/blktap2/drivers/bswap.h
--- a/tools/blktap2/drivers/bswap.h	Thu Dec 15 10:00:09 2011 +0100
+++ b/tools/blktap2/drivers/bswap.h	Thu Dec 15 18:18:12 2011 +0100
@@ -15,7 +15,7 @@
 #define bswap_64(x) swap64(x)
 #else
 
-#ifdef HAVE_BYTESWAP_H
+#if defined(HAVE_BYTESWAP_H) || defined(_BYTESWAP_H)
 #include <byteswap.h>
 #else

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] blktap2: use HAVE_BYTESWAP_H and _BYTESWAP_H for uclibc compatibility
  2011-12-15 17:18 [PATCH] blktap2: use HAVE_BYTESWAP_H and _BYTESWAP_H for uclibc compatibility Roger Pau Monne
@ 2011-12-15 18:05 ` Roger Pau Monné
  2011-12-16 13:19   ` Roger Pau Monné
  0 siblings, 1 reply; 4+ messages in thread
From: Roger Pau Monné @ 2011-12-15 18:05 UTC (permalink / raw)
  To: xen-devel

I'm having second thoughts about this patch, although it works, I'm
not sure it's the right way to do it. I don't know why configure fails
to set HAVE_BYTESWAP_H when using uclibc. Any thoughts?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] blktap2: use HAVE_BYTESWAP_H and _BYTESWAP_H for uclibc compatibility
  2011-12-15 18:05 ` Roger Pau Monné
@ 2011-12-16 13:19   ` Roger Pau Monné
  2011-12-16 13:25     ` Ian Campbell
  0 siblings, 1 reply; 4+ messages in thread
From: Roger Pau Monné @ 2011-12-16 13:19 UTC (permalink / raw)
  To: xen-devel

This patch is wrong, but I think blktap bswap.h is also wrong, because
HAVE_BYTESWAP_H is defined by qemu, but blktap doesn't include qemu
config file, so HAVE_BYTESWAP_H is not defined in this header file
(which doesn't mean that byteswap.h is not present on the system). How
should we fix this? Forget about including byteswap.h and always
define the functions ourselves?

Thanks, Roger.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] blktap2: use HAVE_BYTESWAP_H and _BYTESWAP_H for uclibc compatibility
  2011-12-16 13:19   ` Roger Pau Monné
@ 2011-12-16 13:25     ` Ian Campbell
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Campbell @ 2011-12-16 13:25 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: xen-devel

On Fri, 2011-12-16 at 13:19 +0000, Roger Pau Monné wrote:
> This patch is wrong, but I think blktap bswap.h is also wrong, because
> HAVE_BYTESWAP_H is defined by qemu, but blktap doesn't include qemu
> config file, so HAVE_BYTESWAP_H is not defined in this header file
> (which doesn't mean that byteswap.h is not present on the system). How
> should we fix this? Forget about including byteswap.h and always
> define the functions ourselves?

If HAVE_BYTESWAP_H has never been defined up until now can't we just
delete the include?

> 
> Thanks, Roger.
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel



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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-12-16 13:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-15 17:18 [PATCH] blktap2: use HAVE_BYTESWAP_H and _BYTESWAP_H for uclibc compatibility Roger Pau Monne
2011-12-15 18:05 ` Roger Pau Monné
2011-12-16 13:19   ` Roger Pau Monné
2011-12-16 13:25     ` Ian Campbell

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.