Page MenuHome GnuPG

libgcrypt's test t-thread-local fails to link on some platforms.
Open, HighPublic

Description

On NetBSD 10.0 with gcc 10.5.0 libgcrypt's master branch fails to build with the following error:

libtool: link: gcc -I/home/collinfunk/tmp/include -g -O2 -fvisibility=hidden -fno-delete-null-pointer-checks -Wall -o t-thread-local t-thread-local.o  ../src/.libs/libgcrypt.so -L/home/collinfunk/tmp/lib ../compat/.libs/libcompat.a /home/collinfunk/tmp/lib/libgpg-error.so -Wl,-rpath -Wl,/home/collinfunk/libgcrypt-1.11.1-beta145/src/.libs -Wl,-rpath -Wl,/home/collinfunk/tmp/lib -Wl,-rpath -Wl,/home/collinfunk/tmp/lib
ld: t-thread-local.o: in function `check_thread_local':
/home/collinfunk/libgcrypt-1.11.1-beta145/tests/t-thread-local.c:124: undefined reference to `pthread_create'
/home/collinfunk/libgcrypt-1.11.1-beta145/tests/t-thread-local.c:124:(.text.startup+0x194): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `pthread_create'

It looks like this was a recently added test. Many platforms including GNU/Linux define pthread functions in libc nowadays, so I assume that is why this is missed. NetBSD is one of the platforms that still requires linking to libpthread.

Revisions and Commits