diff mbox series

libphobos: Add --with-libphobos-druntime-only option.

Message ID 20200418164148.6237-1-ibuclaw@gdcproject.org
State New
Headers show
Series libphobos: Add --with-libphobos-druntime-only option. | expand

Commit Message

Iain Buclaw April 18, 2020, 4:41 p.m. UTC
Hi,

This patch adds a new configure option --with-libphobos-druntime-only.

The intended purpose of the option is both for targets that don't
support phobos yet, and for gdc itself to support bootstrapping itself
as a self-hosted D compiler.

The libphobos testsuite has been updated to only add libphobos to the
search paths if it's being built.  A new D2 testsuite directive
RUNNABLE_PHOBOS_TEST has also been patched in to disable some runnable
tests that have phobos dependencies, of which is a temporary measure
until upstream DMD fixes or removes these tests entirely.

Bootstrapped and regression tested on x86_64-linux-gnu with this option
both turned on and off.  Committed to mainline.

Regards
Iain.

---
libphobos/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Add --with-libphobos-druntime-only option and the
	conditional ENABLE_LIBDRUNTIME_ONLY.
	* configure.tgt: Define LIBDRUNTIME_ONLY.
	* src/Makefile.am: Add phobos sources if not ENABLE_LIBDRUNTIME_ONLY.
	* src/Makefile.in: Regenerate.
	* testsuite/testsuite_flags.in: Add phobos path if compiling phobos.

gcc/testsuite/ChangeLog:

	* lib/gdc-utils.exp (gdc-convert-test): Add dg-skip-if for tests that
	depending on the phobos standard library.
---
 libphobos/configure                           |  48 ++-
 libphobos/configure.ac                        |  22 ++
 libphobos/configure.tgt                       |   1 +
 libphobos/src/Makefile.am                     |   8 +
 libphobos/src/Makefile.in                     | 314 ++++++++++--------
 libphobos/testsuite/testsuite_flags.in        |   7 +-
 gcc/testsuite/lib/gdc-utils.exp               |   9 +
 gcc/testsuite/gdc.test/runnable/builtin.d     |   1 +
 gcc/testsuite/gdc.test/runnable/complex.d     |   1 +
 gcc/testsuite/gdc.test/runnable/constfold.d   |   1 +
 gcc/testsuite/gdc.test/runnable/foreach4.d    |   1 +
 gcc/testsuite/gdc.test/runnable/ifti.d        |   1 +
 gcc/testsuite/gdc.test/runnable/implicit.d    |   1 +
 gcc/testsuite/gdc.test/runnable/inner.d       |   1 +
 gcc/testsuite/gdc.test/runnable/interpret.d   |   1 +
 gcc/testsuite/gdc.test/runnable/issue8671.d   |   1 +
 gcc/testsuite/gdc.test/runnable/lazy.d        |   1 +
 gcc/testsuite/gdc.test/runnable/mars1.d       |   1 +
 gcc/testsuite/gdc.test/runnable/mixin1.d      |   1 +
 gcc/testsuite/gdc.test/runnable/mixin2.d      |   1 +
 gcc/testsuite/gdc.test/runnable/s2ir.d        |   1 +
 gcc/testsuite/gdc.test/runnable/stress.d      |   1 +
 gcc/testsuite/gdc.test/runnable/template4.d   |   1 +
 gcc/testsuite/gdc.test/runnable/template9.d   |   1 +
 gcc/testsuite/gdc.test/runnable/test10942.d   |   1 +
 gcc/testsuite/gdc.test/runnable/test11.d      |   1 +
 gcc/testsuite/gdc.test/runnable/test12.d      |   1 +
 gcc/testsuite/gdc.test/runnable/test12197.d   |   1 +
 gcc/testsuite/gdc.test/runnable/test15.d      |   1 +
 gcc/testsuite/gdc.test/runnable/test22.d      |   1 +
 gcc/testsuite/gdc.test/runnable/test23.d      |   1 +
 gcc/testsuite/gdc.test/runnable/test24.d      |   1 +
 gcc/testsuite/gdc.test/runnable/test27.d      |   1 +
 gcc/testsuite/gdc.test/runnable/test28.d      |   1 +
 gcc/testsuite/gdc.test/runnable/test34.d      |   1 +
 gcc/testsuite/gdc.test/runnable/test37.d      |   1 +
 gcc/testsuite/gdc.test/runnable/test42.d      |   1 +
 gcc/testsuite/gdc.test/runnable/test5305.d    |   1 +
 gcc/testsuite/gdc.test/runnable/test60.d      |   1 +
 gcc/testsuite/gdc.test/runnable/testaa.d      |   1 +
 .../gdc.test/runnable/testbitarray.d          |   1 +
 gcc/testsuite/gdc.test/runnable/testdstress.d |   1 +
 gcc/testsuite/gdc.test/runnable/testfile.d    |   1 +
 gcc/testsuite/gdc.test/runnable/testformat.d  |   1 +
 gcc/testsuite/gdc.test/runnable/testline.d    |   1 +
 gcc/testsuite/gdc.test/runnable/testmmfile.d  |   1 +
 gcc/testsuite/gdc.test/runnable/testscope2.d  |   1 +
 gcc/testsuite/gdc.test/runnable/testsignals.d |   1 +
 gcc/testsuite/gdc.test/runnable/testsocket.d  |   1 +
 gcc/testsuite/gdc.test/runnable/teststdio.d   |   1 +
 gcc/testsuite/gdc.test/runnable/testthread2.d |   1 +
 gcc/testsuite/gdc.test/runnable/testtypeid.d  |   1 +
 gcc/testsuite/gdc.test/runnable/traits.d      |   1 +
 gcc/testsuite/gdc.test/runnable/wc.d          |   1 +
 gcc/testsuite/gdc.test/runnable/wc2.d         |   1 +
 gcc/testsuite/gdc.test/runnable/wc3.d         |   1 +
 gcc/testsuite/gdc.test/runnable/xtest46.d     |   1 +
 gcc/testsuite/gdc.test/runnable/xtest55.d     |   1 +
 58 files changed, 322 insertions(+), 138 deletions(-)
diff mbox series

Patch

diff --git a/libphobos/configure b/libphobos/configure
index a6f5aec2bfd..2dcf15ed852 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -638,6 +638,8 @@  GDCFLAGSX
 libtool_VERSION
 SPEC_PHOBOS_DEPS
 CHECKING_DFLAGS
