  
    for (i = 1; i < *decoded_options_count; i++)
      {
-@@ -302,6 +309,12 @@ darwin_driver_init (unsigned int *decoded_options_count,
+@@ -302,6 +303,12 @@ darwin_driver_init (unsigned int *decoded_options_count,
  	    seenPPC = true;
  	  else if (!strcmp ((*decoded_options)[i].arg, "ppc64"))
  	    seenPPC64 = true;

 : "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 23bee7010a3..7aa91971f45 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2559,6 +2559,8 @@ AC_PROG_LIBTOOL
 AC_SUBST(objdir)
 AC_SUBST(enable_fast_install)
 
+AM_CONDITIONAL([ENABLE_DARWIN_AT_RPATH], [test x$enable_darwin_at_rpath = xyes])
+
 # Identify the assembler which will work hand-in-glove with the newly
 # built GCC, so that we can examine its features.  This is the assembler
 # which will be driven by the driver program.
@@ -7646,6 +7648,19 @@ if test x$enable_default_pie = xyes ; then
 fi
 AC_SUBST([enable_default_pie])
 

+    # We cannot build and test reliably on macOS 10.11+ (Darwin15+) without use
+    # of rpaths, since runpaths set via DYLD_LIBRARY_PATH are elided by key
+    # system executables (e.g. /bin/sh).  Force rpaths on for these systems.
+      UNSET,darwin1[56789]*|UNSET,darwin2*|10.1[123456789][,.]*|1[123456789].*[,.]* )
+      echo "@rpath library names are needed on macOS versions later than 10.11 (rpaths enabled)" 1>&5
+      enable_darwin_at_rpath=yes
+      ;;
