changeset 1667:1f345217c9ba jdk9-b85

Merge
author lana
date Tue, 06 Oct 2015 08:41:18 -0700
parents 862c8645ab01 941f3d1bad00
children 156eb4ef93f1 44f5634e9189 11c070dc7985
files
diffstat 17 files changed, 526 insertions(+), 499 deletions(-) [+]
line wrap: on
line diff
--- a/common/autoconf/compare.sh.in	Mon Oct 05 20:24:57 2015 -0700
+++ b/common/autoconf/compare.sh.in	Tue Oct 06 08:41:18 2015 -0700
@@ -62,7 +62,7 @@
 export SED="@SED@"
 export SORT="@SORT@"
 export STAT="@STAT@"
-export STRIP="@POST_STRIP_CMD@"
+export STRIP="@STRIP@ @STRIPFLAGS@"
 export TEE="@TEE@"
 export UNIQ="@UNIQ@"
 export UNPACK200="@FIXPATH@ @BOOT_JDK@/bin/unpack200"
--- a/common/autoconf/configure.ac	Mon Oct 05 20:24:57 2015 -0700
+++ b/common/autoconf/configure.ac	Tue Oct 06 08:41:18 2015 -0700
@@ -165,6 +165,11 @@
 # First determine the toolchain type (compiler family)
 TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE
 
+# User supplied flags should be used when configure detects compilers
+FLAGS_SETUP_USER_SUPPLIED_FLAGS
+# The sysroot cflags are needed for configure to be able to run the compilers
+FLAGS_SETUP_SYSROOT_FLAGS
+
 # Then detect the actual binaries needed
 TOOLCHAIN_PRE_DETECTION
 TOOLCHAIN_DETECT_TOOLCHAIN_CORE
--- a/common/autoconf/flags.m4	Mon Oct 05 20:24:57 2015 -0700
+++ b/common/autoconf/flags.m4	Tue Oct 06 08:41:18 2015 -0700
@@ -23,6 +23,100 @@
 # questions.
 #
 
+# Reset the global CFLAGS/LDFLAGS variables and initialize them with the
+# corresponding configure arguments instead
+AC_DEFUN_ONCE([FLAGS_SETUP_USER_SUPPLIED_FLAGS],
+[
+  if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
+    AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
+  fi
+
+  if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
+    AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags])
+  fi
+
+  if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
+    AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags])
+  fi
+
+  AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
+      [extra flags to be used when compiling jdk c-files])])
+
+  AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags],
+      [extra flags to be used when compiling jdk c++-files])])
+
+  AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags],
+      [extra flags to be used when linking jdk])])
+
+  EXTRA_CFLAGS="$with_extra_cflags"
+  EXTRA_CXXFLAGS="$with_extra_cxxflags"
+  EXTRA_LDFLAGS="$with_extra_ldflags"
+
+  # Hotspot needs these set in their legacy form
+  LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $EXTRA_CFLAGS"
+  LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $EXTRA_CXXFLAGS"
+  LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $EXTRA_LDFLAGS"
+
+  AC_SUBST(LEGACY_EXTRA_CFLAGS)
+  AC_SUBST(LEGACY_EXTRA_CXXFLAGS)
+  AC_SUBST(LEGACY_EXTRA_LDFLAGS)
+
+  # The global CFLAGS and LDLAGS variables are used by configure tests and
+  # should include the extra parameters
+  CFLAGS="$EXTRA_CFLAGS"
+  CXXFLAGS="$EXTRA_CXXFLAGS"
+  LDFLAGS="$EXTRA_LDFLAGS"
+  CPPFLAGS=""
+])
+
+# Setup the sysroot flags and add them to global CFLAGS and LDFLAGS so
+# that configure can use them while detecting compilers.
+# TOOLCHAIN_TYPE is available here.
+AC_DEFUN_ONCE([FLAGS_SETUP_SYSROOT_FLAGS],
+[
+  if test "x$SYSROOT" != "x"; then
+    if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
+      if test "x$OPENJDK_TARGET_OS" = xsolaris; then
+        # Solaris Studio does not have a concept of sysroot. Instead we must
+        # make sure the default include and lib dirs are appended to each
+        # compile and link command line.
+        SYSROOT_CFLAGS="-I$SYSROOT/usr/include"
+        SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
+            -L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
+            -L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
+      fi
+    elif test "x$TOOLCHAIN_TYPE" = xgcc; then
+      SYSROOT_CFLAGS="--sysroot=$SYSROOT"
+      SYSROOT_LDFLAGS="--sysroot=$SYSROOT"
+    elif test "x$TOOLCHAIN_TYPE" = xclang; then
+      SYSROOT_CFLAGS="-isysroot $SYSROOT"
+      SYSROOT_LDFLAGS="-isysroot $SYSROOT"
+    fi
+    # Propagate the sysroot args to hotspot
+    LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $SYSROOT_CFLAGS"
+    LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS"
+    LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS"
+    # The global CFLAGS and LDFLAGS variables need these for configure to function
+    CFLAGS="$CFLAGS $SYSROOT_CFLAGS"
+    CPPFLAGS="$CPPFLAGS $SYSROOT_CFLAGS"
+    CXXFLAGS="$CXXFLAGS $SYSROOT_CFLAGS"
+    LDFLAGS="$LDFLAGS $SYSROOT_LDFLAGS"
+  fi
+
+  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+    # We also need -iframework<path>/System/Library/Frameworks
+    SYSROOT_CFLAGS="$SYSROOT_CFLAGS -iframework $SYSROOT/System/Library/Frameworks"
+    SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -iframework $SYSROOT/System/Library/Frameworks"
+    # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
+    # set this here so it doesn't have to be peppered throughout the forest
+    SYSROOT_CFLAGS="$SYSROOT_CFLAGS -F $SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
+    SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -F $SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
+  fi
+
+  AC_SUBST(SYSROOT_CFLAGS)
+  AC_SUBST(SYSROOT_LDFLAGS)
+])
+
 AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
 [
   # Option used to tell the compiler whether to create 32- or 64-bit executables
@@ -60,10 +154,7 @@
     STRIPFLAGS="-X32_64"
   fi
 
-  if test "x$OPENJDK_TARGET_OS" != xwindows; then
-    POST_STRIP_CMD="$STRIP $STRIPFLAGS"
-  fi
-  AC_SUBST(POST_STRIP_CMD)
+  AC_SUBST(STRIPFLAGS)
 
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     CC_OUT_OPTION=-Fo
@@ -113,44 +204,6 @@
     # silence copyright notice and other headers.
     COMMON_CCXXFLAGS="$COMMON_CCXXFLAGS -nologo"
   fi
-
-  if test "x$SYSROOT" != "x"; then
-    if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-      if test "x$OPENJDK_TARGET_OS" = xsolaris; then
-        # Solaris Studio does not have a concept of sysroot. Instead we must
-        # make sure the default include and lib dirs are appended to each
-        # compile and link command line.
-        SYSROOT_CFLAGS="-I$SYSROOT/usr/include"
-        SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
-            -L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
-            -L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
-      fi
-    elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
-      # Apple only wants -isysroot <path>, but we also need -iframework<path>/System/Library/Frameworks
-      SYSROOT_CFLAGS="-isysroot \"$SYSROOT\" -iframework\"$SYSROOT/System/Library/Frameworks\""
-      SYSROOT_LDFLAGS=$SYSROOT_CFLAGS
-    elif test "x$TOOLCHAIN_TYPE" = xgcc; then
-      SYSROOT_CFLAGS="--sysroot=$SYSROOT"
-      SYSROOT_LDFLAGS="--sysroot=$SYSROOT"
-    elif test "x$TOOLCHAIN_TYPE" = xclang; then
-      SYSROOT_CFLAGS="-isysroot \"$SYSROOT\""
-      SYSROOT_LDFLAGS="-isysroot \"$SYSROOT\""
-    fi
-    # Propagate the sysroot args to hotspot
-    LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $SYSROOT_CFLAGS"
-    LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS"
-    LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS"
-  fi
-
-  # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
-  # set this here so it doesn't have to be peppered throughout the forest
-  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
-    SYSROOT_CFLAGS="$SYSROOT_CFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\""
-    SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\""
-  fi
-
-  AC_SUBST(SYSROOT_CFLAGS)
-  AC_SUBST(SYSROOT_LDFLAGS)
 ])
 
 AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS],
@@ -480,39 +533,9 @@
     CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
   fi
 
-  if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
-    AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
-  fi
-
-  if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
-    AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags])
-  fi
-
-  if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
-    AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags])
-  fi
-
-  AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
-      [extra flags to be used when compiling jdk c-files])])
-
-  AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags],
-      [extra flags to be used when compiling jdk c++-files])])
-
-  AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags],
-      [extra flags to be used when linking jdk])])
-
-  CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags"
-  CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags"
-  LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags"
-
-  # Hotspot needs these set in their legacy form
-  LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $with_extra_cflags"
-  LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $with_extra_cxxflags"
-  LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $with_extra_ldflags"
-
-  AC_SUBST(LEGACY_EXTRA_CFLAGS)
-  AC_SUBST(LEGACY_EXTRA_CXXFLAGS)
-  AC_SUBST(LEGACY_EXTRA_LDFLAGS)
+  CFLAGS_JDK="${CFLAGS_JDK} $EXTRA_CFLAGS"
+  CXXFLAGS_JDK="${CXXFLAGS_JDK} $EXTRA_CXXFLAGS"
+  LDFLAGS_JDK="${LDFLAGS_JDK} $EXTRA_LDFLAGS"
 
   ###############################################################################
   #
