From 1ede0c716beeee4a720ff5c361121021555d7e3c Mon Sep 17 00:00:00 2001 From: Rob N Date: Fri, 10 May 2024 00:43:48 +1000 Subject: [PATCH] libspl_assert: always link -lpthread on FreeBSD The pthread_* functions are in -lpthread on FreeBSD. Some of them are implicitly linked through libc, but on FreeBSD 13 at least pthread_getname_np() is not. Just be explicit, since -lpthread is the documented interface anyway. Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf Signed-off-by: Rob Norris Closes #16168 --- lib/libspl/Makefile.am | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libspl/Makefile.am b/lib/libspl/Makefile.am index eb2377305aca..94be416d46aa 100644 --- a/lib/libspl/Makefile.am +++ b/lib/libspl/Makefile.am @@ -45,3 +45,7 @@ libspl_la_LIBADD = \ libspl_la_LIBADD += $(LIBATOMIC_LIBS) $(LIBCLOCK_GETTIME) libspl_assert_la_LIBADD = $(BACKTRACE_LIBS) $(LIBUNWIND_LIBS) + +if BUILD_FREEBSD +libspl_assert_la_LIBADD += -lpthread +endif