Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/virtio: compile with -pthread

When using pthreads, one has to compile and link with -lpthread,
otherwise e.g. glibc is not guaranteed to be reentrant.

This replaces -lpthread.

Reported-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

+2 -1
+2 -1
tools/virtio/Makefile
··· 5 5 vringh_test: vringh_test.o vringh.o virtio_ring.o 6 6 7 7 CFLAGS += -g -O2 -Werror -Wno-maybe-uninitialized -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE -include ../../include/linux/kconfig.h 8 - LDFLAGS += -lpthread 8 + CFLAGS += -pthread 9 + LDFLAGS += -pthread 9 10 vpath %.c ../../drivers/virtio ../../drivers/vhost 10 11 mod: 11 12 ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test V=${V}