--- a/common/autoconf/generated-configure.sh	Mon Oct 05 20:24:57 2015 -0700
+++ b/common/autoconf/generated-configure.sh	Tue Oct 06 08:41:18 2015 -0700
@@ -705,9 +705,6 @@
 CFLAGS_JDKEXE
 CFLAGS_JDKLIB
 MACOSX_VERSION_MIN
-LEGACY_EXTRA_LDFLAGS
-LEGACY_EXTRA_CXXFLAGS
-LEGACY_EXTRA_CFLAGS
 CXX_O_FLAG_NONE
 CXX_O_FLAG_DEBUG
 CXX_O_FLAG_NORM
@@ -728,14 +725,12 @@
 SET_EXECUTABLE_ORIGIN
 CXX_FLAG_REORDER
 C_FLAG_REORDER
-SYSROOT_LDFLAGS
-SYSROOT_CFLAGS
 RC_FLAGS
 AR_OUT_OPTION
 LD_OUT_OPTION
 EXE_OUT_OPTION
 CC_OUT_OPTION
-POST_STRIP_CMD
+STRIPFLAGS
 ARFLAGS
 COMPILER_TARGET_BITS_FLAG
 JT_HOME
@@ -747,6 +742,8 @@
 HOTSPOT_CXX
 HOTSPOT_RC
 HOTSPOT_MT
+BUILD_SYSROOT_LDFLAGS
+BUILD_SYSROOT_CFLAGS
 BUILD_LD
 BUILD_CXX
 BUILD_CC
@@ -793,6 +790,11 @@
 VS_INCLUDE
 VS_PATH
 CYGWIN_LINK
+SYSROOT_LDFLAGS
+SYSROOT_CFLAGS
+LEGACY_EXTRA_LDFLAGS
+LEGACY_EXTRA_CXXFLAGS
+LEGACY_EXTRA_CFLAGS
 EXE_SUFFIX
 OBJ_SUFFIX
 STATIC_LIBRARY
@@ -1078,11 +1080,11 @@
 with_override_jdk
 with_import_hotspot
 with_toolchain_type
-with_toolchain_version
-with_jtreg
 with_extra_cflags
 with_extra_cxxflags
 with_extra_ldflags
+with_toolchain_version
+with_jtreg
 enable_warnings_as_errors
 enable_debug_symbols
 enable_zip_debug_info
@@ -1937,14 +1939,14 @@
                           source
   --with-toolchain-type   the toolchain type (or family) to use, use '--help'
                           to show possible values [platform dependent]
+  --with-extra-cflags     extra flags to be used when compiling jdk c-files
+  --with-extra-cxxflags   extra flags to be used when compiling jdk c++-files
+  --with-extra-ldflags    extra flags to be used when linking jdk
   --with-toolchain-version
                           the version of the toolchain to look for, use
                           '--help' to show possible values [platform
                           dependent]
   --with-jtreg            Regression Test Harness [probed]
-  --with-extra-cflags     extra flags to be used when compiling jdk c-files
-  --with-extra-cxxflags   extra flags to be used when compiling jdk c++-files
-  --with-extra-ldflags    extra flags to be used when linking jdk
   --with-x                use the X Window System
   --with-cups             specify prefix directory for the cups package
                           (expecting the headers under PATH/include)
@@ -3767,6 +3769,15 @@
 # questions.
 #
 
+# Reset the global CFLAGS/LDFLAGS variables and initialize them with the
+# corresponding configure arguments instead
+
+
+# Setup the sysroot flags and add them to global CFLAGS and LDFLAGS so
+# that configure can use them while detecting compilers.
+# TOOLCHAIN_TYPE is available here.
+
+
 
 
 
@@ -3886,6 +3897,8 @@
 
 apt_help() {
   case $1 in
+    reduced)
+      PKGHANDLER_COMMAND="sudo apt-get install gcc-multilib g++-multilib" ;;
     devkit)
       PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
     openjdk)
@@ -4362,7 +4375,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1442820958
+DATE_WHEN_GENERATED=1444077934
 
 ###############################################################################
 #
@@ -26825,6 +26838,109 @@
   fi
 
 
+# User supplied flags should be used when configure detects compilers
+
+  if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&5
+$as_echo "$as_me: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&2;}
+  fi
+
+  if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags" >&5
+$as_echo "$as_me: WARNING: Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags" >&2;}
+  fi
+
+  if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags" >&5
+$as_echo "$as_me: WARNING: Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags" >&2;}
+  fi
+
+
+# Check whether --with-extra-cflags was given.
+if test "${with_extra_cflags+set}" = set; then :
+  withval=$with_extra_cflags;
+fi
+
+
+
+# Check whether --with-extra-cxxflags was given.
+if test "${with_extra_cxxflags+set}" = set; then :
+  withval=$with_extra_cxxflags;
+fi
+
+
+
+# Check whether --with-extra-ldflags was given.
+if test "${with_extra_ldflags+set}" = set; then :
+  withval=$with_extra_ldflags;
+fi
+
+
+  EXTRA_CFLAGS="$with_extra_cflags"
+  EXTRA_CXXFLAGS="$with_extra_cxxflags"
+  EXTRA_LDFLAGS="$with_extra_ldflags"
+
+  # Hotspot needs these set in their legacy form
+  LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $EXTRA_CFLAGS"
+  LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $EXTRA_CXXFLAGS"
+  LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $EXTRA_LDFLAGS"
+
+
+
+
+
+  # The global CFLAGS and LDLAGS variables are used by configure tests and
+  # should include the extra parameters
+  CFLAGS="$EXTRA_CFLAGS"
+  CXXFLAGS="$EXTRA_CXXFLAGS"
+  LDFLAGS="$EXTRA_LDFLAGS"
+  CPPFLAGS=""
+
+# The sysroot cflags are needed for configure to be able to run the compilers
+
+  if test "x$SYSROOT" != "x"; then
+    if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
+      if test "x$OPENJDK_TARGET_OS" = xsolaris; then
+        # Solaris Studio does not have a concept of sysroot. Instead we must
+        # make sure the default include and lib dirs are appended to each
+        # compile and link command line.
+        SYSROOT_CFLAGS="-I$SYSROOT/usr/include"
+        SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
+            -L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
+            -L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
+      fi
+    elif test "x$TOOLCHAIN_TYPE" = xgcc; then
+      SYSROOT_CFLAGS="--sysroot=$SYSROOT"
+      SYSROOT_LDFLAGS="--sysroot=$SYSROOT"
+    elif test "x$TOOLCHAIN_TYPE" = xclang; then
+      SYSROOT_CFLAGS="-isysroot $SYSROOT"
+      SYSROOT_LDFLAGS="-isysroot $SYSROOT"
+    fi
+    # Propagate the sysroot args to hotspot
+    LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $SYSROOT_CFLAGS"
+    LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS"
+    LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS"
+    # The global CFLAGS and LDFLAGS variables need these for configure to function
+    CFLAGS="$CFLAGS $SYSROOT_CFLAGS"
+    CPPFLAGS="$CPPFLAGS $SYSROOT_CFLAGS"
+    CXXFLAGS="$CXXFLAGS $SYSROOT_CFLAGS"
+    LDFLAGS="$LDFLAGS $SYSROOT_LDFLAGS"
+  fi
+
+  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+    # We also need -iframework<path>/System/Library/Frameworks
+    SYSROOT_CFLAGS="$SYSROOT_CFLAGS -iframework $SYSROOT/System/Library/Frameworks"
+    SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -iframework $SYSROOT/System/Library/Frameworks"
+    # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
+    # set this here so it doesn't have to be peppered throughout the forest
+    SYSROOT_CFLAGS="$SYSROOT_CFLAGS -F $SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
+    SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -F $SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
+  fi
+
+
+
+
+
 # Then detect the actual binaries needed
 
   # FIXME: Is this needed?
@@ -40555,13 +40671,19 @@
     fi
   fi
 
+    BUILD_SYSROOT_CFLAGS=""
+    BUILD_SYSROOT_LDFLAGS=""
   else
     # If we are not cross compiling, use the normal target compilers for
     # building the build platform executables.
     BUILD_CC="$CC"
     BUILD_CXX="$CXX"
     BUILD_LD="$LD"
-  fi
+    BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS"
+    BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS"
+  fi
+
+
 
 
 
@@ -41252,9 +41374,6 @@
     STRIPFLAGS="-X32_64"
   fi
 
-  if test "x$OPENJDK_TARGET_OS" != xwindows; then
-    POST_STRIP_CMD="$STRIP $STRIPFLAGS"
-  fi
 
 
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
@@ -41306,44 +41425,6 @@
     COMMON_CCXXFLAGS="$COMMON_CCXXFLAGS -nologo"
   fi
 
