Skip to contentSkip to conversation

virtfs-proxy-helper fails due to bogus libattr test

DISCUSSION Olaf Hering 4 participants 7 messages Jan 12, 2021

lore
Share & tools
lore
#0 lore raw

Depending on the build environment, the meson test to find a suitable libattr fails. Something appends -O0 to CFLAGS.

I see no "-O0" in qemu.git. This is a regression, it worked in 553032db17440f8de011390e5a1cfddd13751b0b.

Does anyone happen to know what is causing this?

Olaf

./configure --host=x86_64-suse-linux-gnu --build=x86_64-suse-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --cc=/usr/bin/gcc-10 --host-cc=/usr/bin/gcc-10 --cxx=/usr/bin/g++-10 --docdir=/usr/share/doc/packages --firmwarepath=/usr/share/qemu/firmware '--target-list=i386-softmmu x86_64-softmmu' '--audio-drv-list=alsa pa' --iasl=/usr/bin/iasl --install=/usr/bin/install --objcc=/usr/bin/false --python=/usr/bin/python3 --ninja=/usr/bin/ninja --tls-priority=NORMAL --with-git=/usr/bin/false --with-suffix=qemu --disable-docs --disable-gtk --disable-libnfs --disable-opengl --disable-rbd --disable-spice --disable-virglrenderer --disable-vte --enable-attr --disable-brlapi --disable-bsd-user --enable-bzip2 --enable-cap-ng --disable-capstone --disable-cocoa --enable-coroutine-pool --disable-crypto-afalg --enable-curl --enable-curses --disable-debug-info --disable-debug-mutex --disable-debug-tcg --with-default-devices --enable-docs --disable-fdt --enable-gcrypt --enable-gettext --disable-git-update --disable-glusterfs --enable-gnutls --enable-gtk --enable-guest-agent --disable-guest-agent-msi --disable-hax --disable-hvf --enable-iconv --disable-jemalloc --disable-keyring --enable-kvm --disable-libdaxctl --disable-libiscsi --enable-libnfs --enable-libssh --enable-libusb --enable-libxml2 --enable-linux-aio --disable-linux-user --enable-live-block-migration --disable-lzo --disable-lzfse --disable-malloc-trim --disable-membarrier --enable-modules --disable-mpath --disable-netmap --disable-nettle --enable-numa --enable-opengl --enable-pie --enable-plugins --disable-qom-cast-debug --enable-rbd --disable-rdma --enable-replication --enable-rng-none --disable-safe-stack --disable-sanitizers --disable-sdl --disable-sdl-image --disable-seccomp --disable-slirp --disable-smartcard --disable-snappy --disable-sparse --enable-spice --enable-stack-protector --disable-strip --enable-system --enable-tcg --disable-tcg-interpreter --disable-tcmalloc --enable-tools --disable-tpm --disable-tsan --disable-u2f --enable-usb-redir --disable-user --enable-vde --enable-vhost-crypto --enable-vhost-net --enable-vhost-scsi --enable-vhost-user --enable-vhost-user-fs --enable-vhost-vsock --enable-virglrenderer --enable-virtfs --disable-virtiofsd --enable-vnc --disable-vnc-jpeg --enable-vnc-png --disable-vnc-sasl --enable-vte --disable-werror --disable-whpx --enable-xen --enable-xen-pci-passthrough --enable-xfsctl
....

[  223s] Run-time dependency libnfs found: YES 4.0.0
[  223s] None of 'CC_LD' are defined in the environment, not changing global flags.
[  223s] Running compile:
[  223s] Working directory:  /home/abuild/rpmbuild/BUILD/qemu-20210111T151535.b3f846c59d/build/meson-private/tmpg908fqs3
[  223s] Command line:  /usr/bin/gcc-10 -I/usr/include/ncursesw /home/abuild/rpmbuild/BUILD/qemu-20210111T151535.b3f846c59d/build/meson-private/tmpg908fqs3/testfile.c -o /home/abuild/rpmbuild/BUILD/qemu-20210111T151535.b3f846c59d/build/meson-private/tmpg908fqs3/output.exe -pipe -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -D_FILE_OFFSET_BITS=64 -O0 -std=gnu99 
[  223s] 
[  223s] Code:
[  223s]  
[  223s]   #include <stddef.h>
[  223s]   #include <sys/types.h>
[  223s]   #ifdef CONFIG_LIBATTR
[  223s]   #include <attr/xattr.h>
[  223s]   #else
[  223s]   #include <sys/xattr.h>
[  223s]   #endif
[  223s]   int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; }
[  223s] Compiler stdout:
[  223s]  
[  223s] Compiler stderr:
[  223s]  In file included from /usr/include/sys/types.h:25,
[  223s]                  from /home/abuild/rpmbuild/BUILD/qemu-20210111T151535.b3f846c59d/build/meson-private/tmpg908fqs3/testfile.c:3:
[  223s] /usr/include/features.h:397:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
[  223s]   397 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
[  223s]       |    ^~~~~~~
[  223s] 
[  223s] Dependency libseccomp skipped: feature seccomp disabled

