Provide __start_minfo/__stop_minfo for linkers that don't (PR d/87864)

	libphobos:
	PR d/87864
	* configure.ac (DRTSTUFF_SPEC): New variable.
	Substitute it.
	* libdruntime/m4/druntime/os.m4 (DRUNTIME_OS_MINFO_BRACKETING):
	New automake conditional.
	* configure: Regenerate.
	* libdruntime/gcc/drtstuff.c: New file.
	* libdruntime/Makefile.am [!DRUNTIME_OS_MINFO_BRACKETING]
	(DRTSTUFF, toolexeclib_DATA): New variables.
	(gcc/drtbegin.lo, gcc/drtend.lo): New rules.
	(libgdruntime_la_LDFLAGS): Use -Wc instead of -Xcompiler.
	Add -dstartfiles -B../src -Bgcc.
	(libgdruntime_la_DEPENDENCIES): New variable.
	(unittest_static_LDFLAGS): Use -Wc instead of -Xcompiler.
	(libgdruntime_t_la_LDFLAGS): Likewise.
	(unittest_LDFLAGS): Likewise.
	* src/Makefile.am (libgphobos_la_LDFLAGS): Use -Wc instead of
	-Xcompiler.
	Add -dstartfiles -B../libdruntime/gcc.
	(unittest_static_LDFLAGS): Use -Wc instead of -Xcompiler.
	(libgphobos_t_la_LDFLAGS): Likewise.
	(unittest_LDFLAGS): Likewise.
	* libdruntime/Makefile.in, src/Makefile.in: Regenerate.
	* Makefile.in, testsuite/Makefile.in: Regenerate.
	* libdruntime/rt/sections_elf_shared.d (Minfo_Bracketing): Don't
	assert.
	* libdruntime/gcc/config.d.in (Minfo_Bracketing): Remove.
	* src/drtstuff.spec: New file.
	* src/libgphobos.spec.in (DRTSTUFF_SPEC): Substitute.
	(*lib): Only pass SPEC_PHOBOS_DEPS without -debuglib, -defaultlib,
	-nophoboslib.
	* testsuite/testsuite_flags.in <--gdcldflags> (GDCLDFLAGS): Add
	-B${BUILD_DIR}/libdruntime/gcc.

	gcc/d:
	PR d/87864
	* lang.opt (dstartfiles): New option.
	* d-spec.cc (need_spec): New variable.
	(lang_specific_driver) <OPT_dstartfiles>: Enable need_spec.
	(lang_specific_pre_link): Also load libgphobos.spec if need_spec.

	gcc/testsuite:
	PR d/87864
	* lib/gdc.exp (gdc_link_flags): Add path to drtbegin.o/drtend.o if
	present.

From-SVN: r268886
diff --git a/libphobos/configure b/libphobos/configure
index 9f96ad5..4741c28 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -3,7 +3,7 @@
 # Generated by GNU Autoconf 2.69 for package-unused version-unused.
 #
 #
-# Copyright (C) 1992-2019 Free Software Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -650,6 +650,8 @@
 DCFG_HAVE_LIBATOMIC
 DCFG_HAVE_64BIT_ATOMICS
 DCFG_HAVE_ATOMIC_BUILTINS
+DRUNTIME_OS_MINFO_BRACKETING_FALSE
+DRUNTIME_OS_MINFO_BRACKETING_TRUE
 DCFG_MINFO_BRACKETING
 DRUNTIME_OS_ARM_EABI_UNWINDER_FALSE
 DRUNTIME_OS_ARM_EABI_UNWINDER_TRUE
@@ -801,7 +803,7 @@
 PACKAGE_NAME
 PATH_SEPARATOR
 SHELL'
-ac_subst_files=''
+ac_subst_files='DRTSTUFF_SPEC'
 ac_user_opts='
 enable_option_checking
 enable_multilib
@@ -1568,7 +1570,7 @@
 package-unused configure version-unused
 generated by GNU Autoconf 2.69
 
