[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 13/23] configure: Check if struct fsxattr is avai
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH v2 13/23] configure: Check if struct fsxattr is available from linux header |
Date: |
Mon, 9 May 2016 13:07:57 +0100 |
From: Jan Vesely <address@hidden>
Fixes build failure with --enable-xfsctl and
new linux headers (>=4.5) and older xfsprogs(<4.5):
In file included from /usr/include/xfs/xfs.h:38:0,
from
/var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0/block/raw-posix.c:97:
/usr/include/xfs/xfs_fs.h:42:8: error: redefinition of ‘struct fsxattr’
struct fsxattr {
^
In file included from
/var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0/block/raw-posix.c:60:0:
/usr/include/linux/fs.h:155:8: note: originally defined here
struct fsxattr {
This is really a bug in the system headers, but we can work around it
by defining HAVE_FSXATTR in the QEMU headers if linux/fs.h provides
the struct, so that xfs_fs.h doesn't try to define it as well.
CC: address@hidden
CC: Markus Armbruster <address@hidden>
CC: Peter Maydell <address@hidden>
CC: Stefan Weil <address@hidden>
Tested-by: Stefan Weil <address@hidden>
Signed-off-by: Jan Vesely <address@hidden>
[PMM: adjusted commit message, comments]
Signed-off-by: Peter Maydell <address@hidden>
---
configure | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/configure b/configure
index ab54f3c..c37fc5f 100755
--- a/configure
+++ b/configure
@@ -4494,6 +4494,21 @@ if test "$fortify_source" != "no"; then
fi
##########################################
+# check if struct fsxattr is available via linux/fs.h
+
+have_fsxattr=no
+cat > $TMPC << EOF
+#include <linux/fs.h>
+struct fsxattr foo;
+int main(void) {
+ return 0;
+}
+EOF
+if compile_prog "" "" ; then
+ have_fsxattr=yes
+fi
+
+##########################################
# End of CC checks
# After here, no more $cc or $ld runs
@@ -5160,6 +5175,14 @@ fi
if test "$have_ifaddrs_h" = "yes" ; then
echo "HAVE_IFADDRS_H=y" >> $config_host_mak
fi
+
+# Work around a system header bug with some kernel/XFS header
+# versions where they both try to define 'struct fsxattr':
+# xfs headers will not try to redefine structs from linux headers
+# if this macro is set.
+if test "$have_fsxattr" = "yes" ; then
+ echo "HAVE_FSXATTR=y" >> $config_host_mak
+fi
if test "$vte" = "yes" ; then
echo "CONFIG_VTE=y" >> $config_host_mak
echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak
--
2.5.5
- [Qemu-devel] [PATCH v2 00/23] libqos: use standard virtio headers, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 01/23] hw/ppc/spapr: Fix crash when specifying bad parameters to spapr-pci-host-bridge, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 02/23] usb/uhci: move pid check, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 03/23] spapr_drc: fix aborts during DRC-count based hotplug, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 04/23] QemuOpts: Fix qemu_opts_foreach() dangling location regression, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 10/23] vvfat: Fix volume name assertion, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 07/23] target-mips: Fix RDHWR exception host PC, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 11/23] vvfat: Fix default volume label, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 12/23] acpi: fix bios linker loadder COMMAND_ALLOCATE on bigendian host, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 09/23] qapi: Don't pass NULL to printf in string input visitor, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 13/23] configure: Check if struct fsxattr is available from linux header,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH v2 15/23] Update version for v2.6.0-rc4 release, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 14/23] Revert "acpi: mark PMTIMER as unlocked", Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 18/23] libqos: drop duplicated virtio_config.h definitions, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 17/23] libqos: drop duplicated PCI vendor ID definition, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 19/23] libqos: drop duplicated virtio_ring.h bit definitions, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 16/23] libqos: use virtio_ids.h for device ID definitions, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 22/23] libqos: drop duplicated virtio_scsi.h definitions, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 20/23] libqos: drop duplicated virtio_vring.h structs, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 23/23] libqos: drop duplicated virtio_pci.h definitions, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 05/23] replay: Fix dangling location bug in replay_configure(), Stefan Hajnoczi, 2016/05/09