From a3496435dcc223a914eec5e61e853934fd4eb635 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Wed, 27 Aug 2025 11:46:17 +0800
Subject: [PATCH] tests/Makefile.am: fix undefined reference to
 `pthread_create'

Add missing '-lpthread' to CFLAGS

Upstream-Status: Pending

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 tests/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 93daf3c..4800135 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -96,7 +96,7 @@ t_mpi_bit_LDADD = $(standard_ldadd) @LDADD_FOR_TESTS_KLUDGE@
 t_secmem_LDADD = $(standard_ldadd) @LDADD_FOR_TESTS_KLUDGE@
 testapi_LDADD = $(standard_ldadd) @LDADD_FOR_TESTS_KLUDGE@
 t_lock_LDADD = $(standard_ldadd) $(GPG_ERROR_MT_LIBS) @LDADD_FOR_TESTS_KLUDGE@
-t_lock_CFLAGS = $(GPG_ERROR_MT_CFLAGS)
+t_lock_CFLAGS = $(GPG_ERROR_MT_CFLAGS) -lpthread
 t_thread_local_LDADD = $(standard_ldadd) $(GPG_ERROR_MT_LIBS) @LDADD_FOR_TESTS_KLUDGE@
 t_thread_local_CFLAGS = $(GPG_ERROR_MT_CFLAGS)
 testdrv_LDADD = $(LDADD_FOR_TESTS_KLUDGE)
@@ -117,7 +117,7 @@ else
 xtestsuite_libs = ../src/.libs/libgcrypt.so*
 xtestsuite_driver = testdrv
 t_kdf_LDADD = $(standard_ldadd) $(GPG_ERROR_MT_LIBS) @LDADD_FOR_TESTS_KLUDGE@
-t_kdf_CFLAGS = $(GPG_ERROR_MT_CFLAGS)
+t_kdf_CFLAGS = $(GPG_ERROR_MT_CFLAGS) -lpthread
 endif
 
 # xcheck uses our new testdrv instead of the automake test runner.
-- 
2.34.1