-  if test "x$SYSROOT" != "x"; then
-    if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-      if test "x$OPENJDK_TARGET_OS" = xsolaris; then
-        # Solaris Studio does not have a concept of sysroot. Instead we must
-        # make sure the default include and lib dirs are appended to each
-        # compile and link command line.
-        SYSROOT_CFLAGS="-I$SYSROOT/usr/include"
-        SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
-            -L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
-            -L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
-      fi
-    elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
-      # Apple only wants -isysroot <path>, but we also need -iframework<path>/System/Library/Frameworks
-      SYSROOT_CFLAGS="-isysroot \"$SYSROOT\" -iframework\"$SYSROOT/System/Library/Frameworks\""
-      SYSROOT_LDFLAGS=$SYSROOT_CFLAGS
-    elif test "x$TOOLCHAIN_TYPE" = xgcc; then
-      SYSROOT_CFLAGS="--sysroot=$SYSROOT"
-      SYSROOT_LDFLAGS="--sysroot=$SYSROOT"
-    elif test "x$TOOLCHAIN_TYPE" = xclang; then
-      SYSROOT_CFLAGS="-isysroot \"$SYSROOT\""
-      SYSROOT_LDFLAGS="-isysroot \"$SYSROOT\""
-    fi
-    # Propagate the sysroot args to hotspot
-    LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $SYSROOT_CFLAGS"
-    LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS"
-    LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS"
-  fi
-
-  # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
-  # set this here so it doesn't have to be peppered throughout the forest
-  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
-    SYSROOT_CFLAGS="$SYSROOT_CFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\""
-    SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\""
-  fi
-
-
-
-
 
 # FIXME: Currently we must test this after toolchain but before flags. Fix!
 
@@ -41543,8 +41624,38 @@
     { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to compile stdio.h. This likely implies missing compile dependencies." >&5
 $as_echo "$as_me: Failed to compile stdio.h. This likely implies missing compile dependencies." >&6;}
     if test "x$COMPILE_TYPE" = xreduced; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a reduced build. Check that you have 32-bit libraries installed." >&5
-$as_echo "$as_me: You are doing a reduced build. Check that you have 32-bit libraries installed." >&6;}
+
+  # Print a helpful message on how to acquire the necessary build dependency.
+  # reduced is the help tag: freetype, cups, pulse, alsa etc
+  MISSING_DEPENDENCY=reduced
+
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    cygwin_help $MISSING_DEPENDENCY
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    msys_help $MISSING_DEPENDENCY
+  else
+    PKGHANDLER_COMMAND=
+
+    case $PKGHANDLER in
+      apt-get)
+        apt_help     $MISSING_DEPENDENCY ;;
+      yum)
+        yum_help     $MISSING_DEPENDENCY ;;
+      port)
+        port_help    $MISSING_DEPENDENCY ;;
+      pkgutil)
+        pkgutil_help $MISSING_DEPENDENCY ;;
+      pkgadd)
+        pkgadd_help  $MISSING_DEPENDENCY ;;
+    esac
+
+    if test "x$PKGHANDLER_COMMAND" != x; then
+      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
+    fi
+  fi
+
+      { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG" >&5
+$as_echo "$as_me: You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG" >&6;}
     elif test "x$COMPILE_TYPE" = xcross; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&5
 $as_echo "$as_me: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&6;}
@@ -41603,8 +41714,8 @@
       # Let's try to implicitely set the compilers target architecture and retry the test
       { $as_echo "$as_me:${as_lineno-$LINENO}: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)." >&5
 $as_echo "$as_me: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: I'll retry after setting the platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" >&5
-$as_echo "$as_me: I'll retry after setting the platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" >&6;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Retrying with platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" >&5
+$as_echo "$as_me: Retrying with platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" >&6;}
 
   # When we add flags to the "official" CFLAGS etc, we need to
   # keep track of these additions in ADDED_CFLAGS etc. These
@@ -41667,7 +41778,46 @@
       TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p`
 
       if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then
-        as_fn_error $? "The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)" "$LINENO" 5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)" >&5
+$as_echo "$as_me: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)" >&6;}
+        if test "x$COMPILE_TYPE" = xreduced; then
+
+  # Print a helpful message on how to acquire the necessary build dependency.
+  # reduced is the help tag: freetype, cups, pulse, alsa etc
+  MISSING_DEPENDENCY=reduced
+
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    cygwin_help $MISSING_DEPENDENCY
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    msys_help $MISSING_DEPENDENCY
+  else
+    PKGHANDLER_COMMAND=
+
+    case $PKGHANDLER in
+      apt-get)
+        apt_help     $MISSING_DEPENDENCY ;;
+      yum)
+        yum_help     $MISSING_DEPENDENCY ;;
+      port)
+        port_help    $MISSING_DEPENDENCY ;;
+      pkgutil)
+        pkgutil_help $MISSING_DEPENDENCY ;;
+      pkgadd)
+        pkgadd_help  $MISSING_DEPENDENCY ;;
+    esac
+
+    if test "x$PKGHANDLER_COMMAND" != x; then
+      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
+    fi
+  fi
+
+          { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG" >&5
+$as_echo "$as_me: You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG" >&6;}
+        elif test "x$COMPILE_TYPE" = xcross; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&5
+$as_echo "$as_me: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&6;}
+        fi
+        as_fn_error $? "Cannot continue." "$LINENO" 5
       fi
     fi
   fi
@@ -42267,54 +42417,9 @@
     CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
   fi
 
-  if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&5
-$as_echo "$as_me: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&2;}
-  fi
-
-  if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags" >&5
-$as_echo "$as_me: WARNING: Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags" >&2;}
-  fi
-
-  if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags" >&5
-$as_echo "$as_me: WARNING: Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags" >&2;}
-  fi
-
-
-# Check whether --with-extra-cflags was given.
-if test "${with_extra_cflags+set}" = set; then :
-  withval=$with_extra_cflags;
-fi
-
-
-
-# Check whether --with-extra-cxxflags was given.
-if test "${with_extra_cxxflags+set}" = set; then :
-  withval=$with_extra_cxxflags;
-fi
-
-
-
-# Check whether --with-extra-ldflags was given.
-if test "${with_extra_ldflags+set}" = set; then :
-  withval=$with_extra_ldflags;
-fi
-
-
-  CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags"
-  CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags"
-  LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags"
-
-  # Hotspot needs these set in their legacy form
-  LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $with_extra_cflags"
-  LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $with_extra_cxxflags"
-  LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $with_extra_ldflags"
-
-
-
-
+  CFLAGS_JDK="${CFLAGS_JDK} $EXTRA_CFLAGS"
+  CXXFLAGS_JDK="${CXXFLAGS_JDK} $EXTRA_CXXFLAGS"
+  LDFLAGS_JDK="${LDFLAGS_JDK} $EXTRA_LDFLAGS"
 
   ###############################################################################
   #
--- a/common/autoconf/help.m4	Mon Oct 05 20:24:57 2015 -0700
+++ b/common/autoconf/help.m4	Tue Oct 06 08:41:18 2015 -0700
@@ -97,6 +97,8 @@
 
 apt_help() {
   case $1 in
+    reduced)
+      PKGHANDLER_COMMAND="sudo apt-get install gcc-multilib g++-multilib" ;;
     devkit)
       PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
     openjdk)
--- a/common/autoconf/hotspot-spec.gmk.in	Mon Oct 05 20:24:57 2015 -0700
+++ b/common/autoconf/hotspot-spec.gmk.in	Tue Oct 06 08:41:18 2015 -0700
@@ -48,8 +48,8 @@
 
 # The HOSTCC/HOSTCXX is Hotspot terminology for the BUILD_CC/BUILD_CXX, i.e. the
 # compiler that produces code that can be run on the build platform.
-HOSTCC:=@FIXPATH@ @BUILD_CC@
-HOSTCXX:=@FIXPATH@ @BUILD_CXX@
+HOSTCC:=@FIXPATH@ @BUILD_CC@ $(BUILD_SYSROOT_CFLAGS)
+HOSTCXX:=@FIXPATH@ @BUILD_CXX@ $(BUILD_SYSROOT_CFLAGS)
 
 ####################################################
 #
--- a/common/autoconf/platform.m4	Mon Oct 05 20:24:57 2015 -0700
+++ b/common/autoconf/platform.m4	Tue Oct 06 08:41:18 2015 -0700
@@ -489,7 +489,8 @@
   AC_CHECK_HEADERS([stdio.h], , [
     AC_MSG_NOTICE([Failed to compile stdio.h. This likely implies missing compile dependencies.])
     if test "x$COMPILE_TYPE" = xreduced; then
-      AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed.])
+      HELP_MSG_MISSING_DEPENDENCY([reduced])
+      AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG])
     elif test "x$COMPILE_TYPE" = xcross; then
       AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.])
     fi
@@ -509,7 +510,7 @@
       # This situation may happen on 64-bit platforms where the compiler by default only generates 32-bit objects
       # Let's try to implicitely set the compilers target architecture and retry the test
       AC_MSG_NOTICE([The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS).])
-      AC_MSG_NOTICE([I'll retry after setting the platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}])
+      AC_MSG_NOTICE([Retrying with platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}])
       PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS
 
       # We have to unset 'ac_cv_sizeof_int_p' first, otherwise AC_CHECK_SIZEOF will use the previously cached value!
@@ -524,7 +525,14 @@
       TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p`
 
       if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then