....

#1 lore raw
Quoted 7 lines · On Dienstag, 12. Januar 2021 10:51:10 CET Olaf Hering wrote:

Depending on the build environment, the meson test to find a suitable libattr fails. Something appends -O0 to CFLAGS.

I see no "-O0" in qemu.git. This is a regression, it worked in 553032db17440f8de011390e5a1cfddd13751b0b.

Does anyone happen to know what is causing this?

Putting Paolo in CC in case he's got some suspicion. I don't see something obvious right now.

Olaf, could you run a 'git bisect' to identify the relevant commit causing this?

Quoted 81 lines

Olaf

./configure --host=x86_64-suse-linux-gnu --build=x86_64-suse-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --cc=/usr/bin/gcc-10 --host-cc=/usr/bin/gcc-10 --cxx=/usr/bin/g++-10 --docdir=/usr/share/doc/packages --firmwarepath=/usr/share/qemu/firmware '--target-list=i386-softmmu x86_64-softmmu' '--audio-drv-list=alsa pa' --iasl=/usr/bin/iasl --install=/usr/bin/install --objcc=/usr/bin/false --python=/usr/bin/python3 --ninja=/usr/bin/ninja --tls-priority=NORMAL --with-git=/usr/bin/false --with-suffix=qemu --disable-docs --disable-gtk --disable-libnfs --disable-opengl --disable-rbd --disable-spice --disable-virglrenderer --disable-vte --enable-attr --disable-brlapi --disable-bsd-user --enable-bzip2 --enable-cap-ng --disable-capstone --disable-cocoa --enable-coroutine-pool --disable-crypto-afalg --enable-curl --enable-curses --disable-debug-info --disable-debug-mutex --disable-debug-tcg --with-default-devices --enable-docs --disable-fdt --enable-gcrypt --enable-gettext --disable-git-update --disable-glusterfs --enable-gnutls --enable-gtk --enable-guest-agent --disable-guest-agent-msi --disable-hax --disable-hvf --enable-iconv --disable-jemalloc --disable-keyring --enable-kvm --disable-libdaxctl --disable-libiscsi --enable-libnfs --enable-libssh --enable-libusb --enable-libxml2 --enable-linux-aio --disable-linux-user --enable-live-block-migration --disable-lzo --disable-lzfse --disable-malloc-trim --disable-membarrier --enable-modules --disable-mpath --disable-netmap --disable-nettle --enable-numa --enable-opengl --enable-pie --enable-plugins --disable-qom-cast-debug --enable-rbd --disable-rdma --enable-replication --enable-rng-none --disable-safe-stack --disable-sanitizers --disable-sdl --disable-sdl-image --disable-seccomp --disable-slirp --disable-smartcard --disable-snappy --disable-sparse --enable-spice --enable-stack-protector --disable-strip --enable-system --enable-tcg --disable-tcg-interpreter --disable-tcmalloc --enable-tools --disable-tpm --disable-tsan --disable-u2f --enable-usb-redir --disable-user --enable-vde --enable-vhost-crypto --enable-vhost-net --enable-vhost-scsi --enable-vhost-user --enable-vhost-user-fs --enable-vhost-vsock --enable-virglrenderer --enable-virtfs --disable-virtiofsd --enable-vnc --disable-vnc-jpeg --enable-vnc-png --disable-vnc-sasl --enable-vte --disable-werror --disable-whpx --enable-xen --enable-xen-pci-passthrough --enable-xfsctl ....
[ 223s] Run-time dependency libnfs found: YES 4.0.0
[ 223s] None of 'CC_LD' are defined in the environment, not changing global flags. [ 223s] Running compile:
[ 223s] Working directory:
/home/abuild/rpmbuild/BUILD/qemu-20210111T151535.b3f846c59d/build/meson-pri vate/tmpg908fqs3 [ 223s] Command line: /usr/bin/gcc-10 -I/usr/include/ncursesw /home/abuild/rpmbuild/BUILD/qemu-20210111T151535.b3f846c59d/build/meson-pri vate/tmpg908fqs3/testfile.c -o /home/abuild/rpmbuild/BUILD/qemu-20210111T151535.b3f846c59d/build/meson-pri vate/tmpg908fqs3/output.exe -pipe -O2 -Wall -D_FORTIFY_SOURCE=2