+ENABLE_LIBDRUNTIME_ONLY_FALSE
+ENABLE_LIBDRUNTIME_ONLY_TRUE
 ENABLE_LIBPHOBOS_FALSE
 ENABLE_LIBPHOBOS_TRUE
 gdc_include_dir
@@ -840,6 +842,7 @@  with_cross_host
 enable_version_specific_runtime_libs
 with_toolexeclibdir
 enable_libphobos
+with_libdruntime_only
 enable_libphobos_checking
 '
       ac_precious_vars='build_alias
@@ -1509,6 +1512,8 @@  Optional Packages:
   --with-toolexeclibdir=DIR
                           install libraries built with a cross compiler within
                           DIR
+  --with-libphobos-druntime-only={yes,no,auto}
+                          build only the druntime library (default: auto)
 
 Some influential environment variables:
   CC          C compiler command
@@ -11645,7 +11650,7 @@  else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11648 "configure"
+#line 11653 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11751,7 +11756,7 @@  else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11754 "configure"
+#line 11759 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -15230,8 +15235,27 @@  fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_libphobos" >&5
 $as_echo "$enable_libphobos" >&6; }
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-libphobos-druntime-only" >&5
+$as_echo_n "checking for --with-libphobos-druntime-only... " >&6; }
+
+# Check whether --with-libdruntime-only was given.
+if test "${with_libdruntime_only+set}" = set; then :
+  withval=$with_libdruntime_only;
+else
+  with_libdruntime_only=auto
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_libdruntime_only" >&5
+$as_echo "$with_libdruntime_only" >&6; }
+
+case "$with_libdruntime_only" in
+  yes|no|auto) ;;
+  *) as_fn_error $? "Invalid argument for --with-libphobos-druntime-only" "$LINENO" 5 ;;
+esac
+
 # See if supported.
 unset LIBPHOBOS_SUPPORTED
+unset LIBDRUNTIME_ONLY
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for host support for libphobos" >&5
 $as_echo_n "checking for host support for libphobos... " >&6; }
 . ${srcdir}/configure.tgt
@@ -15274,6 +15298,22 @@  else
 fi
 
 
+# Decide if only libdruntime should be built.
+case $LIBDRUNTIME_ONLY:$with_libdruntime_only in
+*:no)  only_libdruntime=no  ;;
+*:yes) only_libdruntime=yes ;;
+yes:*) only_libdruntime=yes ;;
+*:*)   only_libdruntime=no  ;;
+esac
+ if test x$only_libdruntime = xyes; then
+  ENABLE_LIBDRUNTIME_ONLY_TRUE=
+  ENABLE_LIBDRUNTIME_ONLY_FALSE='#'
+else
+  ENABLE_LIBDRUNTIME_ONLY_TRUE='#'
+  ENABLE_LIBDRUNTIME_ONLY_FALSE=
+fi
+
+
 # Enable expensive internal checks
 # Check whether --enable-libphobos-checking was given.
 if test "${enable_libphobos_checking+set}" = set; then :
@@ -15577,6 +15617,10 @@  if test -z "${ENABLE_LIBPHOBOS_TRUE}" && test -z "${ENABLE_LIBPHOBOS_FALSE}"; th
   as_fn_error $? "conditional \"ENABLE_LIBPHOBOS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${ENABLE_LIBDRUNTIME_ONLY_TRUE}" && test -z "${ENABLE_LIBDRUNTIME_ONLY_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_LIBDRUNTIME_ONLY\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 
 : "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
diff --git a/libphobos/configure.ac b/libphobos/configure.ac
index ffd12981d0b..8c89ebd23b0 100644
--- a/libphobos/configure.ac
+++ b/libphobos/configure.ac
@@ -152,8 +152,21 @@  AC_ARG_ENABLE(libphobos,
   [AS_HELP_STRING([--enable-libphobos], [Enable libphobos])])
 AC_MSG_RESULT($enable_libphobos)
 
+AC_MSG_CHECKING([for --with-libphobos-druntime-only])
+AC_ARG_WITH(libdruntime-only,
+  AS_HELP_STRING([--with-libphobos-druntime-only={yes,no,auto}],
+		 [build only the druntime library (default: auto)]),,
+	    [with_libdruntime_only=auto])
+AC_MSG_RESULT($with_libdruntime_only)
+
+case "$with_libdruntime_only" in
+  yes|no|auto) ;;
+  *) AC_MSG_ERROR([Invalid argument for --with-libphobos-druntime-only]) ;;
+esac
+
 # See if supported.
 unset LIBPHOBOS_SUPPORTED
+unset LIBDRUNTIME_ONLY
 AC_MSG_CHECKING([for host support for libphobos])
 . ${srcdir}/configure.tgt
 case ${host} in
@@ -187,6 +200,15 @@  yes:*) use_libphobos=yes ;;
 esac
 AM_CONDITIONAL(ENABLE_LIBPHOBOS, test x$use_libphobos = xyes)
 
