Skip to contentSkip to conversation

selftests: pidfd: Fix undefined reference to pthread_create()

PATCH In review Shuah Khan 2 participants 2 messages Sep 24, 2019

Subsystems (2)
lore
Share & tools
lore

Shuah Khan

author maintainer
#0 lore raw

PATCH 1/1 selftests: pidfd: Fix undefined reference to pthread_create()

Fix build failure:

undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status

Fix CFLAGS to include pthread correctly.

---
 tools/testing/selftests/pidfd/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/pidfd/Makefile +1 -1
index 464c9b76148f..7550f08822a3 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
-CFLAGS += -g -I../../../../usr/include/ -lpthread
+CFLAGS += -g -I../../../../usr/include/ -pthread
 
 TEST_GEN_PROGS := pidfd_test pidfd_open_test pidfd_poll_test pidfd_wait
 
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Shuah Khan

Fix build failure:

undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status

Fix CFLAGS to include pthread correctly.

Thanks, Shuah!
Queued-up in my fixes branch and will be included after the merge window closes. I'll also add a fixes tag and a cc for stable since this should very likely be backported.

Christian