(quoted diff) +0 -3
-fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables
-fstack-clash-protection -Werror=return-type -g -D_FILE_OFFSET_BITS=64 -O0
-std=gnu99 [  223s]
[  223s] Code:
[  223s]
[  223s]   #include <stddef.h>
[  223s]   #include <sys/types.h>
[  223s]   #ifdef CONFIG_LIBATTR
[  223s]   #include <attr/xattr.h>
[  223s]   #else
[  223s]   #include <sys/xattr.h>
[  223s]   #endif
[  223s]   int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL,
NULL, NULL, 0, 0); return 0; } [  223s] Compiler stdout:
[  223s]
[  223s] Compiler stderr:
[  223s]  In file included from /usr/include/sys/types.h:25,
[  223s]                  from

/home/abuild/rpmbuild/BUILD/qemu-20210111T151535.b3f846c59d/build/meson-pri vate/tmpg908fqs3/testfile.c:3: [ 223s] /usr/include/features.h:397:4:
warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O)
[-Wcpp] [ 223s] 397 | # warning _FORTIFY_SOURCE requires compiling with
optimization (-O) [ 223s] | ^~~~~~~
[ 223s]
[ 223s] Dependency libseccomp skipped: feature seccomp disabled
....

#2 lore raw
Quoted 7 lines · Christian Schoenebeck via
Quoted 6 lines · On Dienstag, 12. Januar 2021 10:51:10 CET Olaf Hering wrote:

Depending on the build environment, the meson test to find a suitable libattr fails. Something appends -O0 to CFLAGS.

I see no "-O0" in qemu.git. This is a regression, it worked in 553032db17440f8de011390e5a1cfddd13751b0b.

Quoted 6 lines
Quoted 1 line

Does anyone happen to know what is causing this?

Putting Paolo in CC in case he's got some suspicion. I don't see something obvious right now.
Olaf, could you run a 'git bisect' to identify the relevant commit causing this?

The -O0 might come from a pkg-config file

$BUILD_DIR/meson-logs/meson-log.txt

might show where it comes from.

Quoted 74 lines
Quoted 74 lines

Olaf

./configure --host=x86_64-suse-linux-gnu --build=x86_64-suse-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --cc=/usr/bin/gcc-10 --host-cc=/usr/bin/gcc-10 --cxx=/usr/bin/g++-10 --docdir=/usr/share/doc/packages --firmwarepath=/usr/share/qemu/firmware '--target-list=i386-softmmu x86_64-softmmu' '--audio-drv-list=alsa pa' --iasl=/usr/bin/iasl --install=/usr/bin/install --objcc=/usr/bin/false --python=/usr/bin/python3 --ninja=/usr/bin/ninja --tls-priority=NORMAL --with-git=/usr/bin/false --with-suffix=qemu --disable-docs --disable-gtk --disable-libnfs --disable-opengl --disable-rbd --disable-spice --disable-virglrenderer --disable-vte --enable-attr --disable-brlapi --disable-bsd-user --enable-bzip2 --enable-cap-ng --disable-capstone --disable-cocoa --enable-coroutine-pool --disable-crypto-afalg --enable-curl --enable-curses --disable-debug-info --disable-debug-mutex --disable-debug-tcg --with-default-devices --enable-docs --disable-fdt --enable-gcrypt --enable-gettext --disable-git-update --disable-glusterfs --enable-gnutls --enable-gtk --enable-guest-agent --disable-guest-agent-msi --disable-hax --disable-hvf --enable-iconv --disable-jemalloc --disable-keyring --enable-kvm --disable-libdaxctl --disable-libiscsi --enable-libnfs --enable-libssh --enable-libusb --enable-libxml2 --enable-linux-aio --disable-linux-user --enable-live-block-migration --disable-lzo --disable-lzfse --disable-malloc-trim --disable-membarrier --enable-modules --disable-mpath --disable-netmap --disable-nettle --enable-numa --enable-opengl --enable-pie --enable-plugins --disable-qom-cast-debug --enable-rbd --disable-rdma --enable-replication --enable-rng-none --disable-safe-stack --disable-sanitizers --disable-sdl --disable-sdl-image --disable-seccomp --disable-slirp --disable-smartcard --disable-snappy --disable-sparse --enable-spice --enable-stack-protector --disable-strip --enable-system --enable-tcg --disable-tcg-interpreter --disable-tcmalloc --enable-tools --disable-tpm --disable-tsan --disable-u2f --enable-usb-redir --disable-user --enable-vde --enable-vhost-crypto --enable-vhost-net --enable-vhost-scsi --enable-vhost-user --enable-vhost-user-fs --enable-vhost-vsock --enable-virglrenderer --enable-virtfs --disable-virtiofsd --enable-vnc --disable-vnc-jpeg --enable-vnc-png --disable-vnc-sasl --enable-vte --disable-werror --disable-whpx --enable-xen --enable-xen-pci-passthrough --enable-xfsctl ....
[ 223s] Run-time dependency libnfs found: YES 4.0.0
[ 223s] None of 'CC_LD' are defined in the environment, not changing global flags. [ 223s] Running compile:
[ 223s] Working directory:
/home/abuild/rpmbuild/BUILD/qemu-20210111T151535.b3f846c59d/build/meson-pri vate/tmpg908fqs3 [ 223s] Command line: /usr/bin/gcc-10 -I/usr/include/ncursesw /home/abuild/rpmbuild/BUILD/qemu-20210111T151535.b3f846c59d/build/meson-pri vate/tmpg908fqs3/testfile.c -o /home/abuild/rpmbuild/BUILD/qemu-20210111T151535.b3f846c59d/build/meson-pri vate/tmpg908fqs3/output.exe -pipe -O2 -Wall -D_FORTIFY_SOURCE=2