+# Decide if only libdruntime should be built.
+case $LIBDRUNTIME_ONLY:$with_libdruntime_only in
+*:no)  only_libdruntime=no  ;;
+*:yes) only_libdruntime=yes ;;
+yes:*) only_libdruntime=yes ;;
+*:*)   only_libdruntime=no  ;;
+esac
+AM_CONDITIONAL(ENABLE_LIBDRUNTIME_ONLY, test x$only_libdruntime = xyes)
+
 # Enable expensive internal checks
 AC_ARG_ENABLE(libphobos-checking,
 [AS_HELP_STRING([[--enable-libphobos-checking[=LIST]]],
diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt
index 8ef552a3332..66082e36fad 100644
--- a/libphobos/configure.tgt
+++ b/libphobos/configure.tgt
@@ -22,6 +22,7 @@ 
 # Disable the libphobos or libdruntime components on untested or known
 # broken systems.  More targets shall be added after testing.
 LIBPHOBOS_SUPPORTED=no
+LIBDRUNTIME_ONLY=auto
 case "${target}" in
   aarch64*-*-linux*)
 	LIBPHOBOS_SUPPORTED=yes
diff --git a/libphobos/src/Makefile.am b/libphobos/src/Makefile.am
index 51e3f501565..9fb416ecc32 100644
--- a/libphobos/src/Makefile.am
+++ b/libphobos/src/Makefile.am
@@ -70,6 +70,12 @@  install-data-local:
 # https://gist.github.com/jpf91/8744acebc9dcf1e9d1a35cdff20afbb2
 # Can't use wildcards here:
 # https://www.gnu.org/software/automake/manual/html_node/Wildcards.html
+if ENABLE_LIBDRUNTIME_ONLY
+
+PHOBOS_DSOURCES =
+
+else
+
 PHOBOS_DSOURCES = etc/c/curl.d etc/c/sqlite3.d etc/c/zlib.d \
 	std/algorithm/comparison.d std/algorithm/internal.d \
 	std/algorithm/iteration.d std/algorithm/mutation.d \
@@ -132,3 +138,5 @@  PHOBOS_DSOURCES = etc/c/curl.d etc/c/sqlite3.d etc/c/zlib.d \
 	std/utf.d std/uuid.d std/variant.d std/windows/charset.d \
 	std/windows/registry.d std/windows/syserror.d std/xml.d std/zip.d \
 	std/zlib.d
+
+endif
diff --git a/libphobos/src/Makefile.in b/libphobos/src/Makefile.in
index da9ba834c4b..e1b0588a690 100644
--- a/libphobos/src/Makefile.in
+++ b/libphobos/src/Makefile.in
@@ -145,77 +145,122 @@  am__installdirs = "$(DESTDIR)$(toolexeclibdir)" \
 LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 am__dirstamp = $(am__leading_dot)dirstamp
-am__objects_1 = etc/c/curl.lo etc/c/sqlite3.lo etc/c/zlib.lo \
-	std/algorithm/comparison.lo std/algorithm/internal.lo \
-	std/algorithm/iteration.lo std/algorithm/mutation.lo \
-	std/algorithm/package.lo std/algorithm/searching.lo \
-	std/algorithm/setops.lo std/algorithm/sorting.lo std/array.lo \
-	std/ascii.lo std/base64.lo std/bigint.lo std/bitmanip.lo \
-	std/compiler.lo std/complex.lo std/concurrency.lo \
-	std/container/array.lo std/container/binaryheap.lo \
-	std/container/dlist.lo std/container/package.lo \
-	std/container/rbtree.lo std/container/slist.lo \
-	std/container/util.lo std/conv.lo std/csv.lo \
-	std/datetime/date.lo std/datetime/interval.lo \
-	std/datetime/package.lo std/datetime/stopwatch.lo \
-	std/datetime/systime.lo std/datetime/timezone.lo \
-	std/demangle.lo std/digest/crc.lo std/digest/digest.lo \
-	std/digest/hmac.lo std/digest/md.lo std/digest/murmurhash.lo \
-	std/digest/package.lo std/digest/ripemd.lo std/digest/sha.lo \
-	std/encoding.lo std/exception.lo \
-	std/experimental/allocator/building_blocks/affix_allocator.lo \
-	std/experimental/allocator/building_blocks/allocator_list.lo \
-	std/experimental/allocator/building_blocks/bitmapped_block.lo \
-	std/experimental/allocator/building_blocks/bucketizer.lo \
-	std/experimental/allocator/building_blocks/fallback_allocator.lo \
-	std/experimental/allocator/building_blocks/free_list.lo \
-	std/experimental/allocator/building_blocks/free_tree.lo \
-	std/experimental/allocator/building_blocks/kernighan_ritchie.lo \
-	std/experimental/allocator/building_blocks/null_allocator.lo \
-	std/experimental/allocator/building_blocks/package.lo \
-	std/experimental/allocator/building_blocks/quantizer.lo \
-	std/experimental/allocator/building_blocks/region.lo \
-	std/experimental/allocator/building_blocks/scoped_allocator.lo \
-	std/experimental/allocator/building_blocks/segregator.lo \
-	std/experimental/allocator/building_blocks/stats_collector.lo \
-	std/experimental/allocator/common.lo \
-	std/experimental/allocator/gc_allocator.lo \
-	std/experimental/allocator/mallocator.lo \
-	std/experimental/allocator/mmap_allocator.lo \
-	std/experimental/allocator/package.lo \
-	std/experimental/allocator/showcase.lo \
-	std/experimental/allocator/typed.lo \
-	std/experimental/checkedint.lo std/experimental/logger/core.lo \
-	std/experimental/logger/filelogger.lo \
-	std/experimental/logger/multilogger.lo \
-	std/experimental/logger/nulllogger.lo \
-	std/experimental/logger/package.lo \
-	std/experimental/typecons.lo std/file.lo std/format.lo \
-	std/functional.lo std/getopt.lo std/internal/cstring.lo \
-	std/internal/math/biguintcore.lo \
-	std/internal/math/biguintnoasm.lo \
-	std/internal/math/errorfunction.lo \
-	std/internal/math/gammafunction.lo std/internal/scopebuffer.lo \
-	std/internal/test/dummyrange.lo std/internal/test/range.lo \
-	std/internal/test/uda.lo std/internal/unicode_comp.lo \
-	std/internal/unicode_decomp.lo \
-	std/internal/unicode_grapheme.lo std/internal/unicode_norm.lo \
-	std/internal/unicode_tables.lo \
-	std/internal/windows/advapi32.lo std/json.lo std/math.lo \
-	std/mathspecial.lo std/meta.lo std/mmfile.lo std/net/curl.lo \
-	std/net/isemail.lo std/numeric.lo std/outbuffer.lo \
-	std/parallelism.lo std/path.lo std/process.lo std/random.lo \
-	std/range/interfaces.lo std/range/package.lo \
-	std/range/primitives.lo std/regex/internal/backtracking.lo \
-	std/regex/internal/generator.lo std/regex/internal/ir.lo \
-	std/regex/internal/kickstart.lo std/regex/internal/parser.lo \
-	std/regex/internal/tests.lo std/regex/internal/thompson.lo \
-	std/regex/package.lo std/signals.lo std/socket.lo \
-	std/stdint.lo std/stdio.lo std/string.lo std/system.lo \
-	std/traits.lo std/typecons.lo std/typetuple.lo std/uni.lo \
-	std/uri.lo std/utf.lo std/uuid.lo std/variant.lo \
-	std/windows/charset.lo std/windows/registry.lo \
-	std/windows/syserror.lo std/xml.lo std/zip.lo std/zlib.lo
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@am__objects_1 = etc/c/curl.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	etc/c/sqlite3.lo etc/c/zlib.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/algorithm/comparison.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/algorithm/internal.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/algorithm/iteration.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/algorithm/mutation.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/algorithm/package.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/algorithm/searching.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/algorithm/setops.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/algorithm/sorting.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/array.lo std/ascii.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/base64.lo std/bigint.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/bitmanip.lo std/compiler.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/complex.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/concurrency.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/container/array.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/container/binaryheap.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/container/dlist.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/container/package.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/container/rbtree.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/container/slist.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/container/util.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/conv.lo std/csv.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/datetime/date.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/datetime/interval.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/datetime/package.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/datetime/stopwatch.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/datetime/systime.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/datetime/timezone.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/demangle.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/digest/crc.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/digest/digest.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/digest/hmac.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/digest/md.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/digest/murmurhash.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/digest/package.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/digest/ripemd.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/digest/sha.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/encoding.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/exception.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/affix_allocator.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/allocator_list.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/bitmapped_block.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/bucketizer.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/fallback_allocator.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/free_list.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/free_tree.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/kernighan_ritchie.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/null_allocator.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/package.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/quantizer.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/region.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/scoped_allocator.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/segregator.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/stats_collector.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/common.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/gc_allocator.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/mallocator.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/mmap_allocator.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/package.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/showcase.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/typed.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/checkedint.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/logger/core.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/logger/filelogger.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/logger/multilogger.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/logger/nulllogger.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/logger/package.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/typecons.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/file.lo std/format.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/functional.lo std/getopt.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/cstring.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/math/biguintcore.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/math/biguintnoasm.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/math/errorfunction.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/math/gammafunction.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/scopebuffer.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/test/dummyrange.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/test/range.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/test/uda.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/unicode_comp.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/unicode_decomp.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/unicode_grapheme.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/unicode_norm.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/unicode_tables.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/windows/advapi32.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/json.lo std/math.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/mathspecial.lo std/meta.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/mmfile.lo std/net/curl.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/net/isemail.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/numeric.lo std/outbuffer.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/parallelism.lo std/path.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/process.lo std/random.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/range/interfaces.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/range/package.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/range/primitives.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/regex/internal/backtracking.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/regex/internal/generator.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/regex/internal/ir.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/regex/internal/kickstart.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/regex/internal/parser.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/regex/internal/tests.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/regex/internal/thompson.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/regex/package.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/signals.lo std/socket.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/stdint.lo std/stdio.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/string.lo std/system.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/traits.lo std/typecons.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/typetuple.lo std/uni.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/uri.lo std/utf.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/uuid.lo std/variant.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/windows/charset.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/windows/registry.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/windows/syserror.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/xml.lo std/zip.lo \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/zlib.lo
 am__objects_2 = $(am__objects_1)
 am__objects_3 = $(am__objects_2)
 am_libgphobos_la_OBJECTS = $(am__objects_3)
@@ -461,74 +506,75 @@  libgphobos_la_LINK = $(LIBTOOL) --tag=D $(libgphobos_la_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(GDC) $(AM_CFLAGS) $(CFLAGS) \
 	$(libgphobos_la_LDFLAGS) $(LDFLAGS) -o $@
 
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@PHOBOS_DSOURCES = etc/c/curl.d etc/c/sqlite3.d etc/c/zlib.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/algorithm/comparison.d std/algorithm/internal.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/algorithm/iteration.d std/algorithm/mutation.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/algorithm/package.d std/algorithm/searching.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/algorithm/setops.d std/algorithm/sorting.d std/array.d std/ascii.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/base64.d std/bigint.d std/bitmanip.d std/compiler.d std/complex.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/concurrency.d std/container/array.d std/container/binaryheap.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/container/dlist.d std/container/package.d std/container/rbtree.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/container/slist.d std/container/util.d std/conv.d std/csv.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/datetime/date.d std/datetime/interval.d std/datetime/package.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/datetime/stopwatch.d std/datetime/systime.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/datetime/timezone.d std/demangle.d std/digest/crc.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/digest/digest.d std/digest/hmac.d std/digest/md.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/digest/murmurhash.d std/digest/package.d std/digest/ripemd.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/digest/sha.d std/encoding.d std/exception.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/affix_allocator.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/allocator_list.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/bitmapped_block.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/bucketizer.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/fallback_allocator.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/free_list.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/free_tree.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/kernighan_ritchie.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/null_allocator.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/package.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/quantizer.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/region.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/scoped_allocator.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/segregator.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/building_blocks/stats_collector.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/common.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/gc_allocator.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/mallocator.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/mmap_allocator.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/package.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/showcase.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/allocator/typed.d std/experimental/checkedint.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/logger/core.d std/experimental/logger/filelogger.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/logger/multilogger.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/logger/nulllogger.d std/experimental/logger/package.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/experimental/typecons.d std/file.d std/format.d std/functional.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/getopt.d std/internal/cstring.d std/internal/math/biguintcore.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/math/biguintnoasm.d std/internal/math/errorfunction.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/math/gammafunction.d std/internal/scopebuffer.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/test/dummyrange.d std/internal/test/range.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/test/uda.d std/internal/unicode_comp.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/unicode_decomp.d std/internal/unicode_grapheme.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/unicode_norm.d std/internal/unicode_tables.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/internal/windows/advapi32.d std/json.d std/math.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/mathspecial.d std/meta.d std/mmfile.d std/net/curl.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/net/isemail.d std/numeric.d std/outbuffer.d std/parallelism.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/path.d std/process.d std/random.d std/range/interfaces.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/range/package.d std/range/primitives.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/regex/internal/backtracking.d std/regex/internal/generator.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/regex/internal/ir.d std/regex/internal/kickstart.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/regex/internal/parser.d std/regex/internal/tests.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/regex/internal/thompson.d std/regex/package.d std/signals.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/socket.d std/stdint.d std/stdio.d std/string.d std/system.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/traits.d std/typecons.d std/typetuple.d std/uni.d std/uri.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/utf.d std/uuid.d std/variant.d std/windows/charset.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/windows/registry.d std/windows/syserror.d std/xml.d std/zip.d \
+@ENABLE_LIBDRUNTIME_ONLY_FALSE@	std/zlib.d
+
 
 # Source file definitions. Boring stuff, auto-generated with
 # https://gist.github.com/jpf91/8744acebc9dcf1e9d1a35cdff20afbb2
 # Can't use wildcards here:
 # https://www.gnu.org/software/automake/manual/html_node/Wildcards.html
-PHOBOS_DSOURCES = etc/c/curl.d etc/c/sqlite3.d etc/c/zlib.d \
-	std/algorithm/comparison.d std/algorithm/internal.d \
-	std/algorithm/iteration.d std/algorithm/mutation.d \
-	std/algorithm/package.d std/algorithm/searching.d \
-	std/algorithm/setops.d std/algorithm/sorting.d std/array.d std/ascii.d \
-	std/base64.d std/bigint.d std/bitmanip.d std/compiler.d std/complex.d \
-	std/concurrency.d std/container/array.d std/container/binaryheap.d \
-	std/container/dlist.d std/container/package.d std/container/rbtree.d \
-	std/container/slist.d std/container/util.d std/conv.d std/csv.d \
-	std/datetime/date.d std/datetime/interval.d std/datetime/package.d \
-	std/datetime/stopwatch.d std/datetime/systime.d \
-	std/datetime/timezone.d std/demangle.d std/digest/crc.d \
-	std/digest/digest.d std/digest/hmac.d std/digest/md.d \
-	std/digest/murmurhash.d std/digest/package.d std/digest/ripemd.d \
-	std/digest/sha.d std/encoding.d std/exception.d \
-	std/experimental/allocator/building_blocks/affix_allocator.d \
-	std/experimental/allocator/building_blocks/allocator_list.d \
-	std/experimental/allocator/building_blocks/bitmapped_block.d \
-	std/experimental/allocator/building_blocks/bucketizer.d \
-	std/experimental/allocator/building_blocks/fallback_allocator.d \
-	std/experimental/allocator/building_blocks/free_list.d \
-	std/experimental/allocator/building_blocks/free_tree.d \
-	std/experimental/allocator/building_blocks/kernighan_ritchie.d \
-	std/experimental/allocator/building_blocks/null_allocator.d \
-	std/experimental/allocator/building_blocks/package.d \
-	std/experimental/allocator/building_blocks/quantizer.d \
-	std/experimental/allocator/building_blocks/region.d \
-	std/experimental/allocator/building_blocks/scoped_allocator.d \
-	std/experimental/allocator/building_blocks/segregator.d \
-	std/experimental/allocator/building_blocks/stats_collector.d \
-	std/experimental/allocator/common.d \
-	std/experimental/allocator/gc_allocator.d \
-	std/experimental/allocator/mallocator.d \
-	std/experimental/allocator/mmap_allocator.d \
-	std/experimental/allocator/package.d \
-	std/experimental/allocator/showcase.d \
-	std/experimental/allocator/typed.d std/experimental/checkedint.d \
-	std/experimental/logger/core.d std/experimental/logger/filelogger.d \
-	std/experimental/logger/multilogger.d \
-	std/experimental/logger/nulllogger.d std/experimental/logger/package.d \
-	std/experimental/typecons.d std/file.d std/format.d std/functional.d \
-	std/getopt.d std/internal/cstring.d std/internal/math/biguintcore.d \
-	std/internal/math/biguintnoasm.d std/internal/math/errorfunction.d \
-	std/internal/math/gammafunction.d std/internal/scopebuffer.d \
-	std/internal/test/dummyrange.d std/internal/test/range.d \
-	std/internal/test/uda.d std/internal/unicode_comp.d \
-	std/internal/unicode_decomp.d std/internal/unicode_grapheme.d \
-	std/internal/unicode_norm.d std/internal/unicode_tables.d \
-	std/internal/windows/advapi32.d std/json.d std/math.d \
-	std/mathspecial.d std/meta.d std/mmfile.d std/net/curl.d \
-	std/net/isemail.d std/numeric.d std/outbuffer.d std/parallelism.d \
-	std/path.d std/process.d std/random.d std/range/interfaces.d \
-	std/range/package.d std/range/primitives.d \
-	std/regex/internal/backtracking.d std/regex/internal/generator.d \
-	std/regex/internal/ir.d std/regex/internal/kickstart.d \
-	std/regex/internal/parser.d std/regex/internal/tests.d \
-	std/regex/internal/thompson.d std/regex/package.d std/signals.d \
-	std/socket.d std/stdint.d std/stdio.d std/string.d std/system.d \
-	std/traits.d std/typecons.d std/typetuple.d std/uni.d std/uri.d \
-	std/utf.d std/uuid.d std/variant.d std/windows/charset.d \
-	std/windows/registry.d std/windows/syserror.d std/xml.d std/zip.d \
-	std/zlib.d
-
+@ENABLE_LIBDRUNTIME_ONLY_TRUE@PHOBOS_DSOURCES = 
 all: all-am
 
 .SUFFIXES:
diff --git a/libphobos/testsuite/testsuite_flags.in b/libphobos/testsuite/testsuite_flags.in
index c5dcac2054f..43e42810434 100755
--- a/libphobos/testsuite/testsuite_flags.in
+++ b/libphobos/testsuite/testsuite_flags.in
@@ -35,8 +35,11 @@  case ${query} in
       GDCPATHS_default="-nostdinc"
       GDCPATHS_config="-B${BUILD_DIR}/src
                        -I${BUILD_DIR}/libdruntime
-                       -I${SRC_DIR}/libdruntime
-                       -I${SRC_DIR}/src"
+                       -I${SRC_DIR}/libdruntime"
+      # Include phobos in search path if compiling in library.
+      if [ "x@ENABLE_LIBDRUNTIME_ONLY_FALSE@" = "x" ]; then
+         GDCPATHS_config="${GDCPATHS_config} -I${SRC_DIR}/src"
+      fi
       echo ${GDCPATHS_default} ${GDCPATHS_config}
       ;;
     --gdcldflags)
diff --git a/gcc/testsuite/lib/gdc-utils.exp b/gcc/testsuite/lib/gdc-utils.exp
index 31a4cf0b5e2..87d1105a9db 100644
--- a/gcc/testsuite/lib/gdc-utils.exp
+++ b/gcc/testsuite/lib/gdc-utils.exp
@@ -208,6 +208,7 @@  proc gdc-convert-test { base test } {
 
     set extra_sources ""
     set extra_files ""
+    set needs_phobos 0
 
     upvar 1 compilable_do_what compilable_do_what
     set compilable_output_file_ext ""
@@ -296,6 +297,11 @@  proc gdc-convert-test { base test } {
 	    }
 	    regsub -- {COMPILED_IMPORTS.*$} $copy_line "" out_line
 
+	} elseif [regexp -- {RUNNABLE_PHOBOS_TEST} $copy_line match sources] {
+	    # RUNNABLE_PHOBOS_TEST annotates tests that import the std module.
+	    # It will need skipping if phobos is not available on the target.
+	    regsub -- {RUNNABLE_PHOBOS_TEST.*$} $copy_line "" out_line
+	    set needs_phobos 1
 	}
 
 	puts $fdout $out_line
@@ -331,6 +337,9 @@  proc gdc-convert-test { base test } {
 	    if ![isnative] {
 		puts $fdout "// { dg-final { output-exists } }"
 	    }
+	    if $needs_phobos {
+		puts $fdout "// { dg-skip-if \"imports phobos\" { ! d_runtime_has_std_library } }"
+	    }
 	}
 
 	compilable {
diff --git a/gcc/testsuite/gdc.test/runnable/builtin.d b/gcc/testsuite/gdc.test/runnable/builtin.d
index 205e792879d..d7ac356757f 100644
--- a/gcc/testsuite/gdc.test/runnable/builtin.d
+++ b/gcc/testsuite/gdc.test/runnable/builtin.d
@@ -116,3 +116,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/complex.d b/gcc/testsuite/gdc.test/runnable/complex.d
index e9c79cb7d21..49bb3097aef 100644
--- a/gcc/testsuite/gdc.test/runnable/complex.d
+++ b/gcc/testsuite/gdc.test/runnable/complex.d
@@ -460,3 +460,4 @@  int main(char[][] args)
     return 0;
 }
 
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/constfold.d b/gcc/testsuite/gdc.test/runnable/constfold.d
index 0708056bc66..d56f6c1357c 100644
--- a/gcc/testsuite/gdc.test/runnable/constfold.d
+++ b/gcc/testsuite/gdc.test/runnable/constfold.d
@@ -672,3 +672,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/foreach4.d b/gcc/testsuite/gdc.test/runnable/foreach4.d
index 32ac4663f1e..bf8eab45b0e 100644
--- a/gcc/testsuite/gdc.test/runnable/foreach4.d
+++ b/gcc/testsuite/gdc.test/runnable/foreach4.d
@@ -928,3 +928,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/ifti.d b/gcc/testsuite/gdc.test/runnable/ifti.d
index 9ea97a258ed..0e4edef8983 100644
--- a/gcc/testsuite/gdc.test/runnable/ifti.d
+++ b/gcc/testsuite/gdc.test/runnable/ifti.d
@@ -118,3 +118,4 @@  void main() {
     }
 
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/implicit.d b/gcc/testsuite/gdc.test/runnable/implicit.d
index bc3f626f4d4..89e6ac11b9f 100644
--- a/gcc/testsuite/gdc.test/runnable/implicit.d
+++ b/gcc/testsuite/gdc.test/runnable/implicit.d
@@ -479,3 +479,4 @@  void main()
 
     writefln("Success");
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/inner.d b/gcc/testsuite/gdc.test/runnable/inner.d
index 592aaca2415..40eb27d5799 100644
--- a/gcc/testsuite/gdc.test/runnable/inner.d
+++ b/gcc/testsuite/gdc.test/runnable/inner.d
@@ -916,3 +916,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/interpret.d b/gcc/testsuite/gdc.test/runnable/interpret.d
index 1dc902322df..eee3930d34b 100644
--- a/gcc/testsuite/gdc.test/runnable/interpret.d
+++ b/gcc/testsuite/gdc.test/runnable/interpret.d
@@ -3609,3 +3609,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/issue8671.d b/gcc/testsuite/gdc.test/runnable/issue8671.d
index f9fa013e918..8097e79d6bf 100644
--- a/gcc/testsuite/gdc.test/runnable/issue8671.d
+++ b/gcc/testsuite/gdc.test/runnable/issue8671.d
@@ -3,3 +3,4 @@  void main()
 {
     double t = 1.0 - uniform(0.0, 1.0);
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/lazy.d b/gcc/testsuite/gdc.test/runnable/lazy.d
index 2fea5466dd8..741877cb970 100644
--- a/gcc/testsuite/gdc.test/runnable/lazy.d
+++ b/gcc/testsuite/gdc.test/runnable/lazy.d
@@ -308,3 +308,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/mars1.d b/gcc/testsuite/gdc.test/runnable/mars1.d
index 91d93dbf81e..b240745a513 100644
--- a/gcc/testsuite/gdc.test/runnable/mars1.d
+++ b/gcc/testsuite/gdc.test/runnable/mars1.d
@@ -1723,3 +1723,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/mixin1.d b/gcc/testsuite/gdc.test/runnable/mixin1.d
index 5332ebbfecb..c16d943d20f 100644
--- a/gcc/testsuite/gdc.test/runnable/mixin1.d
+++ b/gcc/testsuite/gdc.test/runnable/mixin1.d
@@ -1468,3 +1468,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/mixin2.d b/gcc/testsuite/gdc.test/runnable/mixin2.d
index 245e71ccc99..53a64d5f40e 100644
--- a/gcc/testsuite/gdc.test/runnable/mixin2.d
+++ b/gcc/testsuite/gdc.test/runnable/mixin2.d
@@ -361,3 +361,4 @@  void main()
 
     writeln("Success");
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/s2ir.d b/gcc/testsuite/gdc.test/runnable/s2ir.d
index ca832d262d0..4c969b4b16f 100644
--- a/gcc/testsuite/gdc.test/runnable/s2ir.d
+++ b/gcc/testsuite/gdc.test/runnable/s2ir.d
@@ -95,3 +95,4 @@  int main()
     writefln("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/stress.d b/gcc/testsuite/gdc.test/runnable/stress.d
index 2c7afe096c2..1b7f6457cf0 100644
--- a/gcc/testsuite/gdc.test/runnable/stress.d
+++ b/gcc/testsuite/gdc.test/runnable/stress.d
@@ -725,3 +725,4 @@  void CLASS()
         }
     }
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/template4.d b/gcc/testsuite/gdc.test/runnable/template4.d
index ab082d9f5d7..84792dae6ae 100644
--- a/gcc/testsuite/gdc.test/runnable/template4.d
+++ b/gcc/testsuite/gdc.test/runnable/template4.d
@@ -1164,3 +1164,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/template9.d b/gcc/testsuite/gdc.test/runnable/template9.d
index 0f1309fe581..0b11c6b4fa3 100644
--- a/gcc/testsuite/gdc.test/runnable/template9.d
+++ b/gcc/testsuite/gdc.test/runnable/template9.d
@@ -4965,3 +4965,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/test10942.d b/gcc/testsuite/gdc.test/runnable/test10942.d
index f85b4c9b9c8..612158fc294 100644
--- a/gcc/testsuite/gdc.test/runnable/test10942.d
+++ b/gcc/testsuite/gdc.test/runnable/test10942.d
@@ -24,3 +24,4 @@  mixin(getEnum(1087));
 
 void main() { }
 
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/test11.d b/gcc/testsuite/gdc.test/runnable/test11.d
index 5b21ba0fa51..e62ea97940a 100644
--- a/gcc/testsuite/gdc.test/runnable/test11.d
+++ b/gcc/testsuite/gdc.test/runnable/test11.d
@@ -1390,3 +1390,4 @@  int main(string[] argv)
 }
 
 
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/test12.d b/gcc/testsuite/gdc.test/runnable/test12.d
index 2b1fb0e62f7..c196361a401 100644
--- a/gcc/testsuite/gdc.test/runnable/test12.d
+++ b/gcc/testsuite/gdc.test/runnable/test12.d
@@ -1250,3 +1250,4 @@  int main(string[] argv)
     return 0;
 }
 
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/test12197.d b/gcc/testsuite/gdc.test/runnable/test12197.d
index 51dc36c83c8..52d44c94a2e 100644
--- a/gcc/testsuite/gdc.test/runnable/test12197.d
+++ b/gcc/testsuite/gdc.test/runnable/test12197.d
@@ -10,3 +10,4 @@  void main()
     foo(a);
     assert(a[0] == 10000);
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/test15.d b/gcc/testsuite/gdc.test/runnable/test15.d
index d8bb3ae613e..75cd11ee8e7 100644
--- a/gcc/testsuite/gdc.test/runnable/test15.d
+++ b/gcc/testsuite/gdc.test/runnable/test15.d
@@ -1439,3 +1439,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/test22.d b/gcc/testsuite/gdc.test/runnable/test22.d
index e2d26e706b6..d15db1d86a9 100644
--- a/gcc/testsuite/gdc.test/runnable/test22.d
+++ b/gcc/testsuite/gdc.test/runnable/test22.d
@@ -1306,3 +1306,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/test23.d b/gcc/testsuite/gdc.test/runnable/test23.d
index f43f6a46091..dda2864fb48 100644
--- a/gcc/testsuite/gdc.test/runnable/test23.d
+++ b/gcc/testsuite/gdc.test/runnable/test23.d
@@ -1566,3 +1566,4 @@  void main()
 
     printf("Success\n");
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/test24.d b/gcc/testsuite/gdc.test/runnable/test24.d
index 78e9150ea87..cc6d6686d7a 100644
--- a/gcc/testsuite/gdc.test/runnable/test24.d
+++ b/gcc/testsuite/gdc.test/runnable/test24.d
@@ -8,3 +8,4 @@  void main()
 {
     string hi = std.string.format("%s", 3);
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/test27.d b/gcc/testsuite/gdc.test/runnable/test27.d
index b45c132620e..3e5a462e4a5 100644
--- a/gcc/testsuite/gdc.test/runnable/test27.d
+++ b/gcc/testsuite/gdc.test/runnable/test27.d
@@ -11,3 +11,4 @@  int main()
     return 0;
 }
 
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/test28.d b/gcc/testsuite/gdc.test/runnable/test28.d
index c7ec6ad3228..1f7e7e89cf0 100644
--- a/gcc/testsuite/gdc.test/runnable/test28.d
+++ b/gcc/testsuite/gdc.test/runnable/test28.d
@@ -1318,3 +1318,4 @@  void main()
     printf("Success\n");
 }
 
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/test34.d b/gcc/testsuite/gdc.test/runnable/test34.d
index 5c28d0f8252..e92f3d6e340 100644
--- a/gcc/testsuite/gdc.test/runnable/test34.d
+++ b/gcc/testsuite/gdc.test/runnable/test34.d
@@ -1292,3 +1292,4 @@  void main()
 }
 
 
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/test37.d b/gcc/testsuite/gdc.test/runnable/test37.d
index 97448d1d2ca..c28d30f2ae9 100644
--- a/gcc/testsuite/gdc.test/runnable/test37.d
+++ b/gcc/testsuite/gdc.test/runnable/test37.d
@@ -11,3 +11,4 @@  void main()
     // imports in a subdirectory of the -J path
     writefln(import("std14198/uni.d"));
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/test42.d b/gcc/testsuite/gdc.test/runnable/test42.d
index 6e0c42b6ff5..2bb04580a7d 100644
--- a/gcc/testsuite/gdc.test/runnable/test42.d
+++ b/gcc/testsuite/gdc.test/runnable/test42.d
@@ -6438,3 +6438,4 @@  int main()
     return 0;
 }
 
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/test5305.d b/gcc/testsuite/gdc.test/runnable/test5305.d
index e1c274d31ca..9102cba91f2 100644
--- a/gcc/testsuite/gdc.test/runnable/test5305.d
+++ b/gcc/testsuite/gdc.test/runnable/test5305.d
@@ -5,3 +5,4 @@  void map(real function(real) f) { }
 int main() { map(&sqrt); return 0; }
 
 
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/test60.d b/gcc/testsuite/gdc.test/runnable/test60.d
index e55f05c1e66..ab967329f08 100644
--- a/gcc/testsuite/gdc.test/runnable/test60.d
+++ b/gcc/testsuite/gdc.test/runnable/test60.d
@@ -20,3 +20,4 @@  void main()
 
     writeln("Success");
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/testaa.d b/gcc/testsuite/gdc.test/runnable/testaa.d
index d069e79e820..6e28e894cf2 100644
--- a/gcc/testsuite/gdc.test/runnable/testaa.d
+++ b/gcc/testsuite/gdc.test/runnable/testaa.d
@@ -1383,3 +1383,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/testbitarray.d b/gcc/testsuite/gdc.test/runnable/testbitarray.d
index 02044603e88..118388bebd1 100644
--- a/gcc/testsuite/gdc.test/runnable/testbitarray.d
+++ b/gcc/testsuite/gdc.test/runnable/testbitarray.d
@@ -14,3 +14,4 @@  void main() {
 }
 
 
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/testdstress.d b/gcc/testsuite/gdc.test/runnable/testdstress.d
index ee36d345b1d..097fc310d34 100644
--- a/gcc/testsuite/gdc.test/runnable/testdstress.d
+++ b/gcc/testsuite/gdc.test/runnable/testdstress.d
@@ -930,3 +930,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/testfile.d b/gcc/testsuite/gdc.test/runnable/testfile.d
index 70059008616..e7c3e19a49d 100644
--- a/gcc/testsuite/gdc.test/runnable/testfile.d
+++ b/gcc/testsuite/gdc.test/runnable/testfile.d
@@ -22,3 +22,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/testformat.d b/gcc/testsuite/gdc.test/runnable/testformat.d
index e209b855b59..2cb0da9fc4d 100644
--- a/gcc/testsuite/gdc.test/runnable/testformat.d
+++ b/gcc/testsuite/gdc.test/runnable/testformat.d
@@ -123,3 +123,4 @@  int main()
     std.stdio.writefln("Success");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/testline.d b/gcc/testsuite/gdc.test/runnable/testline.d
