summaryrefslogtreecommitdiff
path: root/Build/source/texk/upmendex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-12-12 18:25:29 +0000
committerKarl Berry <karl@freefriends.org>2019-12-12 18:25:29 +0000
commit826971da3ef29f6034fc6a4786f88878a56c58e3 (patch)
tree023539b0120ff775316abf6a86f03c6f1f54b973 /Build/source/texk/upmendex
parent15a740f0c75d97855e67ba5bf83612e7b29a1319 (diff)
icu-65.1, including linking upmendex with -lpthread if available
git-svn-id: svn://tug.org/texlive/trunk@53103 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/upmendex')
-rw-r--r--Build/source/texk/upmendex/ChangeLog22
-rw-r--r--Build/source/texk/upmendex/Makefile.am9
-rw-r--r--Build/source/texk/upmendex/Makefile.in7
-rw-r--r--Build/source/texk/upmendex/aclocal.m41
-rwxr-xr-xBuild/source/texk/upmendex/configure68
-rw-r--r--Build/source/texk/upmendex/configure.ac18
6 files changed, 115 insertions, 10 deletions
diff --git a/Build/source/texk/upmendex/ChangeLog b/Build/source/texk/upmendex/ChangeLog
index 6ea60fd3845..3340d380b02 100644
--- a/Build/source/texk/upmendex/ChangeLog
+++ b/Build/source/texk/upmendex/ChangeLog
@@ -1,3 +1,25 @@
+2019-12-12 Karl Berry <karl@freefriends.org>
+
+ * configure.ac: look for a pthread library cntaining
+ pthread_create (using KPSE_SEARCH_LIBS) and set PTHREAD_LIB if found.
+ * Makefile.am (LDADD): include $(PTHREAD_LIB).
+
+As of ICU 65.1, upmendex requires -lpthread. Otherwise, it crashes
+at sort.c:82, which merely creates the icu_collator:
+ icu_collator = ucol_open(icu_locale, &status);
+
+About 10 stack frames deep into the ICU initialization, this winds up calling
+(Build/source/libs/icu/icu-src/source/common/umutex.cpp:146):
+ std::call_once(*pInitFlag, umtx_init);
+
+which results in a fatal error from stdc++:
+ terminate called after throwing an instance of 'std::system_error'
+ what(): Unknown error -1
+
+Web searching indicated that that opaque error message is a result of not
+linking with -lpthread. So now we do so. So far our other ICU programs
+(bibtexu, xetex) don't seem to require it.
+
2019-03-16 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
* upmendex.ja.txt: Rename from upmendex.doc,
diff --git a/Build/source/texk/upmendex/Makefile.am b/Build/source/texk/upmendex/Makefile.am
index 0ec7b0c2f0b..fc188887f4c 100644
--- a/Build/source/texk/upmendex/Makefile.am
+++ b/Build/source/texk/upmendex/Makefile.am
@@ -1,8 +1,8 @@
## $Id$
## Makefile.am for the TeX Live subdirectory texk/upmendex/
##
-## Copyright 2017 Karl Berry <tex-live@tug.org>
-## Copyright 2010-2014 Peter Breitenlohner <tex-live@tug.org>
+## Copyright 2015-2019 Karl Berry <tex-live@tug.org>
+## Copyright 2010-2015 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.
##
AM_CPPFLAGS = $(KPATHSEA_INCLUDES) $(ICU_INCLUDES)
@@ -29,15 +29,12 @@ upmendex_SOURCES = \
styfile.c \
var.h
-
-
# Force Automake to use CXXLD for linking
nodist_EXTRA_upmendex_SOURCES = dummy.cxx
-
$(upmendex_OBJECTS): $(KPATHSEA_DEPEND) $(ICU_DEPEND)
-LDADD = $(KPATHSEA_LIBS) $(ICU_LIBS) $(ICU_LIBS_EXTRA)
+LDADD = $(KPATHSEA_LIBS) $(ICU_LIBS) $(PTHREAD_LIB) $(ICU_LIBS_EXTRA)
## Rebuild libkpathsea
@KPATHSEA_RULE@
diff --git a/Build/source/texk/upmendex/Makefile.in b/Build/source/texk/upmendex/Makefile.in
index 32086ae1de2..08c9fae74a1 100644
--- a/Build/source/texk/upmendex/Makefile.in
+++ b/Build/source/texk/upmendex/Makefile.in
@@ -95,6 +95,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \
$(top_srcdir)/../../m4/kpse-cxx-hack.m4 \
$(top_srcdir)/../../m4/kpse-icu-flags.m4 \
$(top_srcdir)/../../m4/kpse-kpathsea-flags.m4 \
+ $(top_srcdir)/../../m4/kpse-search-libs.m4 \
$(top_srcdir)/../../m4/kpse-warnings.m4 \
$(top_srcdir)/../../m4/libtool.m4 \
$(top_srcdir)/../../m4/ltoptions.m4 \
@@ -121,7 +122,8 @@ am_upmendex_OBJECTS = convert.$(OBJEXT) fread.$(OBJEXT) \
upmendex_OBJECTS = $(am_upmendex_OBJECTS)
upmendex_LDADD = $(LDADD)
am__DEPENDENCIES_1 =
-upmendex_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+upmendex_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
@@ -515,6 +517,7 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
+PTHREAD_LIB = @PTHREAD_LIB@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
@@ -600,7 +603,7 @@ upmendex_SOURCES = \
# Force Automake to use CXXLD for linking
nodist_EXTRA_upmendex_SOURCES = dummy.cxx
-LDADD = $(KPATHSEA_LIBS) $(ICU_LIBS) $(ICU_LIBS_EXTRA)
+LDADD = $(KPATHSEA_LIBS) $(ICU_LIBS) $(PTHREAD_LIB) $(ICU_LIBS_EXTRA)
EXTRA_DIST = COPYRIGHT indexsty upmendex.ja.txt $(TESTS) tests/foo.idx \
tests/foo.ind tests/uni.idx tests/uni.dict tests/uni.ist \
tests/uni.ind
diff --git a/Build/source/texk/upmendex/aclocal.m4 b/Build/source/texk/upmendex/aclocal.m4
index 5dc224d3180..5392efefa96 100644
--- a/Build/source/texk/upmendex/aclocal.m4
+++ b/Build/source/texk/upmendex/aclocal.m4
@@ -1173,6 +1173,7 @@ m4_include([../../m4/kpse-common.m4])
m4_include([../../m4/kpse-cxx-hack.m4])
m4_include([../../m4/kpse-icu-flags.m4])
m4_include([../../m4/kpse-kpathsea-flags.m4])
+m4_include([../../m4/kpse-search-libs.m4])
m4_include([../../m4/kpse-warnings.m4])
m4_include([../../m4/libtool.m4])
m4_include([../../m4/ltoptions.m4])
diff --git a/Build/source/texk/upmendex/configure b/Build/source/texk/upmendex/configure
index e22e3d6a4de..44c1436957b 100755
--- a/Build/source/texk/upmendex/configure
+++ b/Build/source/texk/upmendex/configure
@@ -638,6 +638,7 @@ ICU_DEPEND
ICU_LIBS
ICU_INCLUDES
ICU_CONFIG
+PTHREAD_LIB
KPATHSEA_RULE
KPATHSEA_DEPEND
KPATHSEA_LIBS
@@ -19513,6 +19514,73 @@ if test "x$kpse_cv_kpse_debug" != xyes; then :
KPATHSEA_INCLUDES="$KPATHSEA_INCLUDES -DNO_DEBUG"
fi
+kpse_search_save_LIBS=$LIBS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5
+$as_echo_n "checking for library containing pthread_create... " >&6; }
+if ${ac_cv_search_pthread_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' pthread; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_pthread_create=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_pthread_create+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_pthread_create+:} false; then :
+
+else
+ ac_cv_search_pthread_create=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_create" >&5
+$as_echo "$ac_cv_search_pthread_create" >&6; }
+ac_res=$ac_cv_search_pthread_create
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+LIBS=$kpse_search_save_LIBS
+case $ac_cv_search_pthread_create in #(
+ "none required") :
+ ;; #(
+ no) :
+ as_fn_error $? "Sorry, did not find pthread_create()" "$LINENO" 5 ;; #(
+ *) :
+ PTHREAD_LIB=$ac_cv_search_pthread_create ;;
+esac
+
echo 'tldbg:KPSE_ICU_FLAGS called: more-icu-libs=icuio icui18n, icu-config-args=--ldflags-icuio.' >&5
##tldbg _KPSE_LIB_FLAGS: Setup icu (-licuxxx) flags.
echo 'tldbg:_KPSE_LIB_FLAGS called: libdir=icu, libname=icuxxx, options=, tlincl=-DU_STATIC_IMPLEMENTATION -IBLD/libs/icu/include, tllib=BLD/libs/icu/icu-build/lib/libicuio.a BLD/libs/icu/icu-build/lib/libicui18n.a BLD/libs/icu/icu-build/lib/libicuuc.a BLD/libs/icu/icu-build/lib/libicudata.a, tlextra=, rebuildsrcdeps=, rebuildblddeps=${top_builddir}/../../libs/icu/include/unicode/uversion.h.' >&5
diff --git a/Build/source/texk/upmendex/configure.ac b/Build/source/texk/upmendex/configure.ac
index 9a6cbfa555e..0b443d65d26 100644
--- a/Build/source/texk/upmendex/configure.ac
+++ b/Build/source/texk/upmendex/configure.ac
@@ -1,7 +1,8 @@
+dnl $Id$
dnl Process this file with autoconf to produce a configure script.
dnl
-dnl Copyright 2016 Karl Berry <tex-live@tug.org>
-dnl Copyright 2010-2014 Peter Breitenlohner <tex-live@tug.org>
+dnl Copyright 2015-2019 Karl Berry <tex-live@tug.org>
+dnl Copyright 2010-2019 Peter Breitenlohner <tex-live@tug.org>
dnl
dnl This file is free software; the copyright holder
dnl gives unlimited permission to copy and/or distribute it,
@@ -36,7 +37,20 @@ AS_CASE([$kpse_cv_have___VA_ARGS__],
[yes], [AC_DEFINE([HAVE___VA_ARGS__], 1,
[Define to 1 if you have C99 variadic macros.])])
+dnl As of ICU 65.1, ICU requires -lpthread on x86_64-linux and, most
+dnl likely, on other platforms. Otherwise there is a crash in
+dnl std::call_once, as shown in ChangeLog. OpenBSD already has to link
+dnl with -lpthread on all platforms (see m4/kpse-icu-flags.m4), but so
+dnl far it seems only upmendex requires it elsewhere. The double
+dnl inclusion of -lpthread on obsd should be harmless.
+dnl
+dnl The autoconf-archive ax_pthread macro (used in asymptote) goes to
+dnl much greater lengths to find the best thread library and support all
+dnl platforms. We can switch to that if necessary, but hopefully this
+dnl simple test will be enough.
+dnl
KPSE_KPATHSEA_FLAGS
+KPSE_SEARCH_LIBS([PTHREAD_LIB], [pthread_create], [pthread])
KPSE_ICU_FLAGS([icuio icui18n], [--ldflags-icuio])
AC_CONFIG_FILES([Makefile])