Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 577810

Summary: app-emulation/qemu[xfs]: Build failure using sys-kernel/linux-headers-4.5
Product: Gentoo Linux Reporter: Jan Vesely <jano.vesely>
Component: Current packagesAssignee: Gentoo QEMU Project <qemu+disabled>
Status: RESOLVED FIXED    
Severity: normal CC: bugzie, c.affolter, jesse, roy
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://lists.nongnu.org/archive/html/qemu-trivial/2016-03/msg00054.html
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: configure: Check if struct fsxattr is available from linux headers
create_config:generate defines for HAVE_* configuration options

Description Jan Vesely 2016-03-20 03:13:00 UTC
qemu fails to build because struct fsxattr is defined both in linux headers (linux/fs.h) and xfs headers (xfs/xfs_fs.h).
The build failure:

x86_64-pc-linux-gnu-gcc -I/var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0/tcg -I/var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0/tcg/tci -I/var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0/linux-headers -I/var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0/softmmu-build/linux-headers -I. -I/var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0 -I/var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0/include -I/var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0/block -Iblock -I/usr/include/pixman-1   -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common  -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-strong  -I/usr/include/p11-kit-1    -I/usr/include/libpng16  -I/usr/include/libusb-1.0  -I/var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0/tests -MMD -MP -MT block/throttle-groups.o -MF block/throttle-groups.d -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -O2 -march=native -mtune=native -fomit-frame-pointer -pipe  -c -o block/throttle-groups.o /var/tmp/portage/app-emulation/qemu-2.5.0-r1/work/qemu-2.5.0/block/throttle-groups.c
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 {
Comment 1 Jan Vesely 2016-03-20 03:14:16 UTC
Created attachment 428632 [details, diff]
configure: Check if struct fsxattr is available from linux headers
Comment 2 Jan Vesely 2016-03-20 03:16:02 UTC
Created attachment 428636 [details, diff]
create_config:generate defines for HAVE_* configuration options

this is a partial backport of patch in upstream qemu that makes the first patch work by adding the necessary define.
Comment 3 SpanKY gentoo-dev 2016-03-28 20:48:41 UTC
please send patches like this to the upstream qemu mailing list
Comment 4 Jan Vesely 2016-03-29 01:48:19 UTC
(In reply to SpanKY from comment #3)
> please send patches like this to the upstream qemu mailing list

I did.
https://lists.nongnu.org/archive/html/qemu-trivial/2016-03/threads.html#00054
Comment 5 SpanKY gentoo-dev 2016-03-29 03:55:23 UTC
(In reply to Jan Vesely from comment #4)

great!  let's see how it pans out.
Comment 6 Jesse Adelman 2016-04-02 01:41:34 UTC
+1 here. Perhaps this should be changed to "CONFIRMED"? :) Cheers.
Comment 7 SpanKY gentoo-dev 2016-04-02 02:17:49 UTC
the xfs code isn't terribly useful if you want to disable it for now.  it's only used when using raw disk images on an XFS formatted fs, and then it's only to quickly zero out / discard blocks.
Comment 8 Roy Marples 2016-04-27 23:16:25 UTC
This has been broken for over a month now ...
Comment 9 Jan Vesely 2016-04-29 12:39:59 UTC
(In reply to SpanKY from comment #7)
> the xfs code isn't terribly useful if you want to disable it for now.  it's
> only used when using raw disk images on an XFS formatted fs, and then it's
> only to quickly zero out / discard blocks.

Note that xfsprogs<4.5 also fails to build with linux-headers>=4.5. So maybe the correct fix is to have a block for those combinations.
qemu builds OK with xfsprogs-4.5 and linux-headers-4.5 even without these patches.
Comment 10 Jan Vesely 2016-05-02 16:26:34 UTC
The first patch was accepted upstream:
http://git.qemu.org/?p=qemu.git;a=commit;h=277abf15a60f7653bfb05ffb513ed74ffdaea1b7

Note that backporting to 2.5 will also need the other patch (generate defines ...) if you decide to go that way.
Comment 11 SpanKY gentoo-dev 2016-05-17 04:42:55 UTC
i've added that patch to the 2.5.1 stable ebuild:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6b13602fdf3ffadf7a32cf41f29580a686bd0802

and 2.6.0 is in the tree for unstable.