index 22117bd385c..5001fc2fa68 100644
--- a/gcc/testsuite/gdc.test/runnable/testline.d
+++ b/gcc/testsuite/gdc.test/runnable/testline.d
@@ -41,3 +41,4 @@  void checkFileSpec(Object o){
 writeln(str);
         assert(str[start .. start+3]=="(1)");
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/testmmfile.d b/gcc/testsuite/gdc.test/runnable/testmmfile.d
index f0b3340905a..1ae98df9178 100644
--- a/gcc/testsuite/gdc.test/runnable/testmmfile.d
+++ b/gcc/testsuite/gdc.test/runnable/testmmfile.d
@@ -117,3 +117,4 @@  int main()
 
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/testscope2.d b/gcc/testsuite/gdc.test/runnable/testscope2.d
index ae4e3d7249c..cde02ab405f 100644
--- a/gcc/testsuite/gdc.test/runnable/testscope2.d
+++ b/gcc/testsuite/gdc.test/runnable/testscope2.d
@@ -246,3 +246,4 @@  void main()
     printf("Success\n");
 }
 
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/testsignals.d b/gcc/testsuite/gdc.test/runnable/testsignals.d
index 619be73d2f8..a43f89295e8 100644
--- a/gcc/testsuite/gdc.test/runnable/testsignals.d
+++ b/gcc/testsuite/gdc.test/runnable/testsignals.d
@@ -111,3 +111,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/testsocket.d b/gcc/testsuite/gdc.test/runnable/testsocket.d
index 3d153d61b0e..00b757a896b 100644
--- a/gcc/testsuite/gdc.test/runnable/testsocket.d
+++ b/gcc/testsuite/gdc.test/runnable/testsocket.d
@@ -48,3 +48,4 @@  int main ()
 }
 
 
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/teststdio.d b/gcc/testsuite/gdc.test/runnable/teststdio.d
index b5cc44480dc..854dcb5ae38 100644
--- a/gcc/testsuite/gdc.test/runnable/teststdio.d
+++ b/gcc/testsuite/gdc.test/runnable/teststdio.d
@@ -31,3 +31,4 @@  void main()
     } while (!feof(fp));
     //fclose(fp);
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/testthread2.d b/gcc/testsuite/gdc.test/runnable/testthread2.d
index 008d4253a5a..0ec6e0dbcdc 100644
--- a/gcc/testsuite/gdc.test/runnable/testthread2.d
+++ b/gcc/testsuite/gdc.test/runnable/testthread2.d
@@ -106,3 +106,4 @@  void main() {
     }
 }
 
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/testtypeid.d b/gcc/testsuite/gdc.test/runnable/testtypeid.d
index 936dfaae778..dcaac731fa3 100644
--- a/gcc/testsuite/gdc.test/runnable/testtypeid.d
+++ b/gcc/testsuite/gdc.test/runnable/testtypeid.d
@@ -684,3 +684,4 @@  int main()
 
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/traits.d b/gcc/testsuite/gdc.test/runnable/traits.d
index b73ee01ce42..915f16da48e 100644
--- a/gcc/testsuite/gdc.test/runnable/traits.d
+++ b/gcc/testsuite/gdc.test/runnable/traits.d
@@ -1606,3 +1606,4 @@  int main()
     writeln("Success");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/wc.d b/gcc/testsuite/gdc.test/runnable/wc.d