(quoted diff) +0 -3
-fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables
-fstack-clash-protection -Werror=return-type -g -D_FILE_OFFSET_BITS=64 -O0
-std=gnu99 [  223s]
[  223s] Code:
[  223s]
[  223s]   #include <stddef.h>
[  223s]   #include <sys/types.h>
[  223s]   #ifdef CONFIG_LIBATTR
[  223s]   #include <attr/xattr.h>
[  223s]   #else
[  223s]   #include <sys/xattr.h>
[  223s]   #endif
[  223s]   int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL,
NULL, NULL, 0, 0); return 0; } [  223s] Compiler stdout:
[  223s]
[  223s] Compiler stderr:
[  223s]  In file included from /usr/include/sys/types.h:25,
[  223s]                  from
Quoted 11 lines
Quoted 8 lines

/home/abuild/rpmbuild/BUILD/qemu-20210111T151535.b3f846c59d/build/meson-pri vate/tmpg908fqs3/testfile.c:3: [ 223s] /usr/include/features.h:397:4:
warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O)
[-Wcpp] [ 223s] 397 | # warning _FORTIFY_SOURCE requires compiling with
optimization (-O) [ 223s] | ^~~~~~~
[ 223s]
[ 223s] Dependency libseccomp skipped: feature seccomp disabled
....

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#3 lore raw
Quoted 5 lines · Daniel P. Berrangé

The -O0 might come from a pkg-config file

$BUILD_DIR/meson-logs/meson-log.txt

might show where it comes from.

It's added by Meson for compiler checks. It's useful for example for functions that are declared as const or pure, and would be optimized away by the compiler. However, it does not matter apart from causing a warning to show up in the logs.

(The warning is probably caused by -D_FORTIFY_SOURCE=2 in the CFLAGS environment variable, though I cannot say that with certainty. QEMU is able to add -D_FORTIFY_SOURCE on its own).

If I do

$ CFLAGS='-O2 -g -D_FORTIFY_SOURCE=2' ../configure --enable-attr

I get the same warning in the logs, and nevertheless the summary reports that the test is successful:

ATTR/XATTR support: YES

as well as in config-host.h

#define CONFIG_ATTR
#undef CONFIG_LIBATTR

Unfortunately, from Olaf's report I cannot understand what the virtfs-proxy-helper failure is like (since no "make" log was included) or the exact details of the build environment (since no meson-logs/meson-log.txt is included). Olaf, can you expand on that?

Paolo

#6 lore raw
In reply to Christian Schoenebeck via

Am Tue, 12 Jan 2021 13:26:00 +0100
schrieb Christian Schoenebeck <[email protected]>:

Quoted 1 line

Olaf, could you run a 'git bisect' to identify the relevant commit causing this?

attr was recently moved from configure to meson.

After further inspection it turned out that messages on stderr may have no meaning for meson.

Elsewhere in the log I see:
libcap-ng support: YES
ATTR/XATTR support: YES
VirtFS support: YES

There is also --enable-tools, so CONFIG_TOOLS should be true.

have_virtfs_proxy_helper might be false, at least there is no indication that a build of /usr/lib/virtfs-proxy-helper was attempted.

However, where is CONFIG_VIRTFS supposed to come from? It seems have_system influences "have_virtfs". There is apparently no easy way to see if 'have_system' became true.

Olaf