From 942e232ded48fa08d2bda417ae8ad8c03d644372 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.funk1@gmail.com>
Date: Wed, 27 Aug 2025 11:49:06 +0800
Subject: [PATCH] tests: Fix link errors for t-thread-local.

On platforms where pthread_create is not in libc t-thread-local fails to
link.  Issue found on NetBSD 10.0.
* tests/Makefile.am (t_thread_local_LDADD): Add $(standard_ldadd),
$(GPG_ERROR_MT_LIBS), and @LDADD_FOR_TESTS_KLUDGE@.
(t_thread_local_CFLAGS): Add $(GPG_ERROR_MT_CFLAGS).

--

Upstream-Status: Backport [793eda7b258a562757b51c96044b103b638f1a63]
GnuPG-bug-id: 7634
Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 tests/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4800135..f0f7adb 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -98,7 +98,7 @@ 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) -lpthread
 t_thread_local_LDADD = $(standard_ldadd) $(GPG_ERROR_MT_LIBS) @LDADD_FOR_TESTS_KLUDGE@
-t_thread_local_CFLAGS = $(GPG_ERROR_MT_CFLAGS)
+t_thread_local_CFLAGS = $(GPG_ERROR_MT_CFLAGS) -lpthread
 testdrv_LDADD = $(LDADD_FOR_TESTS_KLUDGE)
 
 # Build a version of the test driver for the build platform.
-- 
2.34.1

