Merges upstream druntime
bbfb58e8.
libphobos/ChangeLog:
2019-02-19 Johannes Pfau <johannespfau@gmail.com>
PR d/88127
* m4/druntime/libraries.m4 (DRUNTIME_LIBRARIES_CLIB): Add new macro.
* configure.ac: Use DRUNTIME_LIBRARIES_CLIB.
* configure: Regenerate
* Makefile.in: Regenerate
* libdruntime/gcc/config.d.in: Add Have_Qsort_R.
* libdruntime/Makefile.in: Regenerate.
* src/Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.
From-SVN: r268999
+2019-02-19 Johannes Pfau <johannespfau@gmail.com>
+
+ PR d/88127
+ * m4/druntime/libraries.m4 (DRUNTIME_LIBRARIES_CLIB): Add new macro.
+ * configure.ac: Use DRUNTIME_LIBRARIES_CLIB.
+ * configure: Regenerate
+ * Makefile.in: Regenerate
+ * libdruntime/gcc/config.d.in: Add Have_Qsort_R.
+ * libdruntime/Makefile.in: Regenerate.
+ * src/Makefile.in: Regenerate.
+ * testsuite/Makefile.in: Regenerate.
+
2019-02-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* testsuite/lib/libphobos-dg.exp: Tabify.
DCFG_HAVE_64BIT_ATOMICS = @DCFG_HAVE_64BIT_ATOMICS@
DCFG_HAVE_ATOMIC_BUILTINS = @DCFG_HAVE_ATOMIC_BUILTINS@
DCFG_HAVE_LIBATOMIC = @DCFG_HAVE_LIBATOMIC@
+DCFG_HAVE_QSORT_R = @DCFG_HAVE_QSORT_R@
DCFG_MINFO_BRACKETING = @DCFG_MINFO_BRACKETING@
DCFG_THREAD_MODEL = @DCFG_THREAD_MODEL@
DEFS = @DEFS@
DCFG_HAVE_LIBATOMIC
DCFG_HAVE_64BIT_ATOMICS
DCFG_HAVE_ATOMIC_BUILTINS
+DCFG_HAVE_QSORT_R
DRUNTIME_OS_MINFO_BRACKETING_FALSE
DRUNTIME_OS_MINFO_BRACKETING_TRUE
DCFG_MINFO_BRACKETING
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11501 "configure"
+#line 11502 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11607 "configure"
+#line 11608 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ DCFG_HAVE_QSORT_R=false
+ ac_fn_c_check_func "$LINENO" "qsort_r" "ac_cv_func_qsort_r"
+if test "x$ac_cv_func_qsort_r" = xyes; then :
+ DCFG_HAVE_QSORT_R=true
+fi
+
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
gdc_save_DFLAGS=$GDCFLAGS
DRUNTIME_OS_THREAD_MODEL
DRUNTIME_OS_ARM_EABI_UNWINDER
DRUNTIME_OS_MINFO_BRACKETING
+DRUNTIME_LIBRARIES_CLIB
WITH_LOCAL_DRUNTIME([
AC_LANG_PUSH([D])
-fb4bda91b0b43b5a18e1c143943c101ad4e17667
+bbfb58e8a921cabdd0002a40bf63fe35ed7c77e8
The first line of this file holds the git revision number of the last
merge done from the dlang/druntime repository.
DCFG_HAVE_64BIT_ATOMICS = @DCFG_HAVE_64BIT_ATOMICS@
DCFG_HAVE_ATOMIC_BUILTINS = @DCFG_HAVE_ATOMIC_BUILTINS@
DCFG_HAVE_LIBATOMIC = @DCFG_HAVE_LIBATOMIC@
+DCFG_HAVE_QSORT_R = @DCFG_HAVE_QSORT_R@
DCFG_MINFO_BRACKETING = @DCFG_MINFO_BRACKETING@
DCFG_THREAD_MODEL = @DCFG_THREAD_MODEL@
DEFS = @DEFS@
// Do we have libatomic available
enum GNU_Have_LibAtomic = @DCFG_HAVE_LIBATOMIC@;
+
+// Do we have qsort_r function
+enum Have_Qsort_R = @DCFG_HAVE_QSORT_R@;
else version (WatchOS)
version = Darwin;
+// qsort_r was added in glibc in 2.8. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88127
version (CRuntime_Glibc)
+{
+ version (GNU)
+ {
+ import gcc.config : Have_Qsort_R;
+ enum Glibc_Qsort_R = Have_Qsort_R;
+ }
+ else
+ {
+ enum Glibc_Qsort_R = true;
+ }
+}
+else
+{
+ enum Glibc_Qsort_R = false;
+}
+
+static if (Glibc_Qsort_R)
{
alias extern (C) int function(scope const void *, scope const void *, scope void *) Cmp;
extern (C) void qsort_r(scope void *base, size_t nmemb, size_t size, Cmp cmp, scope void *arg);
AC_SUBST(BACKTRACE_SUPPORTS_THREADS)
AC_LANG_POP([C])
])
+
+# DRUNTIME_LIBRARIES_CLIB
+# -----------------------
+# Perform various feature checks on the C library.
+AC_DEFUN([DRUNTIME_LIBRARIES_CLIB],
+[
+ AC_LANG_PUSH([C])
+ DCFG_HAVE_QSORT_R=false
+ AC_CHECK_FUNC(qsort_r, [DCFG_HAVE_QSORT_R=true])
+ AC_SUBST(DCFG_HAVE_QSORT_R)
+ AC_LANG_POP([C])
+])
DCFG_HAVE_64BIT_ATOMICS = @DCFG_HAVE_64BIT_ATOMICS@
DCFG_HAVE_ATOMIC_BUILTINS = @DCFG_HAVE_ATOMIC_BUILTINS@
DCFG_HAVE_LIBATOMIC = @DCFG_HAVE_LIBATOMIC@
+DCFG_HAVE_QSORT_R = @DCFG_HAVE_QSORT_R@
DCFG_MINFO_BRACKETING = @DCFG_MINFO_BRACKETING@
DCFG_THREAD_MODEL = @DCFG_THREAD_MODEL@
DEFS = @DEFS@
DCFG_HAVE_64BIT_ATOMICS = @DCFG_HAVE_64BIT_ATOMICS@
DCFG_HAVE_ATOMIC_BUILTINS = @DCFG_HAVE_ATOMIC_BUILTINS@
DCFG_HAVE_LIBATOMIC = @DCFG_HAVE_LIBATOMIC@
+DCFG_HAVE_QSORT_R = @DCFG_HAVE_QSORT_R@
DCFG_MINFO_BRACKETING = @DCFG_MINFO_BRACKETING@
DCFG_THREAD_MODEL = @DCFG_THREAD_MODEL@
DEFS = @DEFS@