kvm: selftests: use -pthread instead of -lpthread
authorLei Yang <Lei.Yang@windriver.com>
Wed, 29 Aug 2018 07:04:08 +0000 (15:04 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 19 Sep 2018 22:26:44 +0000 (00:26 +0200)
I run into the following error

testing/selftests/kvm/dirty_log_test.c:285: undefined reference to `pthread_create'
testing/selftests/kvm/dirty_log_test.c:297: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status

my gcc version is gcc version 4.8.4
"-pthread" would work everywhere

Signed-off-by: Lei Yang <Lei.Yang@windriver.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/Makefile

index 03b0f551bedffc7eecb6fd4452e99de1a8a4b828..48c970c90353b9dbbfe547c68dc9b2798577d6e3 100644 (file)
@@ -20,7 +20,7 @@ INSTALL_HDR_PATH = $(top_srcdir)/usr
 LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
 LINUX_TOOL_INCLUDE = $(top_srcdir)tools/include
 CFLAGS += -O2 -g -std=gnu99 -I$(LINUX_TOOL_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude -I$(<D) -I..
-LDFLAGS += -lpthread
+LDFLAGS += -pthread
 
 # After inclusion, $(OUTPUT) is defined and
 # $(TEST_GEN_PROGS) starts with $(OUTPUT)/