-        AC_MSG_ERROR([The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)])
+        AC_MSG_NOTICE([The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)])
+        if test "x$COMPILE_TYPE" = xreduced; then
+          HELP_MSG_MISSING_DEPENDENCY([reduced])
+          AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed. $HELP_MSG])
+        elif test "x$COMPILE_TYPE" = xcross; then
+          AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.])
+        fi
+        AC_MSG_ERROR([Cannot continue.])
       fi
     fi
   fi
--- a/common/autoconf/spec.gmk.in	Mon Oct 05 20:24:57 2015 -0700
+++ b/common/autoconf/spec.gmk.in	Tue Oct 06 08:41:18 2015 -0700
@@ -367,6 +367,8 @@
 # build platform.
 BUILD_CC:=@FIXPATH@ @BUILD_CC@
 BUILD_LD:=@FIXPATH@ @BUILD_LD@
+BUILD_SYSROOT_CFLAGS:=@BUILD_SYSROOT_CFLAGS@
+BUILD_SYSROOT_LDFLAGS:=@BUILD_SYSROOT_LDFLAGS@
 
 AS:=@FIXPATH@ @AS@
 
@@ -421,7 +423,7 @@
 EXE_SUFFIX:=@EXE_SUFFIX@
 OBJ_SUFFIX:=@OBJ_SUFFIX@
 
-POST_STRIP_CMD:=@POST_STRIP_CMD@
+STRIPFLAGS:=@STRIPFLAGS@
 
 JAVA_FLAGS:=@JAVA_FLAGS@
 JAVA_FLAGS_BIG:=@JAVA_FLAGS_BIG@
@@ -461,9 +463,6 @@
 NEW_JAVAC   = $(INTERIM_LANGTOOLS_ARGS) com.sun.tools.javac.Main
 NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) com.sun.tools.javadoc.Main
 
-# The interim corba jar is needed for running rmic
-INTERIM_CORBA_JAR = $(BUILDTOOLS_OUTPUTDIR)/interim_corba.jar
-
 # Base flags for RC
 # Guarding this against resetting value. Legacy make files include spec multiple
 # times.
--- a/common/autoconf/toolchain.m4	Mon Oct 05 20:24:57 2015 -0700
+++ b/common/autoconf/toolchain.m4	Tue Oct 06 08:41:18 2015 -0700
@@ -656,17 +656,23 @@
     BASIC_FIXUP_EXECUTABLE(BUILD_CXX)
     BASIC_PATH_PROGS(BUILD_LD, ld)
     BASIC_FIXUP_EXECUTABLE(BUILD_LD)
+    BUILD_SYSROOT_CFLAGS=""
+    BUILD_SYSROOT_LDFLAGS=""
   else
     # If we are not cross compiling, use the normal target compilers for
     # building the build platform executables.
     BUILD_CC="$CC"
     BUILD_CXX="$CXX"
     BUILD_LD="$LD"
+    BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS"
+    BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS"
   fi
 
   AC_SUBST(BUILD_CC)
   AC_SUBST(BUILD_CXX)
   AC_SUBST(BUILD_LD)
+  AC_SUBST(BUILD_SYSROOT_CFLAGS)
+  AC_SUBST(BUILD_SYSROOT_LDFLAGS)
 ])
 
 # Setup legacy variables that are still needed as alternative ways to refer to
--- a/make/Main.gmk	Mon Oct 05 20:24:57 2015 -0700
+++ b/make/Main.gmk	Tue Oct 06 08:41:18 2015 -0700
@@ -72,9 +72,6 @@
 interim-langtools:
 	+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
 
-interim-corba:
-	+($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
-
 interim-rmic:
 	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk)
 
@@ -84,7 +81,7 @@
 buildtools-jdk:
 	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk java-tools)
 
-ALL_TARGETS += buildtools-langtools interim-langtools interim-corba \
+ALL_TARGETS += buildtools-langtools interim-langtools \
     interim-rmic interim-cldrconverter buildtools-jdk
 
 ################################################################################
@@ -357,13 +354,11 @@
 
   $(JDK_GENSRC_TARGETS): interim-langtools buildtools-jdk
 
-  interim-corba: $(CORBA_GENSRC_TARGETS)
-
   $(GENDATA_TARGETS): interim-langtools buildtools-jdk
 
   interim-rmic: interim-langtools
 
-  $(RMIC_TARGETS): interim-langtools interim-corba interim-rmic
+  $(RMIC_TARGETS): interim-langtools interim-rmic
 
   $(JAVA_TARGETS): interim-langtools
 
@@ -463,7 +458,7 @@
 ################################################################################
 # Virtual targets without recipes
 
-buildtools: buildtools-langtools interim-langtools interim-corba interim-rmic \
+buildtools: buildtools-langtools interim-langtools interim-rmic \
     buildtools-jdk
 
 gensrc: $(GENSRC_TARGETS)
--- a/make/StripBinaries.gmk	Mon Oct 05 20:24:57 2015 -0700
+++ b/make/StripBinaries.gmk	Tue Oct 06 08:41:18 2015 -0700
@@ -38,13 +38,13 @@
 MODULES_CMDS_STRIPPED := $(SUPPORT_OUTPUTDIR)/modules_cmds-stripped
 MODULES_LIBS_STRIPPED := $(SUPPORT_OUTPUTDIR)/modules_libs-stripped
 
-ifneq ($(POST_STRIP_CMD), )
+ifneq ($(STRIP), )
   define StripRecipe
 	$(ECHO) Stripping $(LOG_INFO) $(patsubst $(OUTPUT_ROOT)/%,%,$<)
 	$(MKDIR) -p $(@D)
 	$(CP) $< $@.tmp
 	$(CHMOD) u+w $@.tmp
-	$(POST_STRIP_CMD) $@.tmp
+	$(STRIP) $(STRIPFLAGS) $@.tmp
 	$(CHMOD) go-w $@.tmp
 	$(MV) $@.tmp $@
   endef
--- a/make/common/JavaCompilation.gmk	Mon Oct 05 20:24:57 2015 -0700
+++ b/make/common/JavaCompilation.gmk	Tue Oct 06 08:41:18 2015 -0700
@@ -122,9 +122,9 @@
       $1_GREP_INCLUDES:=| ( $(GREP) $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_INCLUDE_PATTERNS)) \
           || test "$$$$?" = "1" )
     else
-      $1_GREP_INCLUDE_OUTPUT:=$(RM) $$($1_BIN)/_the.$$($1_JARNAME)_include $$(NEWLINE) \
-          $$(call ListPathsSafely,$1_GREP_INCLUDE_PATTERNS,\n, \
-          >> $$($1_BIN)/_the.$$($1_JARNAME)_include)
+      $1_GREP_INCLUDE_OUTPUT = \
+          $$(eval $$(call ListPathsSafely,$1_GREP_INCLUDE_PATTERNS, \
+              $$($1_BIN)/_the.$$($1_JARNAME)_include))
       $1_GREP_INCLUDES:=| ( $(GREP) -f $$($1_BIN)/_the.$$($1_JARNAME)_include \
           || test "$$$$?" = "1" )
     endif
@@ -138,9 +138,9 @@
       $1_GREP_EXCLUDES:=| ( $(GREP) -v $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_EXCLUDE_PATTERNS)) \
           || test "$$$$?" = "1" )
     else
-      $1_GREP_EXCLUDE_OUTPUT=$(RM) $$($1_BIN)/_the.$$($1_JARNAME)_exclude $$(NEWLINE) \
-          $$(call ListPathsSafely,$1_GREP_EXCLUDE_PATTERNS,\n, \
-          >> $$($1_BIN)/_the.$$($1_JARNAME)_exclude)
+      $1_GREP_EXCLUDE_OUTPUT = \
+          $$(eval $$(call ListPathsSafely,$1_GREP_EXCLUDE_PATTERNS, \
+              $$($1_BIN)/_the.$$($1_JARNAME)_exclude))
       $1_GREP_EXCLUDES:=| ( $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude \
           || test "$$$$?" = "1" )
     endif
@@ -190,13 +190,12 @@
   # The EXTRA_FILES_RESOLVED varible must be set in the macro so that it's evaluated
   # in the recipe when the files are guaranteed to exist.
   $1_CAPTURE_EXTRA_FILES=\
