Re: [PATCH v2 3/6] vfio: selftests: Extend container/iommufd setup for passing vf_token

From: Raghavendra Rao Ananta
Date: Thu Jan 08 2026 - 16:35:09 EST


On Wed, Jan 7, 2026 at 2:49 PM David Matlack <dmatlack@xxxxxxxxxx> wrote:
> > diff --git a/tools/testing/selftests/vfio/lib/libvfio.mk b/tools/testing/selftests/vfio/lib/libvfio.mk
> > index b7857319c3f1f..459b14c6885a8 100644
> > --- a/tools/testing/selftests/vfio/lib/libvfio.mk
> > +++ b/tools/testing/selftests/vfio/lib/libvfio.mk
> > @@ -15,6 +15,8 @@ LIBVFIO_C += drivers/ioat/ioat.c
> > LIBVFIO_C += drivers/dsa/dsa.c
> > endif
> >
> > +LDLIBS += -luuid
> > +
> > LIBVFIO_OUTPUT := $(OUTPUT)/libvfio
> >
> > LIBVFIO_O := $(patsubst %.c, $(LIBVFIO_OUTPUT)/%.o, $(LIBVFIO_C))
> > @@ -25,6 +27,6 @@ $(shell mkdir -p $(LIBVFIO_O_DIRS))
> > CFLAGS += -I$(LIBVFIO_SRCDIR)/include
> >
> > $(LIBVFIO_O): $(LIBVFIO_OUTPUT)/%.o : $(LIBVFIO_SRCDIR)/%.c
> > - $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
> > + $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< $(LDLIBS) -o $@
>
> Do we need $(LDLIBS) when compiling the intermediate .o files? I thought
> we would only need it when linking the selftests binaries.
>
You are right. We need it only during the final linking. I'll get rid of it.

I'll update this and other nits in the next version.

Thank you
Raghavendra