With an upcoming change to the LibreSSL pc files (for OpenBSD only), the
output of 'pkg-config libssl --modversion' becomes 2.0.0 instead of 1.0.0.
This results in LIBSSL_SET_MUTEX_SHARED = 1 being set in src/Makefile.defs,
which in turn ends up adding LIBDL=-ldl to the linker flags and that breaks
the build.

The below forces LIBSSL_SET_MUTEX_SHARED back to 0, the value that has
been used up to now.

Another option would be to modify Makefile.defs to treat OpenBSD
as NetBSD and set LIBDL="" to avoid -ldl. However, this would
enable some workaround for "libssl 1.1+ thread-only mutex
initialization" which wasn't previously needed (see end of src/main.c).

Index: Makefile
===================================================================
RCS file: /cvs/ports/telephony/kamailio/Makefile,v
retrieving revision 1.50
diff -u -p -r1.50 Makefile
--- Makefile    4 Dec 2021 21:22:58 -0000       1.50
+++ Makefile    3 Feb 2022 14:28:32 -0000
@@ -69,7 +69,8 @@ MAKE_FLAGS =  LIBDIR=lib \
                group_include="${KAMAILIO_GROUPS}" \
                LIBsrdb1_VERSION=${LIBsrdb1_VERSION} \
                LIBsrdb2_VERSION=${LIBsrdb2_VERSION} \
-               LIBtrie_VERSION=${LIBtrie_VERSION}
+               LIBtrie_VERSION=${LIBtrie_VERSION} \
+               LIBSSL_SET_MUTEX_SHARED=0
 
 PSEUDO_FLAVORS +=      no_berkeley
 .if !${FLAVOR:Mno_berkeley}

Reply via email to