-      $(RM) $$($1_BIN)/_the.$$($1_JARNAME)_contents.extra $$(NEWLINE) \
-      $$(eval $1_EXTRA_FILES_RESOLVED:=$$(call DoubleDollar, $$(call DoubleDollar, \
+      $$(eval $1_EXTRA_FILES_RESOLVED:=$$(call DoubleDollar, \
           $$(wildcard $$(foreach src, $$($1_SRCS), \
-          $$(addprefix $$(src)/, $$($1_EXTRA_FILES))) $$($1_EXTRA_FILES))))) \
+          $$(addprefix $$(src)/, $$($1_EXTRA_FILES))) $$($1_EXTRA_FILES)))) \
       $$(if $$($1_EXTRA_FILES_RESOLVED), \
-        $$(call ListPathsSafely,$1_EXTRA_FILES_RESOLVED,\n, \
-            >> $$($1_BIN)/_the.$$($1_JARNAME)_contents.extra) $$(NEWLINE) \
+        $$(eval $$(call ListPathsSafely,$1_EXTRA_FILES_RESOLVED, \
+            $$($1_BIN)/_the.$$($1_JARNAME)_contents.extra)) \
         $(SED) $$(foreach src,$$($1_SRCS), -e 's|$$(src)/|-C $$(src) |g') \
             $$($1_BIN)/_the.$$($1_JARNAME)_contents.extra \
             >> $$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE))
@@ -577,7 +576,7 @@
 
     $$($1_BIN)/_the.$1_batch: $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE)
 	$(MKDIR) -p $$(@D) $$(dir $$($1_SJAVAC_PORTFILE))
-	$$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.$1_batch.tmp)
+	$$(eval $$(call ListPathsSafely,$1_SRCS, $$($1_BIN)/_the.$1_batch.tmp))
 	$(ECHO) Compiling $1
 	$(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch.log, $$($1_SAFE_NAME), \
 	    $$($1_JVM) $$($1_SJAVAC) \
@@ -636,8 +635,7 @@
     # When not using sjavac, pass along all sources to javac using an @file.
     $$($1_BIN)/_the.$1_batch: $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE)
 	$(MKDIR) -p $$(@D)
