Skip to contentSkip to conversation

] kvm: selftests: use -pthread instead of -lpthread

PATCH Applied Lei Yang 2 participants 2 messages Aug 29, 2018 – Sep 14, 2018

Subsystems (2)
lore
Share & tools
lore

Lei Yang

author
#0 lore raw

PATCH 1/1 ] kvm: selftests: use -pthread instead of -lpthread

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

---
 tools/testing/selftests/kvm/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/kvm/Makefile +1 -1
index 03b0f55..48c970c 100644
@@ -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)/
Signature · 1 line
1.9.1
maintainer Applied
#1 lore raw
Quoted 20 lines · Lei Yang

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 at windriver.com>
---
 tools/testing/selftests/kvm/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/kvm/Makefile +0 -0
index 03b0f55..48c970c 100644

tools/testing/selftests/kvm/Makefile INSTALL_HDR_PATH = $(top_srcdir)/usr · line 26

Quoted 8 lines
tools/testing/selftests/kvm/Makefile +1 -1
@@ -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)/

Queued, thanks.

Paolo