ports/Mk/Uses/gettext-runtime.mk
Tijl Coosemans fb889ca829 devel/gettext-runtime: Fix crash triggered by libgpg-error
Libgpg-error has an initialisation function with
__attribute__((constructor)) that calls a libintl function that
calls pthread_rwlock_wrlock that segfaults if libpthread wasn't
initialised yet.  This can happen because libintl doesn't link to
libpthread to avoid the overhead for non-threaded programs.  To
fix this, add an initialisation function to libintl that triggers
initialisation of libpthread.

RTLD_NOLOAD suggested by kib.

dlopen was fixed to work during initialisation in
https://cgit.FreeBSD.org/src/commit/?id=1005d3d05362

PR:		272472, 272517
2023-07-17 20:53:17 +02:00

27 lines
749 B
Makefile

# Handle dependency on the gettext-runtime (libintl) port
#
# Feature: gettext-runtime
# Usage: USES=gettext-runtime or USES=gettext-runtime:ARGS
# Valid ARGS: lib (default), build, run
#
# MAINTAINER: tijl@FreeBSD.org
.if !defined(_INCLUDE_USES_GETTEXT_RUNTIME_MK)
_INCLUDE_USES_GETTEXT_RUNTIME_MK= yes
. if empty(gettext-runtime_ARGS)
gettext-runtime_ARGS= lib
. endif
. if ${gettext-runtime_ARGS:Mlib}
BUILD_DEPENDS+= gettext-runtime>=0.22_1:devel/gettext-runtime
LIB_DEPENDS+= libintl.so:devel/gettext-runtime
. endif
. if ${gettext-runtime_ARGS:Mbuild}
BUILD_DEPENDS+= gettext-runtime>=0.22_1:devel/gettext-runtime
. endif
. if ${gettext-runtime_ARGS:Mrun}
RUN_DEPENDS+= gettext-runtime>=0.22_1:devel/gettext-runtime
. endif
.endif