Issue with QEMU build steps in Confidential Computing Deployment Guide (Intel TDX & KVM)

Hello,
I’m following the steps below in “Build QEMU”.

# Obtain the network package so the CVM can have internet access.
$ git clone https://gitlab.freedesktop.org/slirp/libslirp.git
$ cd libslirp
$ meson build
$ sudo ninja -C build install
$ cd ..

# Use your preference to ensure that libslirp.so is in the ldconfig path
# Here is one option:
$ sudo ln -s /usr/local/lib/x86_64-linux-gnu/libslirp.so.0 /lib/x86_64-linux-gnu/

# Build & Install QEMU
$ ./configure --enable-slirp --enable-kvm --target-list=x86_64-softmmu
$ make -j$(nproc)

The problem is that make -j$(nproc) fails with the following error:

[2003/2752] Compiling C object libcommon.fa.p/net_slirp.c.o
FAILED: libcommon.fa.p/net_slirp.c.o
cc -m64 -Ilibcommon.fa.p -Isubprojects/dtc/libfdt -I../subprojects/dtc/libfdt -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/local/include/slirp -fdiagnostics-color=auto -Wall -Winvalid-pch -Werror -std=gnu11 -O2 -g -fstack-protector-strong -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit-fallthrough=2 -Winit-self -Wmissing-format-attribute -Wmissing-prototypes -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wredundant-decls -Wshadow=local -Wstrict-prototypes -Wtype-limits -Wundef -Wvla -Wwrite-strings -Wno-missing-include-dirs -Wno-psabi -Wno-shift-negative-value -isystem /shared/qemu/linux-headers -isystem linux-headers -iquote . -iquote /shared/qemu -iquote /shared/qemu/include -iquote /shared/qemu/host/include/x86_64 -iquote /shared/qemu/host/include/generic -iquote /shared/qemu/tcg/i386 -pthread -msse2 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -ftrivial-auto-var-init=zero -fzero-call-used-regs=used-gpr -fPIE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DNCURSES_WIDECHAR=1 -MD -MQ libcommon.fa.p/net_slirp.c.o -MF libcommon.fa.p/net_slirp.c.o.d -o libcommon.fa.p/net_slirp.c.o -c ../net/slirp.c
../net/slirp.c: In function ‘net_slirp_poll_notify’:
../net/slirp.c:366:9: error: ‘slirp_pollfds_fill’ is deprecated [-Werror=deprecated-declarations]
  366 |         slirp_pollfds_fill(s->slirp, &poll->timeout,
      |         ^~~~~~~~~~~~~~~~~~
In file included from ../net/slirp.c:41:
/usr/local/include/slirp/libslirp.h:273:6: note: declared here
  273 | void slirp_pollfds_fill(Slirp *slirp, uint32_t *timeout,
      |      ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
[2004/2752] Compiling C object libcommon.fa.p/replay_replay-debugging.c.o

Can you please help me resolve this issue?

If you could build a VM which uses a tap or NAT as network, the --enable-slirp option could be removed.

Hello,

I am getting this same error when trying to build QEMU. Removing the --enable-slirp option does’t fix the issue and the error comes up again.

Can I get some help to fix the error?

Thank you.

Could you try removing the qemu directory and re-executing the Build & Install QEMU steps?

Hi Yifan-Tan, thanks for your response. I tried removing and re-executing the build and install QEMU steps, but the error showed up again.

I was able to bypass the issue by adding --disable-werror to the ./configure… command.

Thank you.