diff options
author | Jan Vesely <jano.vesely@gmail.com> | 2016-04-29 13:15:23 -0400 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-05-02 13:04:26 +0100 |
commit | 277abf15a60f7653bfb05ffb513ed74ffdaea1b7 (patch) | |
tree | fb362a05a2b32472178cb69af5b10e9202cea6c2 | |
parent | 20b0f5fef66012e12bde32b14eaa64de2b1b9dbe (diff) | |
download | qemu-277abf15a60f7653bfb05ffb513ed74ffdaea1b7.tar.gz qemu-277abf15a60f7653bfb05ffb513ed74ffdaea1b7.tar.bz2 qemu-277abf15a60f7653bfb05ffb513ed74ffdaea1b7.zip |
configure: Check if struct fsxattr is available from linux header
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: qemu-trivial@nongnu.org
CC: Markus Armbruster <armbru@redhat.com>
CC: Peter Maydell <peter.maydell@linaro.org>
CC: Stefan Weil <sw@weilnetz.de>
Tested-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
[PMM: adjusted commit message, comments]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rwxr-xr-x | configure | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -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 |