-	$(RM) $$($1_BIN)/_the.$1_batch $$($1_BIN)/_the.$1_batch.tmp
-	$$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.$1_batch.tmp)
+	$$(eval $$(call ListPathsSafely,$1_SRCS, $$($1_BIN)/_the.$1_batch.tmp))
 	$(ECHO) Compiling `$(WC) $$($1_BIN)/_the.$1_batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1
 	$(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch.log, $$($1_SAFE_NAME), \
 	    $$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) \
--- a/make/common/MakeBase.gmk	Mon Oct 05 20:24:57 2015 -0700
+++ b/make/common/MakeBase.gmk	Tue Oct 06 08:41:18 2015 -0700
@@ -64,6 +64,11 @@
 
 endef
 
+# In GNU Make 4.0 and higher, there is a file function for writing to files.
+ifeq (4.0, $(firstword $(sort 4.0 $(MAKE_VERSION))))
+  HAS_FILE_FUNCTION := true
+endif
+
 ##############################
 # Functions
 ##############################
@@ -122,266 +127,111 @@
 DoubleDollar = $(subst $$,$$$$,$(strip $1))
 
 ################################################################################
+# ListPathsSafely can be used to print command parameters to a file. This is
+# typically done if the command line lenght risk being too long for the
+# OS/shell. In later make versions, the file function can be used for this
+# purpose. For earlier versions, a more complex implementation is provided.
+#
+# The function ListPathsSafely can be called either directly or, more commonly
+# from a recipe line. If called from a recipe, it will be executed in the
+# evaluation phase of that recipe, which means that it will write to the file
+# before any other line in the recipe has been run.
+ifeq ($(HAS_FILE_FUNCTION), true)
+  # Param 1 - Name of variable containing paths/arguments to output
+  # Param 2 - File to print to
+  # Param 3 - Set to true to append to file instead of overwriting
+  define ListPathsSafely
+    $$(call MakeDir, $$(dir $$(strip $2)))
+    $$(file $$(if $$(filter true, $$(strip $3)),>>,>) \
+        $$(strip $2),$$(subst $$(SPACE),$$(NEWLINE),$$(strip $$($$(strip $1)))))
+  endef
 
-# If the variable that you want to send to stdout for piping into a file or otherwise,
-# is potentially long, for example the a list of file paths, eg a list of all package directories.
-# Then you need to use ListPathsSafely, which optimistically splits the output into several shell
-# calls as well as use compression on recurrent file paths segments, to get around the potential
-# command line length problem that exists in cygwin and other shells.
-compress_pre:=$(strip $(shell $(CAT) $(SRC_ROOT)/make/common/support/ListPathsSafely-pre-compress.incl))
-compress_post:=$(strip $(shell $(CAT) $(SRC_ROOT)/make/common/support/ListPathsSafely-post-compress.incl))
-compress_paths=$(compress_pre)\
+else # HAS_FILE_FUNCTION
+
+  $(eval compress_paths = \
+      $(strip $(shell $(CAT) $(SRC_ROOT)/make/common/support/ListPathsSafely-pre-compress.incl)))
+  compress_paths += \
 $(subst $(SRC_ROOT),X97,\
 $(subst $(OUTPUT_ROOT),X98,\
 $(subst X,X00,\
-$(subst $(SPACE),\n,$(strip $1)))))\
-$(compress_post)
+      $(subst $(SPACE),\n,$(strip $1)))))
+  $(eval compress_paths += \
+      $(strip $(shell $(CAT) $(SRC_ROOT)/make/common/support/ListPathsSafely-post-compress.incl)))
 
-decompress_paths=$(SED) -f $(SRC_ROOT)/make/common/support/ListPathsSafely-uncompress.sed -e 's|X99|\\n|g' \
+  decompress_paths=$(SED) -f $(SRC_ROOT)/make/common/support/ListPathsSafely-uncompress.sed \
+      -e 's|X99|\\n|g' \
     -e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(SRC_ROOT)|g' \
-    -e 's|X00|X|g' | tr '\n' '$2'
+      -e 's|X00|X|g'
 
-define ListPathsSafely_If
-	$(if $(word $3,$($1)),$(eval $1_LPS$3:=$(call compress_paths,$(wordlist $3,$4,$($1)))))
-endef
+  ListPathsSafely_IfPrintf = \
+      $(if $(word $3,$($(strip $1))), \
+          $(shell $(PRINTF) -- "$(strip $(call EscapeDollar, \
+              $(call compress_paths, $(wordlist $3,$4,$($(strip $1))))))\n" \
+              | $(decompress_paths) >> $2))
 
-define ListPathsSafely_Printf
-	$(if $(strip $($1_LPS$4)),$(if $(findstring $(LOG_LEVEL),trace),,@)printf \
-	    -- "$(strip $(call EscapeDollar, $($1_LPS$4)))\n" | $(decompress_paths) $3)
-endef
-
-# Receipt example:
-#   rm -f thepaths
-#   $(call ListPathsSafely,THEPATHS,\n, >> thepaths)
-# The \n argument means translate spaces into \n
-# if instead , , (a space) is supplied, then spaces remain spaces.
+  # Param 1 - Name of variable containing paths/arguments to output
+  # Param 2 - File to print to
+  # Param 3 - Set to true to append to file instead of overwriting
 define ListPathsSafely
-	$(if $(word 16001,$($1)),$(error Cannot list safely more than 16000 paths. $1 has $(words $($1)) paths!))
-	$(ECHO) $(LOG_DEBUG) Writing $(words $($1)) paths to '$3'
-	$(call ListPathsSafely_If,$1,$2,1,250)
-	$(call ListPathsSafely_If,$1,$2,251,500)
-	$(call ListPathsSafely_If,$1,$2,501,750)
-	$(call ListPathsSafely_If,$1,$2,751,1000)
-
-	$(call ListPathsSafely_If,$1,$2,1001,1250)
-	$(call ListPathsSafely_If,$1,$2,1251,1500)
-	$(call ListPathsSafely_If,$1,$2,1501,1750)
-	$(call ListPathsSafely_If,$1,$2,1751,2000)
-
-	$(call ListPathsSafely_If,$1,$2,2001,2250)
-	$(call ListPathsSafely_If,$1,$2,2251,2500)
-	$(call ListPathsSafely_If,$1,$2,2501,2750)
-	$(call ListPathsSafely_If,$1,$2,2751,3000)
-
-	$(call ListPathsSafely_If,$1,$2,3001,3250)
-	$(call ListPathsSafely_If,$1,$2,3251,3500)
-	$(call ListPathsSafely_If,$1,$2,3501,3750)
-	$(call ListPathsSafely_If,$1,$2,3751,4000)
-
-	$(call ListPathsSafely_If,$1,$2,4001,4250)
-	$(call ListPathsSafely_If,$1,$2,4251,4500)
-	$(call ListPathsSafely_If,$1,$2,4501,4750)
-	$(call ListPathsSafely_If,$1,$2,4751,5000)
-
-	$(call ListPathsSafely_If,$1,$2,5001,5250)
-	$(call ListPathsSafely_If,$1,$2,5251,5500)
-	$(call ListPathsSafely_If,$1,$2,5501,5750)
-	$(call ListPathsSafely_If,$1,$2,5751,6000)
-
-	$(call ListPathsSafely_If,$1,$2,6001,6250)
-	$(call ListPathsSafely_If,$1,$2,6251,6500)
-	$(call ListPathsSafely_If,$1,$2,6501,6750)
-	$(call ListPathsSafely_If,$1,$2,6751,7000)
-
-	$(call ListPathsSafely_If,$1,$2,7001,7250)
-	$(call ListPathsSafely_If,$1,$2,7251,7500)
-	$(call ListPathsSafely_If,$1,$2,7501,7750)
-	$(call ListPathsSafely_If,$1,$2,7751,8000)
-
-	$(call ListPathsSafely_If,$1,$2,8001,8250)
-	$(call ListPathsSafely_If,$1,$2,8251,8500)
-	$(call ListPathsSafely_If,$1,$2,8501,8750)
-	$(call ListPathsSafely_If,$1,$2,8751,9000)
-
-	$(call ListPathsSafely_If,$1,$2,9001,9250)
-	$(call ListPathsSafely_If,$1,$2,9251,9500)
-	$(call ListPathsSafely_If,$1,$2,9501,9750)
-	$(call ListPathsSafely_If,$1,$2,9751,10000)
-
-	$(call ListPathsSafely_If,$1,$2,10001,10250)
-	$(call ListPathsSafely_If,$1,$2,10251,10500)
-	$(call ListPathsSafely_If,$1,$2,10501,10750)
-	$(call ListPathsSafely_If,$1,$2,10751,11000)
-
-	$(call ListPathsSafely_If,$1,$2,11001,11250)
-	$(call ListPathsSafely_If,$1,$2,11251,11500)
-	$(call ListPathsSafely_If,$1,$2,11501,11750)
-	$(call ListPathsSafely_If,$1,$2,11751,12000)
-
-	$(call ListPathsSafely_If,$1,$2,12001,12250)
-	$(call ListPathsSafely_If,$1,$2,12251,12500)
-	$(call ListPathsSafely_If,$1,$2,12501,12750)
-	$(call ListPathsSafely_If,$1,$2,12751,13000)
-
-	$(call ListPathsSafely_If,$1,$2,13001,13250)
-	$(call ListPathsSafely_If,$1,$2,13251,13500)
-	$(call ListPathsSafely_If,$1,$2,13501,13750)
-	$(call ListPathsSafely_If,$1,$2,13751,14000)
-
-	$(call ListPathsSafely_If,$1,$2,14001,14250)
-	$(call ListPathsSafely_If,$1,$2,14251,14500)
-	$(call ListPathsSafely_If,$1,$2,14501,14750)
-	$(call ListPathsSafely_If,$1,$2,14751,15000)
-
-	$(call ListPathsSafely_If,$1,$2,15001,15250)
-	$(call ListPathsSafely_If,$1,$2,15251,15500)
-	$(call ListPathsSafely_If,$1,$2,15501,15750)
-	$(call ListPathsSafely_If,$1,$2,15751,16000)
-
-	$(call ListPathsSafely_Printf,$1,$2,$3,1)
-	$(call ListPathsSafely_Printf,$1,$2,$3,251)
-	$(call ListPathsSafely_Printf,$1,$2,$3,501)
-	$(call ListPathsSafely_Printf,$1,$2,$3,751)
-
-	$(call ListPathsSafely_Printf,$1,$2,$3,1001)
-	$(call ListPathsSafely_Printf,$1,$2,$3,1251)
-	$(call ListPathsSafely_Printf,$1,$2,$3,1501)
-	$(call ListPathsSafely_Printf,$1,$2,$3,1751)
-
-	$(call ListPathsSafely_Printf,$1,$2,$3,2001)
-	$(call ListPathsSafely_Printf,$1,$2,$3,2251)
-	$(call ListPathsSafely_Printf,$1,$2,$3,2501)
-	$(call ListPathsSafely_Printf,$1,$2,$3,2751)
-
-	$(call ListPathsSafely_Printf,$1,$2,$3,3001)
-	$(call ListPathsSafely_Printf,$1,$2,$3,3251)
-	$(call ListPathsSafely_Printf,$1,$2,$3,3501)
-	$(call ListPathsSafely_Printf,$1,$2,$3,3751)
-
-	$(call ListPathsSafely_Printf,$1,$2,$3,4001)
-	$(call ListPathsSafely_Printf,$1,$2,$3,4251)
-	$(call ListPathsSafely_Printf,$1,$2,$3,4501)
-	$(call ListPathsSafely_Printf,$1,$2,$3,4751)
-
-	$(call ListPathsSafely_Printf,$1,$2,$3,5001)
-	$(call ListPathsSafely_Printf,$1,$2,$3,5251)
-	$(call ListPathsSafely_Printf,$1,$2,$3,5501)
-	$(call ListPathsSafely_Printf,$1,$2,$3,5751)
-
-	$(call ListPathsSafely_Printf,$1,$2,$3,6001)
-	$(call ListPathsSafely_Printf,$1,$2,$3,6251)
-	$(call ListPathsSafely_Printf,$1,$2,$3,6501)
-	$(call ListPathsSafely_Printf,$1,$2,$3,6751)
-
-	$(call ListPathsSafely_Printf,$1,$2,$3,7001)
-	$(call ListPathsSafely_Printf,$1,$2,$3,7251)
-	$(call ListPathsSafely_Printf,$1,$2,$3,7501)
-	$(call ListPathsSafely_Printf,$1,$2,$3,7751)
-
-	$(call ListPathsSafely_Printf,$1,$2,$3,8001)
-	$(call ListPathsSafely_Printf,$1,$2,$3,8251)
-	$(call ListPathsSafely_Printf,$1,$2,$3,8501)
-	$(call ListPathsSafely_Printf,$1,$2,$3,8751)
-
-	$(call ListPathsSafely_Printf,$1,$2,$3,9001)
-	$(call ListPathsSafely_Printf,$1,$2,$3,9251)
-	$(call ListPathsSafely_Printf,$1,$2,$3,9501)
-	$(call ListPathsSafely_Printf,$1,$2,$3,9751)
-
-	$(call ListPathsSafely_Printf,$1,$2,$3,10001)
-	$(call ListPathsSafely_Printf,$1,$2,$3,10251)
-	$(call ListPathsSafely_Printf,$1,$2,$3,10501)
-	$(call ListPathsSafely_Printf,$1,$2,$3,10751)
-
-	$(call ListPathsSafely_Printf,$1,$2,$3,11001)
-	$(call ListPathsSafely_Printf,$1,$2,$3,11251)
-	$(call ListPathsSafely_Printf,$1,$2,$3,11501)
-	$(call ListPathsSafely_Printf,$1,$2,$3,11751)
-
-	$(call ListPathsSafely_Printf,$1,$2,$3,12001)
-	$(call ListPathsSafely_Printf,$1,$2,$3,12251)
-	$(call ListPathsSafely_Printf,$1,$2,$3,12501)
-	$(call ListPathsSafely_Printf,$1,$2,$3,12751)
-
-	$(call ListPathsSafely_Printf,$1,$2,$3,13001)
-	$(call ListPathsSafely_Printf,$1,$2,$3,13251)
-	$(call ListPathsSafely_Printf,$1,$2,$3,13501)
-	$(call ListPathsSafely_Printf,$1,$2,$3,13751)
-
-	$(call ListPathsSafely_Printf,$1,$2,$3,14001)
-	$(call ListPathsSafely_Printf,$1,$2,$3,14251)
-	$(call ListPathsSafely_Printf,$1,$2,$3,14501)
-	$(call ListPathsSafely_Printf,$1,$2,$3,14751)
-
-	$(call ListPathsSafely_Printf,$1,$2,$3,15001)
-	$(call ListPathsSafely_Printf,$1,$2,$3,15251)
-	$(call ListPathsSafely_Printf,$1,$2,$3,15501)
-	$(call ListPathsSafely_Printf,$1,$2,$3,15751)
-endef
-
-define ListPathsSafelyNow_IfPrintf
-  ifneq (,$$(word $4,$$($1)))
-    $$(eval $1_LPS$4:=$$(call compress_paths,$$(wordlist $4,$5,$$($1))))
-    $$(shell printf -- "$$(strip $$($1_LPS$4))\n" | $(decompress_paths) $3)
-  endif
-endef
-
-# And an non-receipt version:
-define ListPathsSafelyNow
   ifneq (,$$(word 10001,$$($1)))
     $$(error Cannot list safely more than 10000 paths. $1 has $$(words $$($1)) paths!)
   endif
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1,250)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,251,500)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,501,750)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,751,1000)
+    $$(call MakeDir, $$(dir $2))
+    ifneq ($$(strip $3), true)
+      $$(shell $(RM) $$(strip $2))
+    endif
 
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1001,1250)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1251,1500)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1501,1750)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1751,2000)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,1,250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,251,500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,501,750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,751,1000)
 
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2001,2250)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2251,2500)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2501,2750)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2751,3000)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,1001,1250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,1251,1500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,1501,1750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,1751,2000)
 
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3001,3250)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3251,3500)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3501,3750)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3751,4000)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,2001,2250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,2251,2500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,2501,2750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,2751,3000)
 
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4001,4250)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4251,4500)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4501,4750)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4751,5000)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,3001,3250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,3251,3500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,3501,3750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,3751,4000)
 
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5001,5250)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5251,5500)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5501,5750)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5751,6000)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,4001,4250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,4251,4500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,4501,4750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,4751,5000)
 
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6001,6250)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6251,6500)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6501,6750)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6751,7000)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,5001,5250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,5251,5500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,5501,5750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,5751,6000)
 
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7001,7250)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7251,7500)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7501,7750)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7751,8000)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,6001,6250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,6251,6500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,6501,6750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,6751,7000)
 
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8001,8250)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8251,8500)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8501,8750)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8751,9000)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,7001,7250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,7251,7500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,7501,7750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,7751,8000)
 
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9001,9250)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9251,9500)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9501,9750)
-  $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9751,10000)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,8001,8250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,8251,8500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,8501,8750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,8751,9000)
 
+    $$(call ListPathsSafely_IfPrintf,$1,$2,9001,9250)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,9251,9500)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,9501,9750)
+    $$(call ListPathsSafely_IfPrintf,$1,$2,9751,10000)
 endef
+endif # HAS_FILE_FUNCTION
 
 # The source tips can come from the Mercurial repository, or in the files
 # $(HGTIP_FILENAME) which contains the tip but is also positioned in the same
@@ -674,6 +524,10 @@
   $3 += $2
 endef
 
+# Returns the value of the first argument
+identity = \
+    $(strip $1)
+
 # Setup make rules for copying files, with an option to do more complex
 # processing instead of copying.
 #
@@ -688,6 +542,8 @@
 #   FLATTEN : Set to flatten the directory structure in the DEST dir.
 #   MACRO   : Optionally override the default macro used for making the copy.
 #             Default is 'install-file'
+#   NAME_MACRO : Optionally supply a macro that rewrites the target file name
+#                based on the source file name
 SetupCopyFiles = $(NamedParamsMacroTemplate)
 define SetupCopyFilesBody
 
@@ -700,12 +556,17 @@
     $1_SRC := $$(dir $$(firstword $$($1_FILES)))
   endif
 
+  ifeq ($$($1_NAME_MACRO), )
+    $1_NAME_MACRO := identity
+  endif
+
   # Remove any trailing slash from SRC
   $1_SRC := $$(patsubst %/,%,$$($1_SRC))
 
   $$(foreach f, $$(patsubst $$($1_SRC)/%,%,$$($1_FILES)), \
       $$(eval $$(call AddFileToCopy, $$($1_SRC)/$$f, \
-      $$($1_DEST)/$$(if $$($1_FLATTEN),$$(notdir $$f),$$f), $1, $$($1_MACRO))))
+      $$($1_DEST)/$$(call $$(strip $$($1_NAME_MACRO)),$$(if $$($1_FLATTEN),$$(notdir $$f),$$f)), \
+      $1, $$($1_MACRO))))
 
 endef
 
@@ -727,9 +588,14 @@
 
 # Param 1 - Text to write
 # Param 2 - File to write to
+ifeq ($(HAS_FILE_FUNCTION), true)
+  WriteFile = \
+      $(file >$2,$(strip $1))
+else
 # Use printf to get consistent behavior on all platforms.
 WriteFile = \
     $(shell $(PRINTF) "%s" $(call ShellQuote, $1) > $2)
+endif
 
 ################################################################################
 # DependOnVariable
@@ -767,15 +633,16 @@
 # Param 1 - Name of variable
 # Param 2 - (optional) name of file to store value in
 DependOnVariableHelper = \
-    $(strip $(if $(and $(wildcard $(call DependOnVariableFileName, $1, $2)),\
-        $(call equals, $(strip $($1)), \
-            $(call ReadFile, $(call DependOnVariableFileName, $1, $2)))),,\
-      $(call MakeDir, $(dir $(call DependOnVariableFileName, $1, $2))) \
-      $(if $(findstring $(LOG_LEVEL), trace), \
-          $(info Variable $1: >$(strip $($1))<) \
-          $(info File: >$(call ReadFile, $(call DependOnVariableFileName, $1, $2))<)) \
-      $(call WriteFile, $($1), $(call DependOnVariableFileName, $1, $2))) \
-    $(call DependOnVariableFileName, $1, $2))
+    $(strip \
+        $(eval -include $(call DependOnVariableFileName, $1, $2)) \
+        $(if $(call equals, $(strip $($1)), $(strip $($1_old))),,\
+          $(call MakeDir, $(dir $(call DependOnVariableFileName, $1, $2))) \
+          $(if $(findstring $(LOG_LEVEL), trace), \
+              $(info NewVariable $1: >$(strip $($1))<) \
+              $(info OldVariable $1: >$(strip $($1_old))<)) \
+          $(call WriteFile, $1_old:=$($1), $(call DependOnVariableFileName, $1, $2))) \
+        $(call DependOnVariableFileName, $1, $2) \
+    )
 
 # Main macro
 # Param 1 - Name of variable
--- a/make/common/NativeCompilation.gmk	Mon Oct 05 20:24:57 2015 -0700
+++ b/make/common/NativeCompilation.gmk	Tue Oct 06 08:41:18 2015 -0700
@@ -49,6 +49,7 @@
 #   AS - Assembler
 #   MT - Windows MT tool
 #   RC - Windows RC tool
+#   STRIP - The tool to use for stripping debug symbols
 #   SYSROOT_CFLAGS - Compiler flags for using the specific sysroot
 #   SYSROOT_LDFLAGS - Linker flags for using the specific sysroot
 DefineNativeToolchain = $(NamedParamsMacroTemplate)
@@ -64,6 +65,7 @@
     $$(call SetIfEmpty, $1_AS, $$($$($1_EXTENDS)_AS))
     $$(call SetIfEmpty, $1_MT, $$($$($1_EXTENDS)_MT))
     $$(call SetIfEmpty, $1_RC, $$($$($1_EXTENDS)_RC))
+    $$(call SetIfEmpty, $1_STRIP, $$($$($1_EXTENDS)_STRIP))
     $$(call SetIfEmpty, $1_SYSROOT_CFLAGS, $$($$($1_EXTENDS)_SYSROOT_CFLAGS))
     $$(call SetIfEmpty, $1_SYSROOT_LDFLAGS, $$($$($1_EXTENDS)_SYSROOT_LDFLAGS))
   endif
@@ -78,6 +80,7 @@
     AS := $(AS), \
     MT := $(MT), \
     RC := $(RC), \
+    STRIP := $(STRIP), \
     SYSROOT_CFLAGS := $(SYSROOT_CFLAGS), \
     SYSROOT_LDFLAGS := $(SYSROOT_LDFLAGS), \
 ))
@@ -211,23 +214,25 @@
 	    $(call LogFailures, $$($1_$2_OBJ).log, $$($1_SAFE_NAME)_$$(notdir $2), \
 	        $$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2)
           endif
+          # Create a dependency target file from the dependency file.
+          # Solution suggested by http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
+          ifneq ($$($1_$2_DEP),)
+	    $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_$2_DEP) > $$($1_$2_DEP_TARGETS)
+          endif
         else
           # The Visual Studio compiler lacks a feature for generating make dependencies, but by
           # setting -showIncludes, all included files are printed. These are filtered out and
           # parsed into make dependences.
+          # Keep as much as possible on one execution line for best performance on Windows
 	  ($(call LogFailures, $$($1_$2_OBJ).log, $$($1_SAFE_NAME)_$$(notdir $2), \
 	      $$($1_$2_COMP) $$($1_$2_FLAGS) -showIncludes $$($1_$2_DEBUG_OUT_FLAGS) \
 	          $(CC_OUT_OPTION)$$($1_$2_OBJ) $2) ; echo $$$$? > $$($1_$2_DEP).exitvalue) \
 	      | $(TEE) $$($1_$2_DEP).raw | $(GREP) -v -e "^Note: including file:" \
 	          -e "^$(notdir $2)$$$$" || test "$$$$?" = "1" ; \
-	      exit `cat $$($1_$2_DEP).exitvalue`
-	  $(RM) $$($1_$2_DEP).exitvalue
-	  ($(ECHO) $$@: \\ \
-	  && $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_$2_DEP).raw) | $(SORT) -u > $$($1_$2_DEP)
-        endif
-        # Create a dependency target file from the dependency file.
-        # Solution suggested by http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
-        ifneq ($$($1_$2_DEP),)
+	      exit `cat $$($1_$2_DEP).exitvalue` ; \
+	  $(RM) $$($1_$2_DEP).exitvalue ; \\
+	  ($(ECHO) $$@: \\ ; \
+	  $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_$2_DEP).raw) | $(SORT) -u > $$($1_$2_DEP) ; \
 	  $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_$2_DEP) > $$($1_$2_DEP_TARGETS)
         endif
   endif
@@ -265,6 +270,8 @@
 #   LD the linker to use, default is $(LD)
 #   OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST
 #   DISABLED_WARNINGS_<toolchain> Disable the given warnings for the specified toolchain
+#   STRIP_SYMBOLS Set to true to strip the final binary if the toolchain allows for it
+#   STRIPFLAGS Optionally change the flags given to the strip command
 SetupNativeCompilation = $(NamedParamsMacroTemplate)
 define SetupNativeCompilationBody
 
@@ -368,6 +375,7 @@
   $$(call SetIfEmpty, $1_AS, $$($$($1_TOOLCHAIN)_AS))
   $$(call SetIfEmpty, $1_MT, $$($$($1_TOOLCHAIN)_MT))
   $$(call SetIfEmpty, $1_RC, $$($$($1_TOOLCHAIN)_RC))
+  $$(call SetIfEmpty, $1_STRIP, $$($$($1_TOOLCHAIN)_STRIP))
   $$(call SetIfEmpty, $1_SYSROOT_CFLAGS, $$($$($1_TOOLCHAIN)_SYSROOT_CFLAGS))
   $$(call SetIfEmpty, $1_SYSROOT_LDFLAGS, $$($$($1_TOOLCHAIN)_SYSROOT_LDFLAGS))
 
@@ -628,6 +636,10 @@
                 "-map:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map"
             $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb \
                 $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map
+            # No separate command is needed for debuginfo on windows, instead
+            # touch target to make sure it has a later time stamp than the debug
+            # symbol files to avoid unnecessary relinking on rebuild.
+            $1_CREATE_DEBUGINFO_CMDS := $(TOUCH) $$($1_TARGET)
 
           else ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
             $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).debuginfo
@@ -662,6 +674,14 @@
     endif # $1_DEBUG_SYMBOLS
   endif # !STATIC_LIBRARY
 
+  ifeq ($$($1_STRIP_SYMBOLS), true)
+    ifneq ($$($1_STRIP), )
+      # Default to using the global STRIPFLAGS. Allow for overriding with an empty value
+      $1_STRIPFLAGS ?= $(STRIPFLAGS)
+      $1_STRIP_CMD := $$($1_STRIP) $$($1_STRIPFLAGS) $$($1_TARGET)
+    endif
+  endif
+
   ifneq (,$$($1_LIBRARY))
     # Generating a dynamic library.
     $1_EXTRA_LDFLAGS += $$(call SET_SHARED_LIBRARY_NAME,$$($1_BASENAME))
@@ -672,19 +692,21 @@
     $1_EXTRA_LDFLAGS_SUFFIX += $(GLOBAL_LDFLAGS_SUFFIX)
 
     $1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
-        $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX) $$($1_CREATE_DEBUGINFO_CMDS)
+        $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX) $$($1_CREATE_DEBUGINFO_CMDS) \
+        $$($1_STRIP_CMD)
     $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
         $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
 
     $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE) \
         $$($1_VARDEPS_FILE)
-		$(ECHO) $(LOG_INFO) "Linking $$($1_BASENAME)"
+		$(ECHO) $(LOG_INFO) "Linking $$($1_BASENAME)" ; \
 		$(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link.log, $$($1_SAFE_NAME)_link, \
 		    $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
 		    $(LD_OUT_OPTION)$$@ \
 		    $$($1_EXPECTED_OBJS) $$($1_RES) \
-		    $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX))
+		    $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)) ; \
 		$$($1_CREATE_DEBUGINFO_CMDS)
+		$$($1_STRIP_CMD)
                 # Touch target to make sure it has a later time stamp than the debug
                 # symbol files to avoid unnecessary relinking on rebuild.
                 ifeq ($(OPENJDK_TARGET_OS), windows)
@@ -713,13 +735,14 @@
 
     $1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
         $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX) $$($1_MT) \
-        $$($1_CODESIGN) $$($1_CREATE_DEBUGINFO_CMDS) $$($1_MANIFEST_VERSION)
+        $$($1_CODESIGN) $$($1_CREATE_DEBUGINFO_CMDS) $$($1_MANIFEST_VERSION) \
+        $$($1_STRIP_CMD)
     $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
         $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
 
     $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_MANIFEST) \
         $$($1_VARDEPS_FILE)
-		$(ECHO) $(LOG_INFO) "Linking executable $$($1_BASENAME)"
+		$(ECHO) $(LOG_INFO) "Linking executable $$($1_BASENAME)" ; \
 		$(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link.log, $$($1_SAFE_NAME)_link, \
 		    $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
 		        $(EXE_OUT_OPTION)$$($1_TARGET) \
@@ -738,6 +761,7 @@
                   endif
                 endif
 		$$($1_CREATE_DEBUGINFO_CMDS)
+		$$($1_STRIP_CMD)
                 # Touch target to make sure it has a later time stamp than the debug
                 # symbol files to avoid unnecessary relinking on rebuild.
                 ifeq ($(OPENJDK_TARGET_OS), windows)
--- a/make/common/RMICompilation.gmk	Mon Oct 05 20:24:57 2015 -0700
+++ b/make/common/RMICompilation.gmk	Tue Oct 06 08:41:18 2015 -0700
@@ -34,8 +34,6 @@
 #   STUB_CLASSES_DIR:=Directory in where to put stub classes
 #   RUN_V11:=Set to run rmic with -v1.1
 #   RUN_V12:=Set to run rmic with -v1.2
-#   RUN_IIOP:=Set to run rmic with -iiop
-#   RUN_IIOP_STDPKG:=Set to run rmic with -iiop -standardPackage
 #   KEEP_GENERATED:=Set to keep generated sources around
 SetupRMICompilation = $(NamedParamsMacroTemplate)
 define SetupRMICompilationBody
@@ -60,15 +58,6 @@
   $1_TIE_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/org/omg/stub/,$$(addsuffix _Tie.class,$$($1_TIE_BASE_FILES)))
   $1_TIE_STDPKG_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Tie.class,$$($1_TIE_BASE_FILES)))
 
-  ifneq (,$$($1_RUN_IIOP))
-    $1_TARGETS += $$($1_TIE_FILES)
-    $1_ARGS += -iiop -emitPermissionCheck
-  endif
-  ifneq (,$$($1_RUN_IIOP_STDPKG))
-    $1_TARGETS += $$($1_TIE_STDPKG_FILES)
-    $1_ARGS2 := -iiop -emitPermissionCheck -standardPackage
-  endif
-
   ifneq (,$$($1_KEEP_GENERATED))
     $1_ARGS += -keepgenerated
     $1_TARGETS += $$(subst .class,.java,$$($1_TARGETS))
--- a/modules.xml	Mon Oct 05 20:24:57 2015 -0700
+++ b/modules.xml	Tue Oct 06 08:41:18 2015 -0700
@@ -223,6 +223,16 @@
       <to>jdk.dev</to>
     </export>
     <export>
+      <name>jdk.internal.misc</name>
+      <to>java.corba</to>
+      <to>java.desktop</to>
+      <to>java.logging</to>
+      <to>java.management</to>
+      <to>java.naming</to>
+      <to>java.sql</to>
+      <to>jdk.management.resource</to>
+    </export>
+    <export>
       <name>jdk.internal.org.objectweb.asm</name>
       <to>java.instrument</to>
       <to>jdk.jfr</to>
@@ -265,7 +275,6 @@
       <to>java.rmi</to>
       <to>java.security.jgss</to>
       <to>java.security.sasl</to>
-      <to>java.sql</to>
       <to>java.xml</to>
       <to>java.xml.ws</to>
       <to>jdk.charsets</to>
--- a/test/make/TestMakeBase.gmk	Mon Oct 05 20:24:57 2015 -0700
+++ b/test/make/TestMakeBase.gmk	Tue Oct 06 08:41:18 2015 -0700
@@ -213,23 +213,20 @@
 VARDEP_TEST_VAR2 := value3
 
 VARDEP_RETURN_VALUE := $(call DependOnVariable, VARDEP_TEST_VAR2, $(VARDEP_VALUE_FILE))
-ifneq ($(VARDEP_VALUE_FILE), $(VARDEP_RETURN_VALUE))
-  $(error Expected: $(VARDEP_VALUE_FILE) - DependOnVariable: $(VARDEP_RETURN_VALUE))
-endif
+$(eval $(call assert-equals, $(VARDEP_RETURN_VALUE), $(VARDEP_VALUE_FILE), \
+    Wrong filename returned))
 VARDEP_FILE_CONTENTS := $(shell $(CAT) $(VARDEP_VALUE_FILE))
-ifneq ($(VARDEP_TEST_VAR2), $(VARDEP_FILE_CONTENTS))
-  $(error Expected: $(VARDEP_TEST_VAR2) - DependOnVariable file contained: \
-      $(VARDEP_FILE_CONTENTS))
-endif
+$(eval $(call assert-equals, $(VARDEP_FILE_CONTENTS), \
+    VARDEP_TEST_VAR2_old:=$(VARDEP_TEST_VAR2), \
+    Wrong contents in vardeps file))
 
 # Test with a variable value containing some problematic characters
 VARDEP_TEST_VAR3 := foo '""' "''" bar
 VARDEP_VALUE_FILE := $(call DependOnVariable, VARDEP_TEST_VAR3)
 VARDEP_FILE_CONTENTS := $(shell $(CAT) $(VARDEP_VALUE_FILE))
-ifneq ($(VARDEP_TEST_VAR3), $(VARDEP_FILE_CONTENTS))
-  $(error Expected: >$(VARDEP_TEST_VAR3)< - DependOnVariable file contained: \
-      >$(VARDEP_FILE_CONTENTS)<)
-endif
+$(eval $(call assert-equals, $(VARDEP_FILE_CONTENTS), \
+    VARDEP_TEST_VAR3_old:=$(VARDEP_TEST_VAR3), \
+    Wrong contents in vardep file))
 
 TEST_TARGETS += test-vardep