-Copyright (C) 2012-2019 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -11496,7 +11498,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11499 "configure"
+#line 11501 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11602,7 +11604,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11605 "configure"
+#line 11607 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -14119,6 +14121,14 @@
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 
+   if test "$DCFG_MINFO_BRACKETING" = "true"; then
+  DRUNTIME_OS_MINFO_BRACKETING_TRUE=
+  DRUNTIME_OS_MINFO_BRACKETING_FALSE='#'
+else
+  DRUNTIME_OS_MINFO_BRACKETING_TRUE='#'
+  DRUNTIME_OS_MINFO_BRACKETING_FALSE=
+fi
+
   ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -14856,6 +14866,14 @@
 
 
 
+# Add drtbegin.o/drtend.o to startfile/endfile specs in libgphobos.spec
+if test "$DCFG_MINFO_BRACKETING" = "false"; then
+    DRTSTUFF_SPEC=$srcdir/src/drtstuff.spec
+else
+    DRTSTUFF_SPEC=/dev/null
+fi
+
+
 # Add dependencies for libgphobos.spec file
 SPEC_PHOBOS_DEPS="$LIBS"
 
@@ -15095,6 +15113,10 @@
   as_fn_error $? "conditional \"DRUNTIME_OS_ARM_EABI_UNWINDER\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${DRUNTIME_OS_MINFO_BRACKETING_TRUE}" && test -z "${DRUNTIME_OS_MINFO_BRACKETING_FALSE}"; then
+  as_fn_error $? "conditional \"DRUNTIME_OS_MINFO_BRACKETING\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${DRUNTIME_ZLIB_SYSTEM_TRUE}" && test -z "${DRUNTIME_ZLIB_SYSTEM_FALSE}"; then
   as_fn_error $? "conditional \"DRUNTIME_ZLIB_SYSTEM\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -15566,7 +15588,7 @@
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2012-2019 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -16099,7 +16121,24 @@
 # This happens for instance with `./config.status config.h'.
 if test -n "$CONFIG_FILES"; then
 
-
+if $AWK 'BEGIN { getline <"/dev/null" }' </dev/null 2>/dev/null; then
+  ac_cs_awk_getline=:
+  ac_cs_awk_pipe_init=
+  ac_cs_awk_read_file='
+      while ((getline aline < (F[key])) > 0)
+	print(aline)
+      close(F[key])'
+  ac_cs_awk_pipe_fini=
+else
+  ac_cs_awk_getline=false
+  ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\""
+  ac_cs_awk_read_file='
+      print "|#_!!_#|"
+      print "cat " F[key] " &&"
+      '$ac_cs_awk_pipe_init
+  # The final `:' finishes the AND list.
+  ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }'
+fi
 ac_cr=`echo X | tr X '\015'`
 # On cygwin, bash can eat \r inside `` if the user requested igncr.
 # But we know of no other shell where ac_cr would be empty at this
@@ -16117,6 +16156,17 @@
 echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
+# Create commands to substitute file output variables.
+{
+  echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" &&
+  echo 'cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&' &&
+  echo "$ac_subst_files" | sed 's/.*/F["&"]="$&"/' &&
+  echo "_ACAWK" &&
+  echo "_ACEOF"
+} >conf$$files.sh &&
+. ./conf$$files.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+rm -f conf$$files.sh
 
 {
   echo "cat >conf$$subs.awk <<_ACEOF" &&
@@ -16193,7 +16243,7 @@
 cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
-
+  \$ac_cs_awk_pipe_init
 }
 {
   line = $ 0
@@ -16211,10 +16261,16 @@
     } else
       len += 1 + keylen
   }
-
+  if (nfields == 3 && !substed) {
+    key = field[2]
+    if (F[key] != "" && line ~ /^[	 ]*@.*@[	 ]*$/) {
+      \$ac_cs_awk_read_file
+      next
+    }
+  }
   print line
 }
-
+\$ac_cs_awk_pipe_fini
 _ACAWK
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
@@ -16561,7 +16617,12 @@
 s&@MKDIR_P@&$ac_MKDIR_P&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" |
+if $ac_cs_awk_getline; then
+  $AWK -f "$ac_tmp/subs.awk"
+else
+  $AWK -f "$ac_tmp/subs.awk" | $SHELL
+fi \
   >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
@@ -16674,7 +16735,8 @@
 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
 #
-#   Copyright (C) 1996-2019 Free Software Foundation, Inc.
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 #   This file is part of GNU Libtool.