summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiago De Franco <hiago.franco@toradex.com>2025-06-02 17:55:46 -0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-05 11:02:21 +0100
commit19bee937be57e7249b2dc3fb749553d870b5b8d2 (patch)
treec00f7b7fc7f3a3553ba6a1df6648995159a72db1
parent34383435b65ae5bd2723421c8988b4e451ab1181 (diff)
downloadpoky-19bee937be57e7249b2dc3fb749553d870b5b8d2.tar.gz
libgcrypt: fix compile error for t-thread-local
Currently the libgcrypt-native build is failing with the following error: | ld: t_thread_local-t-thread-local.o: in function `main': | t-thread-local.c:(.text.startup+0x187): undefined reference to `pthread_create' | ld: t-thread-local.c:(.text.startup+0x1d0): undefined reference to `pthread_join' Backport the fix from upstream and add "-lpthread" to "t_thread_local_CFLAGS" to make the compilation successfull, similar to what 0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch does. (From OE-Core rev: d2daf78a083688b82625800919cdc6c6555fcc52) Signed-off-by: Hiago De Franco <hiago.franco@toradex.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-support/libgcrypt/files/0001-tests-Fix-link-errors-for-t-thread-local.patch34
-rw-r--r--meta/recipes-support/libgcrypt/libgcrypt_1.11.1.bb1
2 files changed, 35 insertions, 0 deletions
diff --git a/meta/recipes-support/libgcrypt/files/0001-tests-Fix-link-errors-for-t-thread-local.patch b/meta/recipes-support/libgcrypt/files/0001-tests-Fix-link-errors-for-t-thread-local.patch
new file mode 100644
index 0000000000..5ebc3831d4
--- /dev/null
+++ b/meta/recipes-support/libgcrypt/files/0001-tests-Fix-link-errors-for-t-thread-local.patch
@@ -0,0 +1,34 @@
1From 746dc1c3837546c1085102e546a83da8d1c773e1 Mon Sep 17 00:00:00 2001
2From: Collin Funk <collin.funk1@gmail.com>
3Date: Thu, 1 May 2025 22:20:58 -0700
4Subject: [PATCH] tests: Fix link errors for t-thread-local.
5
6On platforms where pthread_create is not in libc t-thread-local fails to
7link. Issue found on NetBSD 10.0.
8* tests/Makefile.am (t_thread_local_LDADD): Add $(standard_ldadd),
9$(GPG_ERROR_MT_LIBS), and @LDADD_FOR_TESTS_KLUDGE@.
10(t_thread_local_CFLAGS): Add $(GPG_ERROR_MT_CFLAGS).
11
12--
13
14Upstream-Status: Backport [793eda7b258a562757b51c96044b103b638f1a63]
15GnuPG-bug-id: 7634
16Signed-off-by: Collin Funk <collin.funk1@gmail.com>
17Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
18---
19 tests/Makefile.am | 2 ++
20 1 file changed, 2 insertions(+)
21
22diff --git a/tests/Makefile.am b/tests/Makefile.am
23index 9a9e1c2c264a..b80f266f97c2 100644
24--- a/tests/Makefile.am
25+++ b/tests/Makefile.am
26@@ -94,6 +94,8 @@ t_secmem_LDADD = $(standard_ldadd) @LDADD_FOR_TESTS_KLUDGE@
27 testapi_LDADD = $(standard_ldadd) @LDADD_FOR_TESTS_KLUDGE@
28 t_lock_LDADD = $(standard_ldadd) $(GPG_ERROR_MT_LIBS) @LDADD_FOR_TESTS_KLUDGE@
29 t_lock_CFLAGS = $(GPG_ERROR_MT_CFLAGS) -lpthread
30+t_thread_local_LDADD = $(standard_ldadd) $(GPG_ERROR_MT_LIBS) @LDADD_FOR_TESTS_KLUDGE@
31+t_thread_local_CFLAGS = $(GPG_ERROR_MT_CFLAGS) -lpthread
32 testdrv_LDADD = $(LDADD_FOR_TESTS_KLUDGE)
33
34 # Build a version of the test driver for the build platform.
diff --git a/meta/recipes-support/libgcrypt/libgcrypt_1.11.1.bb b/meta/recipes-support/libgcrypt/libgcrypt_1.11.1.bb
index e51a20e5bf..5574e8c821 100644
--- a/meta/recipes-support/libgcrypt/libgcrypt_1.11.1.bb
+++ b/meta/recipes-support/libgcrypt/libgcrypt_1.11.1.bb
@@ -21,6 +21,7 @@ UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
21SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.bz2 \ 21SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.bz2 \
22 file://0001-libgcrypt-fix-m4-file-for-oe-core.patch \ 22 file://0001-libgcrypt-fix-m4-file-for-oe-core.patch \
23 file://0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch \ 23 file://0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch \
24 file://0001-tests-Fix-link-errors-for-t-thread-local.patch \
24 file://no-native-gpg-error.patch \ 25 file://no-native-gpg-error.patch \
25 file://no-bench-slope.patch \ 26 file://no-bench-slope.patch \
26 file://run-ptest \ 27 file://run-ptest \