Skip to content

Commit f03560a

Browse files
committed
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 <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 06f05bc commit f03560a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/virtio/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ virtio_test: virtio_ring.o virtio_test.o
55
vringh_test: vringh_test.o vringh.o virtio_ring.o
66

77
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
910
vpath %.c ../../drivers/virtio ../../drivers/vhost
1011
mod:
1112
${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test V=${V}

0 commit comments

Comments
 (0)