Package: qemu-user-static
Version: 1:7.2+dfsg-7+deb12u2
Severity: serious
Tags: ftbfs
Justification: fails to build from source (but built successfully in the past)
Whilst investigating #1053101 and needing to build the
qemu-aarch64-static without `--disable-pie` I hit an FTBFS with:
qemu-7.2+dfsg$ mkdir b
qemu-7.2+dfsg$ fakeroot debian/rules build-user-static
...
FAILED: libqemu-i386-linux-user.fa.p/linux-user_syscall.c.o
cc -m64 -mcx16 -Ilibqemu-i386-linux-user.fa.p -I. -I../.. -Itarget/i386
-I../../target/i386 -I../../common-user/host/x86_64
-I../../linux-user/include/host/x86_64 -I../../
linux-user/include -Ilinux-user -I../../linux-user -Ilinux-user/i386
-I../../linux-user/i386 -Iqapi -Itrace -Iui/shader -I/usr/include/capstone
-I/usr/include/glib-2.0 -I/
usr/lib/x86_64-linux-gnu/glib-2.0/include -fdiagnostics-color=auto -Wall
-Winvalid-pch -std=gnu11 -O2 -g -isystem
/srv/NAS/Sunny/SourceCode/qemu/qemu-7.2+dfsg/linux-header
s -isystem linux-headers -iquote . -iquote
/srv/NAS/Sunny/SourceCode/qemu/qemu-7.2+dfsg -iquote
/srv/NAS/Sunny/SourceCode/qemu/qemu-7.2+dfsg/include -iquote /srv/NAS/Sunny
/SourceCode/qemu/qemu-7.2+dfsg/tcg/i386 -pthread -U_FORTIFY_SOURCE
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes
-Wredundant-decls -Wundef -
Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv
-Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security
-Wformat-y2k -W
init-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels
-Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs
-Wno-shift-negative-v
alue -Wno-psabi -fstack-protector-strong -g -O2
-ffile-prefix-map=/srv/NAS/Sunny/SourceCode/qemu/qemu-7.2+dfsg=.
-fstack-protector-strong -Wformat -Werror=format-security
-Wdate-time -g -O2
-ffile-prefix-map=/srv/NAS/Sunny/SourceCode/qemu/qemu-7.2+dfsg=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE
=2 -fPIE -isystem../../linux-headers -isystemlinux-headers -DNEED_CPU_H
'-DCONFIG_TARGET="i386-linux-user-config-target.h"'
'-DCONFIG_DEVICES="i386-linux-user-config-devic
es.h"' -MD -MQ libqemu-i386-linux-user.fa.p/linux-user_syscall.c.o -MF
libqemu-i386-linux-user.fa.p/linux-user_syscall.c.o.d -o
libqemu-i386-linux-user.fa.p/linux-user_sys
call.c.o -c ../../linux-user/syscall.c
In file included from /usr/include/linux/btrfs.h:29,
from ../../linux-user/syscall.c:163:
/usr/include/linux/fs.h:50:8: error: redefinition of ‘struct file_clone_range’
50 | struct file_clone_range {
| ^~~~~~~~~~~~~~~~
../../linux-user/syscall.c:129:8: note: originally defined here
129 | struct file_clone_range {
The workaround is:
$ sudo mv /usr/include/linux/btrfs.h{,.disabled}
However I'm not sure what the proper fix for this would be. For usual
package building this file wouldn't be installed BUT the configure
script does detect it with HAVE_BTRFS_H:
$ grep -rn HAVE_BTRFS_H *
b/user-static/config-host.h:366:#undef HAVE_BTRFS_H
docs/devel/build-system.rst:287: config_host_data.set('HAVE_BTRFS_H',
cc.has_header('linux/btrfs.h'))
linux-user/syscall_defs.h:980:#ifdef HAVE_BTRFS_H
linux-user/syscall.c:162:#ifdef HAVE_BTRFS_H
meson.build:1952:config_host_data.set('HAVE_BTRFS_H',
cc.has_header('linux/btrfs.h'))
So I think this is a genuine bug that probaby needs squashing upstream.
I've not had chance to test this with latest upstream so far but will do
at some point and report an upstream issue if it still exists.
-- System Information:
Debian Release: 12.2
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security-debug'), (500,
'stable-security'), (500, 'stable-debug'), (500, 'proposed-updates-debug'),
(500, 'stable'), (100, 'proposed-updates')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
qemu-user-static depends on no packages.
Versions of packages qemu-user-static recommends:
ii binfmt-support 2.2.2-2
ii systemd 252.17-1~deb12u1