index 7ee35861a40..e5fd98a0f83 100644
--- a/gcc/testsuite/gdc.test/runnable/wc.d
+++ b/gcc/testsuite/gdc.test/runnable/wc.d
@@ -48,3 +48,4 @@  int main (string[] args)
     }
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/wc2.d b/gcc/testsuite/gdc.test/runnable/wc2.d
index 6229627843f..780f5f160ea 100644
--- a/gcc/testsuite/gdc.test/runnable/wc2.d
+++ b/gcc/testsuite/gdc.test/runnable/wc2.d
@@ -72,3 +72,4 @@  int main (string[] args)
     }
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/wc3.d b/gcc/testsuite/gdc.test/runnable/wc3.d
index 3cb4e25c235..666bfb99113 100644
--- a/gcc/testsuite/gdc.test/runnable/wc3.d
+++ b/gcc/testsuite/gdc.test/runnable/wc3.d
@@ -70,3 +70,4 @@  int main (string[] args)
     }
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/xtest46.d b/gcc/testsuite/gdc.test/runnable/xtest46.d
index b3caffda133..e1cdbcd1922 100644
--- a/gcc/testsuite/gdc.test/runnable/xtest46.d
+++ b/gcc/testsuite/gdc.test/runnable/xtest46.d
@@ -8283,3 +8283,4 @@  int main()
     printf("Success\n");
     return 0;
 }
+// RUNNABLE_PHOBOS_TEST
diff --git a/gcc/testsuite/gdc.test/runnable/xtest55.d b/gcc/testsuite/gdc.test/runnable/xtest55.d
index 3d41b997808..1062a1a77fc 100644
--- a/gcc/testsuite/gdc.test/runnable/xtest55.d
+++ b/gcc/testsuite/gdc.test/runnable/xtest55.d
@@ -22,3 +22,4 @@  int main()
     return 0;
 }
 
+// RUNNABLE_PHOBOS_TEST