Merge
authorduke
Wed, 05 Jul 2017 20:31:58 +0200
changeset 30318 8f085493151f
parent 30317 febd2373771c (current diff)
parent 30097 16659396d71f (diff)
child 30381 098f4aed1a53
Merge
--- a/.hgtags-top-repo	Thu May 07 20:51:12 2015 -0700
+++ b/.hgtags-top-repo	Wed Jul 05 20:31:58 2017 +0200
@@ -305,3 +305,4 @@
 9fa2185bee17462d1014538bff60af6e6f0b01e7 jdk9-b60
 ea38728b4f4bdd8fd0d7a89b18069f521cf05013 jdk9-b61
 105d045a69174d870b69bfe471b3f2d05a9f8ecc jdk9-b62
+0b32ed628fa60e4ab99fb0b5866d648e16231f17 jdk9-b63
--- a/common/autoconf/basics_windows.m4	Thu May 07 20:51:12 2015 -0700
+++ b/common/autoconf/basics_windows.m4	Wed Jul 05 20:31:58 2017 +0200
@@ -320,8 +320,8 @@
     WINDOWS_ENV_VENDOR='cygwin'
     WINDOWS_ENV_VERSION="$CYGWIN_VERSION"
 
-    CYGWIN_VERSION_OK=`$ECHO $CYGWIN_VERSION | $GREP ^1.7.`
-    if test "x$CYGWIN_VERSION_OK" = x; then
+    CYGWIN_VERSION_OLD=`$ECHO $CYGWIN_VERSION | $GREP -e '^1\.[0-6]'`
+    if test "x$CYGWIN_VERSION_OLD" != x; then
       AC_MSG_NOTICE([Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade.])
       AC_MSG_ERROR([Cannot continue])
     fi
--- a/common/autoconf/boot-jdk.m4	Thu May 07 20:51:12 2015 -0700
+++ b/common/autoconf/boot-jdk.m4	Wed Jul 05 20:31:58 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -306,7 +306,6 @@
   BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAC, javac)
   BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAH, javah)
   BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAR, jar)
-  BOOTJDK_CHECK_TOOL_IN_BOOTJDK(NATIVE2ASCII, native2ascii)
   BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JARSIGNER, jarsigner)
 
   # Finally, set some other options...
--- a/common/autoconf/bootcycle-spec.gmk.in	Thu May 07 20:51:12 2015 -0700
+++ b/common/autoconf/bootcycle-spec.gmk.in	Wed Jul 05 20:31:58 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -57,6 +57,5 @@
 JAVAC_CMD:=$(BOOT_JDK)/bin/javac
 JAVAH_CMD:=$(BOOT_JDK)/bin/javah
 JAR_CMD:=$(BOOT_JDK)/bin/jar
-NATIVE2ASCII_CMD:=$(BOOT_JDK)/bin/native2ascii
 JARSIGNER_CMD:=$(BOOT_JDK)/bin/jarsigner
 SJAVAC_SERVER_JAVA_CMD:=$(JAVA_CMD)
--- a/common/autoconf/flags.m4	Thu May 07 20:51:12 2015 -0700
+++ b/common/autoconf/flags.m4	Wed Jul 05 20:31:58 2017 +0200
@@ -65,12 +65,6 @@
   fi
   AC_SUBST(POST_STRIP_CMD)
 
-  if test "x$OPENJDK_TARGET_OS" = xsolaris; then
-    # FIXME: break out into MCSFLAGS
-    POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\""
-  fi
-  AC_SUBST(POST_MCS_CMD)
-
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     CC_OUT_OPTION=-Fo
     EXE_OUT_OPTION=-out:
--- a/common/autoconf/generated-configure.sh	Thu May 07 20:51:12 2015 -0700
+++ b/common/autoconf/generated-configure.sh	Wed Jul 05 20:31:58 2017 +0200
@@ -737,7 +737,6 @@
 LD_OUT_OPTION
 EXE_OUT_OPTION
 CC_OUT_OPTION
-POST_MCS_CMD
 POST_STRIP_CMD
 ARFLAGS
 COMPILER_TARGET_BITS_FLAG
@@ -759,7 +758,6 @@
 OBJCOPY
 ac_ct_NM
 ac_ct_STRIP
-MCS
 GNM
 NM
 STRIP
@@ -820,7 +818,6 @@
 JAVAC_FLAGS
 BOOT_JDK_SOURCETARGET
 JARSIGNER
-NATIVE2ASCII
 JAR
 JAVAH
 JAVAC
@@ -1189,7 +1186,6 @@
 JAVAC
 JAVAH
 JAR
-NATIVE2ASCII
 JARSIGNER
 CC
 CFLAGS
@@ -1207,7 +1203,6 @@
 STRIP
 NM
 GNM
-MCS
 OBJCOPY
 OBJDUMP
 BUILD_CC
@@ -2070,8 +2065,6 @@
   JAVAC       Override default value for JAVAC
   JAVAH       Override default value for JAVAH
   JAR         Override default value for JAR
-  NATIVE2ASCII
-              Override default value for NATIVE2ASCII
   JARSIGNER   Override default value for JARSIGNER
   CC          C compiler command
   CFLAGS      C compiler flags
@@ -2090,7 +2083,6 @@
   STRIP       Override default value for STRIP
   NM          Override default value for NM
   GNM         Override default value for GNM
-  MCS         Override default value for MCS
   OBJCOPY     Override default value for OBJCOPY
   OBJDUMP     Override default value for OBJDUMP
   BUILD_CC    Override default value for BUILD_CC
@@ -3599,7 +3591,7 @@
 
 # ... then the rest
 #
-# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -4367,7 +4359,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1430331133
+DATE_WHEN_GENERATED=1430918902
 
 ###############################################################################
 #
@@ -14052,8 +14044,8 @@
     WINDOWS_ENV_VENDOR='cygwin'
     WINDOWS_ENV_VERSION="$CYGWIN_VERSION"
 
-    CYGWIN_VERSION_OK=`$ECHO $CYGWIN_VERSION | $GREP ^1.7.`
-    if test "x$CYGWIN_VERSION_OK" = x; then
+    CYGWIN_VERSION_OLD=`$ECHO $CYGWIN_VERSION | $GREP -e '^1\.0-6'`
+    if test "x$CYGWIN_VERSION_OLD" != x; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade." >&5
 $as_echo "$as_me: Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade." >&6;}
       as_fn_error $? "Cannot continue" "$LINENO" 5
@@ -26059,133 +26051,6 @@
   # Publish this variable in the help.
 
 
-  if test "x$NATIVE2ASCII" = x; then
-    # The variable is not set by user, try to locate tool using the code snippet
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for native2ascii in Boot JDK" >&5
-$as_echo_n "checking for native2ascii in Boot JDK... " >&6; }
-      NATIVE2ASCII=$BOOT_JDK/bin/native2ascii
-      if test ! -x $NATIVE2ASCII; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5
-$as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&6;}
-        as_fn_error $? "Could not find native2ascii in the Boot JDK" "$LINENO" 5
-      fi
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-
-
-  else
-    # The variable is set, but is it from the command line or the environment?
-
-    # Try to remove the string !NATIVE2ASCII! from our list.
-    try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!NATIVE2ASCII!/}
-    if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then
-      # If it failed, the variable was not from the command line. Ignore it,
-      # but warn the user (except for BASH, which is always set by the calling BASH).
-      if test "xNATIVE2ASCII" != xBASH; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of NATIVE2ASCII from the environment. Use command line variables instead." >&5
-$as_echo "$as_me: WARNING: Ignoring value of NATIVE2ASCII from the environment. Use command line variables instead." >&2;}
-      fi
-      # Try to locate tool using the code snippet
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for native2ascii in Boot JDK" >&5
-$as_echo_n "checking for native2ascii in Boot JDK... " >&6; }
-      NATIVE2ASCII=$BOOT_JDK/bin/native2ascii
-      if test ! -x $NATIVE2ASCII; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5
-$as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&6;}
-        as_fn_error $? "Could not find native2ascii in the Boot JDK" "$LINENO" 5
-      fi
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-
-
-    else
-      # If it succeeded, then it was overridden by the user. We will use it
-      # for the tool.
-
-      # First remove it from the list of overridden variables, so we can test
-      # for unknown variables in the end.
-      CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var"
-
-      # Check if the provided tool contains a complete path.
-      tool_specified="$NATIVE2ASCII"
-      tool_basename="${tool_specified##*/}"
-      if test "x$tool_basename" = "x$tool_specified"; then
-        # A command without a complete path is provided, search $PATH.
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool NATIVE2ASCII=$tool_basename" >&5
-$as_echo "$as_me: Will search for user supplied tool NATIVE2ASCII=$tool_basename" >&6;}
-        # Extract the first word of "$tool_basename", so it can be a program name with args.
-set dummy $tool_basename; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_NATIVE2ASCII+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $NATIVE2ASCII in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_NATIVE2ASCII="$NATIVE2ASCII" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_NATIVE2ASCII="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-NATIVE2ASCII=$ac_cv_path_NATIVE2ASCII
-if test -n "$NATIVE2ASCII"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NATIVE2ASCII" >&5
-$as_echo "$NATIVE2ASCII" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-        if test "x$NATIVE2ASCII" = x; then
-          as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5
-        fi
-      else
-        # Otherwise we believe it is a complete path. Use it as it is.
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool NATIVE2ASCII=$tool_specified" >&5
-$as_echo "$as_me: Will use user supplied tool NATIVE2ASCII=$tool_specified" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NATIVE2ASCII" >&5
-$as_echo_n "checking for NATIVE2ASCII... " >&6; }
-        if test ! -x "$tool_specified"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-          as_fn_error $? "User supplied tool NATIVE2ASCII=$tool_specified does not exist or is not executable" "$LINENO" 5
-        fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5
-$as_echo "$tool_specified" >&6; }
-      fi
-    fi
-  fi
-
-
-
-  # Use user overridden value if available, otherwise locate tool in the Boot JDK.
-
-  # Publish this variable in the help.
-
-
   if test "x$JARSIGNER" = x; then
     # The variable is not set by user, try to locate tool using the code snippet
 
@@ -28232,7 +28097,7 @@
   # For solaris we really need solaris tools, and not the GNU equivalent.
   # The build tools on Solaris reside in /usr/ccs (C Compilation System),
   # so add that to path before starting to probe.
-  # FIXME: This was originally only done for AS,NM,GNM,STRIP,MCS,OBJCOPY,OBJDUMP.
+  # FIXME: This was originally only done for AS,NM,GNM,STRIP,OBJCOPY,OBJDUMP.
   if test "x$OPENJDK_BUILD_OS" = xsolaris; then
     PATH="/usr/ccs/bin:$PATH"
   fi
@@ -36672,479 +36537,6 @@
     fi
   fi
 
-
-
-
-  # Publish this variable in the help.
-
-
-  if test "x$MCS" = x; then
-    # The variable is not set by user, try to locate tool using the code snippet
-    for ac_prog in mcs
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_MCS+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $MCS in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_MCS="$MCS" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_MCS="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-MCS=$ac_cv_path_MCS
-if test -n "$MCS"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCS" >&5
-$as_echo "$MCS" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MCS" && break
-done
-
-  else
-    # The variable is set, but is it from the command line or the environment?
-
-    # Try to remove the string !MCS! from our list.
-    try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!MCS!/}
-    if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then
-      # If it failed, the variable was not from the command line. Ignore it,
-      # but warn the user (except for BASH, which is always set by the calling BASH).
-      if test "xMCS" != xBASH; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of MCS from the environment. Use command line variables instead." >&5
-$as_echo "$as_me: WARNING: Ignoring value of MCS from the environment. Use command line variables instead." >&2;}
-      fi
-      # Try to locate tool using the code snippet
-      for ac_prog in mcs
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_MCS+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $MCS in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_MCS="$MCS" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_MCS="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-MCS=$ac_cv_path_MCS
-if test -n "$MCS"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCS" >&5
-$as_echo "$MCS" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MCS" && break
-done
-
-    else
-      # If it succeeded, then it was overridden by the user. We will use it
-      # for the tool.
-
-      # First remove it from the list of overridden variables, so we can test
-      # for unknown variables in the end.
-      CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var"
-
-      # Check if the provided tool contains a complete path.
-      tool_specified="$MCS"
-      tool_basename="${tool_specified##*/}"
-      if test "x$tool_basename" = "x$tool_specified"; then
-        # A command without a complete path is provided, search $PATH.
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool MCS=$tool_basename" >&5
-$as_echo "$as_me: Will search for user supplied tool MCS=$tool_basename" >&6;}
-        # Extract the first word of "$tool_basename", so it can be a program name with args.
-set dummy $tool_basename; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_MCS+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $MCS in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_MCS="$MCS" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_MCS="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-MCS=$ac_cv_path_MCS
-if test -n "$MCS"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCS" >&5
-$as_echo "$MCS" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-        if test "x$MCS" = x; then
-          as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5
-        fi
-      else
-        # Otherwise we believe it is a complete path. Use it as it is.
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool MCS=$tool_specified" >&5
-$as_echo "$as_me: Will use user supplied tool MCS=$tool_specified" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MCS" >&5
-$as_echo_n "checking for MCS... " >&6; }
-        if test ! -x "$tool_specified"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
-$as_echo "not found" >&6; }
-          as_fn_error $? "User supplied tool MCS=$tool_specified does not exist or is not executable" "$LINENO" 5
-        fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5
-$as_echo "$tool_specified" >&6; }
-      fi
-    fi
-  fi
-
-
-
-  # Only process if variable expands to non-empty
-
-  if test "x$MCS" != x; then
-    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-
-  # First separate the path from the arguments. This will split at the first
-  # space.
-  complete="$MCS"
-  path="${complete%% *}"
-  tmp="$complete EOL"
-  arguments="${tmp#* }"
-
-  # Input might be given as Windows format, start by converting to
-  # unix format.
-  new_path=`$CYGPATH -u "$path"`
-
-  # Now try to locate executable using which
-  new_path=`$WHICH "$new_path" 2> /dev/null`
-  # bat and cmd files are not always considered executable in cygwin causing which
-  # to not find them
-  if test "x$new_path" = x \
-      && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
-      && test "x`$LS \"$path\" 2>/dev/null`" != x; then
-    new_path=`$CYGPATH -u "$path"`
-  fi
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    # bat and cmd files are not always considered executable in cygwin causing which
-    # to not find them
-    if test "x$new_path" = x \
-        && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
-        && test "x`$LS \"$path\" 2>/dev/null`" != x; then
-      new_path=`$CYGPATH -u "$path"`
-    fi
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5
-$as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5
-    fi
-  fi
-
-  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
-  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
-  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
-  # "foo.exe" is OK but "foo" is an error.
-  #
-  # This test is therefore slightly more accurate than "test -f" to check for file presence.
-  # It is also a way to make sure we got the proper file name for the real test later on.
-  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
-  if test "x$test_shortpath" = x; then
-    # Short path failed, file does not exist as specified.
-    # Try adding .exe or .cmd
-    if test -f "${new_path}.exe"; then
-      input_to_shortpath="${new_path}.exe"
-    elif test -f "${new_path}.cmd"; then
-      input_to_shortpath="${new_path}.cmd"
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$new_path\", is invalid." >&5
-$as_echo "$as_me: The path of MCS, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
-$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5
-    fi
-  else
-    input_to_shortpath="$new_path"
-  fi
-
-  # Call helper function which possibly converts this using DOS-style short mode.
-  # If so, the updated path is stored in $new_path.
-  new_path="$input_to_shortpath"
-
-  input_path="$input_to_shortpath"
-  # Check if we need to convert this using DOS-style short mode. If the path
-  # contains just simple characters, use it. Otherwise (spaces, weird characters),
-  # take no chances and rewrite it.
-  # Note: m4 eats our [], so we need to use [ and ] instead.
-  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
-  if test "x$has_forbidden_chars" != x; then
-    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
-    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
-    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
-    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
-      # Going to short mode and back again did indeed matter. Since short mode is
-      # case insensitive, let's make it lowercase to improve readability.
-      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-      # Now convert it back to Unix-style (cygpath)
-      input_path=`$CYGPATH -u "$shortmode_path"`
-      new_path="$input_path"
-    fi
-  fi
-
-  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
-  if test "x$test_cygdrive_prefix" = x; then
-    # As a simple fix, exclude /usr/bin since it's not a real path.
-    if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then
-      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
-      # a path prefixed by /cygdrive for fixpath to work.
-      new_path="$CYGWIN_ROOT_PATH$input_path"
-    fi
-  fi
-
-  # remove trailing .exe if any
-  new_path="${new_path/%.exe/}"
-
-    elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-
-  # First separate the path from the arguments. This will split at the first
-  # space.
-  complete="$MCS"
-  path="${complete%% *}"
-  tmp="$complete EOL"
-  arguments="${tmp#* }"
-
-  # Input might be given as Windows format, start by converting to
-  # unix format.
-  new_path="$path"
-
-  windows_path="$new_path"
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-    unix_path=`$CYGPATH -u "$windows_path"`
-    new_path="$unix_path"
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
-    new_path="$unix_path"
-  fi
-
-
-  # Now try to locate executable using which
-  new_path=`$WHICH "$new_path" 2> /dev/null`
-
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path="$path"
-
-  windows_path="$new_path"
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-    unix_path=`$CYGPATH -u "$windows_path"`
-    new_path="$unix_path"
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
-    new_path="$unix_path"
-  fi
-
-
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    # bat and cmd files are not always considered executable in MSYS causing which
-    # to not find them
-    if test "x$new_path" = x \
-        && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
-        && test "x`$LS \"$path\" 2>/dev/null`" != x; then
-      new_path="$path"
-
-  windows_path="$new_path"
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-    unix_path=`$CYGPATH -u "$windows_path"`
-    new_path="$unix_path"
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
-    new_path="$unix_path"
-  fi
-
-    fi
-
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5
-$as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;}
-      has_space=`$ECHO "$complete" | $GREP " "`
-      if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5
-    fi
-  fi
-
-  # Now new_path has a complete unix path to the binary
-  if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then
-    # Keep paths in /bin as-is, but remove trailing .exe if any
-    new_path="${new_path/%.exe/}"
-    # Do not save /bin paths to all_fixpath_prefixes!
-  else
-    # Not in mixed or Windows style, start by that.
-    new_path=`cmd //c echo $new_path`
-
-  input_path="$new_path"
-  # Check if we need to convert this using DOS-style short mode. If the path
-  # contains just simple characters, use it. Otherwise (spaces, weird characters),
-  # take no chances and rewrite it.
-  # Note: m4 eats our [], so we need to use [ and ] instead.
-  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
-  if test "x$has_forbidden_chars" != x; then
-    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
-    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-  fi
-
-    # Output is in $new_path
-
-  windows_path="$new_path"
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-    unix_path=`$CYGPATH -u "$windows_path"`
-    new_path="$unix_path"
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
-    new_path="$unix_path"
-  fi
-
-    # remove trailing .exe if any
-    new_path="${new_path/%.exe/}"
-
-    # Save the first 10 bytes of this path to the storage, so fixpath can work.
-    all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
-  fi
-
-    else
-      # We're on a unix platform. Hooray! :)
-      # First separate the path from the arguments. This will split at the first
-      # space.
-      complete="$MCS"
-      path="${complete%% *}"
-      tmp="$complete EOL"
-      arguments="${tmp#* }"
-
-      # Cannot rely on the command "which" here since it doesn't always work.
-      is_absolute_path=`$ECHO "$path" | $GREP ^/`
-      if test -z "$is_absolute_path"; then
-        # Path to executable is not absolute. Find it.
-        IFS_save="$IFS"
-        IFS=:
-        for p in $PATH; do
-          if test -f "$p/$path" && test -x "$p/$path"; then
-            new_path="$p/$path"
-            break
-          fi
-        done
-        IFS="$IFS_save"
-      else
-        # This is an absolute path, we can use it without further modifications.
-        new_path="$path"
-      fi
-
-      if test "x$new_path" = x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5
-$as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;}
-        has_space=`$ECHO "$complete" | $GREP " "`
-        if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
-$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
-        fi
-        as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5
-      fi
-    fi
-
-    # Now join together the path and the arguments once again
-    if test "x$arguments" != xEOL; then
-      new_complete="$new_path ${arguments% *}"
-    else
-      new_complete="$new_path"
-    fi
-
-    if test "x$complete" != "x$new_complete"; then
-      MCS="$new_complete"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MCS to \"$new_complete\"" >&5
-$as_echo "$as_me: Rewriting MCS to \"$new_complete\"" >&6;}
-    fi
-  fi
-
   elif test "x$OPENJDK_TARGET_OS" != xwindows; then
     # FIXME: we should unify this with the solaris case above.
 
@@ -41632,12 +41024,6 @@
   fi
 
 
-  if test "x$OPENJDK_TARGET_OS" = xsolaris; then
-    # FIXME: break out into MCSFLAGS
-    POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\""
-  fi
-
-
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     CC_OUT_OPTION=-Fo
     EXE_OUT_OPTION=-out:
--- a/common/autoconf/spec.gmk.in	Thu May 07 20:51:12 2015 -0700
+++ b/common/autoconf/spec.gmk.in	Wed Jul 05 20:31:58 2017 +0200
@@ -391,7 +391,6 @@
 NM:=@NM@
 GNM:=@GNM@
 STRIP:=@STRIP@
-MCS:=@MCS@
 
 LIPO:=@LIPO@
 
@@ -440,7 +439,6 @@
 OBJ_SUFFIX:=@OBJ_SUFFIX@
 
 POST_STRIP_CMD:=@POST_STRIP_CMD@
-POST_MCS_CMD:=@POST_MCS_CMD@
 
 JAVA_FLAGS:=@JAVA_FLAGS@
 JAVA_FLAGS_BIG:=@JAVA_FLAGS_BIG@
@@ -455,7 +453,6 @@
 JAVAC_CMD:=@JAVAC@
 JAVAH_CMD:=@JAVAH@
 JAR_CMD:=@JAR@
-NATIVE2ASCII_CMD:=@NATIVE2ASCII@
 JARSIGNER_CMD:=@JARSIGNER@
 SJAVAC_SERVER_JAVA_CMD:=@SJAVAC_SERVER_JAVA@
 # These variables are meant to be used. They are defined with = instead of := to make
@@ -465,7 +462,6 @@
 JAVAC=@FIXPATH@ $(JAVAC_CMD)
 JAVAH=@FIXPATH@ $(JAVAH_CMD)
 JAR=@FIXPATH@ $(JAR_CMD)
-NATIVE2ASCII=@FIXPATH@ $(NATIVE2ASCII_CMD) $(JAVA_TOOL_FLAGS_SMALL)
 JARSIGNER=@FIXPATH@ $(JARSIGNER_CMD)
 # A specific java binary with specific options can be used to run
 # the long running background sjavac servers and other long running tasks.
@@ -692,10 +688,10 @@
 SYMBOLS_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(SYMBOLS_IMAGE_SUBDIR)
 
 # Macosx bundles directory definitions
-JDK_BUNDLE_SUBDIR=jdk-bundle/jdk$(JDK_VERSION).jdk/Contents
-JRE_BUNDLE_SUBDIR=jre-bundle/jre$(JDK_VERSION).jre/Contents
-JDK_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_BUNDLE_SUBDIR)
-JRE_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_BUNDLE_SUBDIR)
+JDK_MACOSX_BUNDLE_SUBDIR=jdk-bundle/jdk$(JDK_VERSION).jdk/Contents
+JRE_MACOSX_BUNDLE_SUBDIR=jre-bundle/jre$(JDK_VERSION).jre/Contents
+JDK_MACOSX_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_MACOSX_BUNDLE_SUBDIR)
+JRE_MACOSX_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_MACOSX_BUNDLE_SUBDIR)
 
 # This macro is called to allow inclusion of closed source counterparts.
 # Unless overridden in closed sources, it expands to nothing.
--- a/common/autoconf/toolchain.m4	Thu May 07 20:51:12 2015 -0700
+++ b/common/autoconf/toolchain.m4	Wed Jul 05 20:31:58 2017 +0200
@@ -210,7 +210,7 @@
   # For solaris we really need solaris tools, and not the GNU equivalent.
   # The build tools on Solaris reside in /usr/ccs (C Compilation System),
   # so add that to path before starting to probe.
-  # FIXME: This was originally only done for AS,NM,GNM,STRIP,MCS,OBJCOPY,OBJDUMP.
+  # FIXME: This was originally only done for AS,NM,GNM,STRIP,OBJCOPY,OBJDUMP.
   if test "x$OPENJDK_BUILD_OS" = xsolaris; then
     PATH="/usr/ccs/bin:$PATH"
   fi
@@ -569,9 +569,6 @@
     BASIC_FIXUP_EXECUTABLE(NM)
     BASIC_PATH_PROGS(GNM, gnm)
     BASIC_FIXUP_EXECUTABLE(GNM)
-
-    BASIC_PATH_PROGS(MCS, mcs)
-    BASIC_FIXUP_EXECUTABLE(MCS)
   elif test "x$OPENJDK_TARGET_OS" != xwindows; then
     # FIXME: we should unify this with the solaris case above.
     BASIC_CHECK_TOOLS(STRIP, strip)
--- a/common/bin/unshuffle_list.txt	Thu May 07 20:51:12 2015 -0700
+++ b/common/bin/unshuffle_list.txt	Wed Jul 05 20:31:58 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -1156,7 +1156,6 @@
 jdk/src/java.management/share/classes/com/sun/jmx/interceptor : jdk/src/share/classes/com/sun/jmx/interceptor
 jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver : jdk/src/share/classes/com/sun/jmx/mbeanserver
 jdk/src/java.management/share/classes/com/sun/jmx/remote : jdk/src/share/classes/com/sun/jmx/remote
-jdk/src/java.management/share/classes/com/sun/management : jdk/src/share/classes/com/sun/management
 jdk/src/java.management/share/classes/java/lang/management : jdk/src/share/classes/java/lang/management
 jdk/src/java.management/share/classes/javax/management : jdk/src/share/classes/javax/management
 jdk/src/java.management/share/classes/mgmt-overview.html : jdk/src/share/classes/com/sun/management/mgmt-overview.html
@@ -1429,6 +1428,7 @@
 jdk/src/jdk.localedata/share/classes/sun/util/resources/uk : jdk/src/share/classes/sun/util/resources/uk
 jdk/src/jdk.localedata/share/classes/sun/util/resources/vi : jdk/src/share/classes/sun/util/resources/vi
 jdk/src/jdk.localedata/share/classes/sun/util/resources/zh : jdk/src/share/classes/sun/util/resources/zh
+jdk/src/jdk.management/share/classes/com/sun/management : jdk/src/share/classes/com/sun/management
 jdk/src/jdk.naming.dns/share/classes/com/sun/jndi/dns : jdk/src/share/classes/com/sun/jndi/dns
 jdk/src/jdk.naming.dns/share/classes/com/sun/jndi/url/dns : jdk/src/share/classes/com/sun/jndi/url/dns
 jdk/src/jdk.naming.dns/share/classes/META-INF/services : jdk/src/share/classes/sun/net/spi/nameservice/dns/META-INF/services
--- a/make/CompileJavaModules.gmk	Thu May 07 20:51:12 2015 -0700
+++ b/make/CompileJavaModules.gmk	Wed Jul 05 20:31:58 2017 +0200
@@ -53,17 +53,7 @@
 java.base_EXCLUDE_FILES += sun/text/resources/BreakIteratorRules.java
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  JAVA_BASE_UNIX_DIR := $(JDK_TOPDIR)/src/java.base/unix/classes
-  # TODO: make JavaCompilation handle overrides automatically instead of excluding here
-  # These files are overridden in macosx
-  java.base_EXCLUDE_FILES += \
-      $(JAVA_BASE_UNIX_DIR)/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java \
-      $(JAVA_BASE_UNIX_DIR)/java/net/DefaultInterface.java \
-      $(JAVA_BASE_UNIX_DIR)/java/lang/ClassLoaderHelper.java \
-      $(JAVA_BASE_UNIX_DIR)/sun/nio/ch/DefaultSelectorProvider.java \
-      #
-  # This is just skipped on macosx
-  java.base_EXCLUDE_FILES += $(JAVA_BASE_UNIX_DIR)/sun/nio/fs/GnomeFileTypeDetector.java
+  java.base_EXCLUDE_FILES += sun/nio/fs/GnomeFileTypeDetector.java
 endif
 
 ifneq ($(OPENJDK_TARGET_OS), solaris)
@@ -247,13 +237,6 @@
     javax/swing/plaf/nimbus/TabbedPanePainter.java \
     #
 
-ifeq ($(OPENJDK_TARGET_OS), macosx)
-  # These files are duplicated in MACOSX_SRC_DIRS
-  java.desktop_EXCLUDE_FILES += \
-      $(JDK_TOPDIR)/src/java.desktop/unix/classes/sun/java2d/BackBufferCapsProvider.java \
-      #
-endif
-
 ################################################################################
 
 java.scripting_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
@@ -418,7 +401,6 @@
 endif
 
 ifeq ($(OPENJDK_TARGET_OS),aix)
-  # These files are duplicated in AIX_SRC_DIRS
   jdk.sctp_EXCLUDE_FILES += $(SCTP_IMPL_CLASSES)
 endif
 
--- a/make/Images.gmk	Thu May 07 20:51:12 2015 -0700
+++ b/make/Images.gmk	Wed Jul 05 20:31:58 2017 +0200
@@ -70,7 +70,7 @@
 
 # compact3 builds have additional modules
 JDK_COMPACT3_MODULES := java.compact3 java.smartcardio jdk.httpserver jdk.naming.dns \
-                       jdk.naming.rmi jdk.sctp jdk.security.auth
+                       jdk.naming.rmi jdk.sctp jdk.security.auth jdk.management
 
 # Replacing double-comma with a single comma is to workaround the issue
 # with some version of make on windows that doesn't substitute spaces
@@ -255,30 +255,13 @@
 	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(install-file)
 
-  define install-ja-manpage
-	$(MKDIR) -p $(@D)
-	$(CAT) $< \
-	    | $(NATIVE2ASCII) -encoding eucJP \
-	    | $(SED) 's/@@VERSION@@/$(THIS_JDK_VERSION)/g' \
-	    | $(NATIVE2ASCII) -reverse -encoding $1 \
-	    > $@
-  endef
-
   $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
-	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(call install-ja-manpage, UTF-8)
+	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
 
   $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
-	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(call install-ja-manpage, UTF-8)
-
-  $(JRE_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
-	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(call install-ja-manpage, PCK)
-
-  $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
-	$(ECHO) $(LOG_INFO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(call install-ja-manpage, PCK)
+	$(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(install-file)
 
   ifeq ($(OPENJDK_TARGET_OS), solaris)
     $(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
--- a/make/Jprt.gmk	Thu May 07 20:51:12 2015 -0700
+++ b/make/Jprt.gmk	Wed Jul 05 20:31:58 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -91,8 +91,8 @@
 SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR)
 SRC_JRE_IMAGE_DIR := $(JRE_IMAGE_DIR)
 SRC_TEST_IMAGE_DIR := $(TEST_IMAGE_DIR)
-SRC_JDK_BUNDLE_DIR := $(JDK_BUNDLE_DIR)
-SRC_JRE_BUNDLE_DIR := $(JRE_BUNDLE_DIR)
+SRC_JDK_MACOSX_BUNDLE_DIR := $(JDK_MACOSX_BUNDLE_DIR)
+SRC_JRE_MACOSX_BUNDLE_DIR := $(JRE_MACOSX_BUNDLE_DIR)
 
 # Bundle up the images
 bundles: all
@@ -123,10 +123,10 @@
 	$(CP) -R -P $(SRC_JDK_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)/
 	$(CP) -R -P $(SRC_JRE_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)/
         ifeq ($(OPENJDK_TARGET_OS),macosx)
-	  $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR)
-	  $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR)
-	  $(CP) -R -P $(SRC_JDK_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR)/
-	  $(CP) -R -P $(SRC_JRE_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR)/
+	  $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_MACOSX_BUNDLE_SUBDIR)
+	  $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_MACOSX_BUNDLE_SUBDIR)
+	  $(CP) -R -P $(SRC_JDK_MACOSX_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_MACOSX_BUNDLE_SUBDIR)/
+	  $(CP) -R -P $(SRC_JRE_MACOSX_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_MACOSX_BUNDLE_SUBDIR)/
         endif
 	@$(call TargetExit)
 
--- a/make/MacBundles.gmk	Thu May 07 20:51:12 2015 -0700
+++ b/make/MacBundles.gmk	Wed Jul 05 20:31:58 2017 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,32 +33,13 @@
 
   bundles: jre-bundle jdk-bundle
 
-  # JDK_BUNDLE_DIR and JRE_BUNDLE_DIR are defined in SPEC.
+  # JDK_MACOSX_BUNDLE_DIR and JRE_MACOSX_BUNDLE_DIR are defined in SPEC.
 
   MACOSX_PLIST_SRC := $(JDK_TOPDIR)/make/data/bundle
 
-  # All these OPENJDK checks are needed since there is no coherency between
-  # these values in open and closed. Should probably be fixed.
-  ifndef OPENJDK
-    BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(JDK_MINOR_VERSION)u$(JDK_UPDATE_VERSION)
-  else
-    BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE)
-  endif
-  BUNDLE_ID_JRE := $(BUNDLE_ID).jre
-  BUNDLE_ID_JDK := $(BUNDLE_ID).jdk
-
+  BUNDLE_ID := $(MACOSX_BUNDLE_ID_BASE).$(JDK_MINOR_VERSION)u$(JDK_UPDATE_VERSION)
   BUNDLE_NAME := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_MINOR_VERSION)
-  BUNDLE_NAME_JRE := $(BUNDLE_NAME)
-  BUNDLE_NAME_JDK := $(BUNDLE_NAME)
-
-  ifndef OPENJDK
-    BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_VERSION)
-  else
-    BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) ($(JDK_VERSION))
-  endif
-  BUNDLE_INFO_JRE := $(BUNDLE_INFO)
-  BUNDLE_INFO_JDK := $(BUNDLE_INFO)
-
+  BUNDLE_INFO := $(MACOSX_BUNDLE_NAME_BASE) $(JDK_VERSION)
   BUNDLE_PLATFORM_VERSION := $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION)
   BUNDLE_VERSION := $(JDK_VERSION)
   ifeq ($(COMPANY_NAME), N/A)
@@ -67,65 +48,66 @@
     BUNDLE_VENDOR := $(COMPANY_NAME)
   endif
 
-
   JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR))
   JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR))
 
-  JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_BUNDLE_DIR)/Home/,$(JDK_FILE_LIST))
-  JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_BUNDLE_DIR)/Home/,$(JRE_FILE_LIST))
+  JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_MACOSX_BUNDLE_DIR)/Home/,$(JDK_FILE_LIST))
+  JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_MACOSX_BUNDLE_DIR)/Home/,$(JRE_FILE_LIST))
 
   # Copy empty directories (jre/lib/applet).
-  $(JDK_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/%
+  $(JDK_MACOSX_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/%
 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(MKDIR) -p $(@D)
 	if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi
 
-  $(JRE_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/%
+  $(JRE_MACOSX_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/%
 	$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(MKDIR) -p $(@D)
 	if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi
 
-  $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib:
+  $(JDK_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib:
 	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(LN) -s ../Home/lib/jli/libjli.dylib $@
 
-  $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib:
+  $(JRE_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib:
 	$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	$(LN) -s ../Home/lib/jli/libjli.dylib $@
 
-  $(JDK_BUNDLE_DIR)/Info.plist: $(SPEC)
-	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(MKDIR) -p $(@D)
-	$(SED) -e "s/@@ID@@/$(BUNDLE_ID_JDK)/g" \
-	    -e "s/@@NAME@@/$(BUNDLE_NAME_JDK)/g" \
-	    -e "s/@@INFO@@/$(BUNDLE_INFO_JDK)/g" \
-	    -e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \
-	    -e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \
-	    -e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \
-	    < $(MACOSX_PLIST_SRC)/JDK-Info.plist > $@
+  $(eval $(call SetupTextFileProcessing, BUILD_JDK_PLIST, \
+      SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \
+      OUTPUT_FILE := $(JDK_MACOSX_BUNDLE_DIR)/Info.plist, \
+      REPLACEMENTS := \
+          @@ID@@ => $(BUNDLE_ID).jdk ; \
+          @@NAME@@ => $(BUNDLE_NAME) ; \
+          @@INFO@@ => $(BUNDLE_INFO) ; \
+          @@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \
+          @@VERSION@@ => $(BUNDLE_VERSION) ; \
+          @@VENDOR@@ => $(BUNDLE_VENDOR) , \
+  ))
 
-  $(JRE_BUNDLE_DIR)/Info.plist: $(SPEC)
-	$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
-	$(MKDIR) -p $(@D)
-	$(SED) -e "s/@@ID@@/$(BUNDLE_ID_JRE)/g" \
-	    -e "s/@@NAME@@/$(BUNDLE_NAME_JRE)/g" \
-	    -e "s/@@INFO@@/$(BUNDLE_INFO_JRE)/g" \
-	    -e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" \
-	    -e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" \
-	    -e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" \
-	    < $(MACOSX_PLIST_SRC)/JRE-Info.plist > $@
+  $(eval $(call SetupTextFileProcessing, BUILD_JRE_PLIST, \
+      SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist, \
+      OUTPUT_FILE := $(JRE_MACOSX_BUNDLE_DIR)/Info.plist, \
+      REPLACEMENTS := \
+          @@ID@@ => $(BUNDLE_ID).jre ; \
+          @@NAME@@ => $(BUNDLE_NAME) ; \
+          @@INFO@@ => $(BUNDLE_INFO) ; \
+          @@PLATFORM_VERSION@@ => $(BUNDLE_PLATFORM_VERSION) ; \
+          @@VERSION@@ => $(BUNDLE_VERSION) ; \
+          @@VENDOR@@ => $(BUNDLE_VENDOR) , \
+  ))
 
-  jdk-bundle: $(JDK_TARGET_LIST) $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib \
-      $(JDK_BUNDLE_DIR)/Info.plist
-	$(SETFILE) -a B $(dir $(JDK_BUNDLE_DIR))
+  jdk-bundle: $(JDK_TARGET_LIST) $(JDK_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib \
+      $(BUILD_JDK_PLIST)
+	$(SETFILE) -a B $(dir $(JDK_MACOSX_BUNDLE_DIR))
 
-  jre-bundle: $(JRE_TARGET_LIST) $(JRE_BUNDLE_DIR)/MacOS/libjli.dylib \
-      $(JRE_BUNDLE_DIR)/Info.plist
-	$(SETFILE) -a B $(dir $(JRE_BUNDLE_DIR))
+  jre-bundle: $(JRE_TARGET_LIST) $(JRE_MACOSX_BUNDLE_DIR)/MacOS/libjli.dylib \
+      $(BUILD_JRE_PLIST)
+	$(SETFILE) -a B $(dir $(JRE_MACOSX_BUNDLE_DIR))
 
 else # Not macosx
 
--- a/make/StripBinaries.gmk	Thu May 07 20:51:12 2015 -0700
+++ b/make/StripBinaries.gmk	Wed Jul 05 20:31:58 2017 +0200
@@ -42,7 +42,6 @@
 	$(CP) $< $@.tmp
 	$(CHMOD) u+w $@.tmp
 	$(POST_STRIP_CMD) $@.tmp
-	$(if $(POST_MCS_CMD), $(POST_MCS_CMD) $@.tmp)
 	$(CHMOD) go-w $@.tmp
 	$(MV) $@.tmp $@
   endef
--- a/make/common/JavaCompilation.gmk	Thu May 07 20:51:12 2015 -0700
+++ b/make/common/JavaCompilation.gmk	Wed Jul 05 20:31:58 2017 +0200
@@ -276,7 +276,7 @@
 	$$($1_GREP_EXCLUDE_OUTPUT)
         # If the vardeps file is part of the newer prereq list, it means that
         # either the jar file does not exist, or we need to recreate it from
-        # from scratch anyway since a simple update will not catch all the 
+        # from scratch anyway since a simple update will not catch all the
         # potential changes.
 	$$(if $$(filter $$($1_VARDEPS_FILE) $$($1_MANIFEST), $$?), \
 	  $$(if $$($1_MANIFEST), \
@@ -321,8 +321,8 @@
   $$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$2_TARGET)))
   # To allow for automatic overrides, do not create a rule for a target file that
   # already has one
-  ifeq ($$(findstring $$($2_TARGET), $$($1_COPY_LIST)), )
-    $1_COPY_LIST += $$($2_TARGET)
+  ifneq ($$($1_COPY_$$($2_TARGET)), 1)
+    $1_COPY_$$($2_TARGET) := 1
     # Now we can setup the depency that will trigger the copying.
     $$($1_BIN)$$($2_TARGET) : $2
 	$(MKDIR) -p $$(@D)
@@ -365,7 +365,11 @@
   # Remove the source prefix.
   $$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$2_TARGET)))
   # Now we can setup the depency that will trigger the copying.
-  $$($1_BIN)$$($2_TARGET) : $2
+  # To allow for automatic overrides, do not create a rule for a target file that
+  # already has one
+  ifneq ($$($1_CLEAN_$$($2_TARGET)), 1)
+    $1_CLEAN_$$($2_TARGET) := 1
+    $$($1_BIN)$$($1_MODULE_SUBDIR)$$($2_TARGET) : $2
 	$(MKDIR) -p $$(@D)
 	export LC_ALL=C ; ( $(CAT) $$< && $(ECHO) "" ) \
 	    | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' \
@@ -378,8 +382,9 @@
 	    | $(SORT) > $$@
 	$(CHMOD) -f ug+w $$@
 
-  # And do not forget this target
-  $1_ALL_COPY_CLEAN_TARGETS += $$($1_BIN)$$($2_TARGET)
+    # And do not forget this target
+    $1_ALL_COPY_CLEAN_TARGETS += $$($1_BIN)$$($2_TARGET)
+  endif
 endef
 
 define remove_string
@@ -396,7 +401,8 @@
 #   SETUP:=must point to a previously setup java compiler, for example: SETUP:=BOOTJAVAC
 #   JVM:=path to ..bin/java
 #   ADD_JAVAC_FLAGS:=javac flags to append to the default ones.
-#   SRC:=one or more directories to search for sources
+#   SRC:=one or more directories to search for sources. The order of the source roots
+#        is significant. The first found file of a certain name has priority.
 #   BIN:=store classes here
 #   INCLUDES:=myapp.foo means will only compile java files in myapp.foo or any of its sub-packages.
 #   EXCLUDES:=myapp.foo means will do not compile java files in myapp.foo or any of its sub-packages.
@@ -432,7 +438,7 @@
   # Handle addons and overrides.
   $1_SRC:=$$(call ADD_SRCS,$$($1_SRC))
   # Make sure the dirs exist.
-  $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupJavaCompilation $1 contains missing directory $$d)))
+  $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupJavaCompilation $1 contains missing directory >$$d<)))
   $$(call MakeDir,$$($1_BIN))
   # Add all source roots to the find cache since we are likely going to run find
   # on these more than once. The cache will only be updated if necessary.
@@ -450,15 +456,6 @@
     $1_SRCS := $$(filter $$($1_INCLUDE_FILES), $$($1_SRCS))
   endif
 
-  # Now we have a list of all java files to compile: $$($1_SRCS)
-
-  # Create the corresponding smart javac wrapper command line.
-  $1_SJAVAC_ARGS:=$$(addprefix -x ,$$(addsuffix /*,$$($1_EXCLUDES))) \
-      $$(addprefix -i ,$$(addsuffix /*,$$($1_INCLUDES))) \
-      $$(addprefix -xf *,$$(strip $$($1_EXCLUDE_FILES))) \
-      $$(addprefix -if *,$$(strip $$($1_INCLUDE_FILES))) \
-      -src "$$(subst $$(SPACE),$$(PATH_SEP),$$(strip $$($1_SRC)))"
-
   # Prepend the source/bin path to the filter expressions.
   ifneq ($$($1_INCLUDES),)
     $1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES))))
@@ -469,6 +466,25 @@
     $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS))
   endif
 
+  # Remove duplicate source files by keeping the first found of each duplicate.
+  # This allows for automatic overrides with custom or platform specific versions
+  # source files.
+  #
+  # For the smart javac wrapper case, add each removed file to an extra exclude
+  # file list to prevent sjavac from finding duplicate sources.
+  $1_SRCS := $$(strip $$(foreach s, $$($1_SRCS), \
+      $$(eval relative_src := $$(call remove-prefixes, $$($1_SRC), $$(s))) \
+      $$(if $$($1_$$(relative_src)), \
+        $$(eval $1_SJAVAC_EXCLUDE_FILES += $$(s)), \
+        $$(eval $1_$$(relative_src) := 1) $$(s))))
+
+ # Create the corresponding smart javac wrapper command line.
+  $1_SJAVAC_ARGS:=$$(addprefix -x ,$$(addsuffix /*,$$($1_EXCLUDES))) \
+      $$(addprefix -i ,$$(addsuffix /*,$$($1_INCLUDES))) \
+      $$(addprefix -xf *,$$(strip $$($1_EXCLUDE_FILES) $$($1_SJAVAC_EXCLUDE_FILES))) \
+      $$(addprefix -if *,$$(strip $$($1_INCLUDE_FILES))) \
+      -src "$$(subst $$(SPACE),$$(PATH_SEP),$$(strip $$($1_SRC)))"
+
   # All files below META-INF are always copied.
   $1_ALL_COPIES := $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS))
   # Find all files to be copied from source to bin.
--- a/make/common/MakeBase.gmk	Thu May 07 20:51:12 2015 -0700
+++ b/make/common/MakeBase.gmk	Wed Jul 05 20:31:58 2017 +0200
@@ -45,6 +45,11 @@
 # Functions
 ##############################
 
+### Debug functions
+
+# Prints the name and value of a variable
+PrintVar = \
+    $(info $(strip $1) >$($(strip $1))<)
 
 ### Functions for timers
 
@@ -558,6 +563,13 @@
     $(and $(findstring $(strip $1),$(strip $2)),\
         $(findstring $(strip $2),$(strip $1)))
 
+# Remove a whole list of prefixes
+# $1 - List of prefixes
+# $2 - List of elements to process
+remove-prefixes = \
+    $(strip $(if $1,$(patsubst $(firstword $1)%,%,\
+      $(call remove-prefixes,$(filter-out $(firstword $1),$1),$2)),$2))
+
 ################################################################################
 
 ifneq ($(DISABLE_CACHE_FIND), true)
--- a/make/common/Modules.gmk	Thu May 07 20:51:12 2015 -0700
+++ b/make/common/Modules.gmk	Wed Jul 05 20:31:58 2017 +0200
@@ -43,7 +43,7 @@
 
 # Find all modules with java sources by looking in the source dirs
 define FindJavaModules
-  $(filter-out $(JAVA_MODULES_FILTER), $(sort $(notdir \
+  $(filter-out $(MODULES_FILTER), $(sort $(notdir \
       $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir \
       $(wildcard $(patsubst %,%/*/share/classes/*, $(ALL_TOP_SRC_DIRS)) \
           $(patsubst %,%/*/$(OPENJDK_TARGET_OS)/classes/*, $(ALL_TOP_SRC_DIRS)) \
@@ -52,7 +52,8 @@
 
 # Find all modules with source for the target platform.
 define FindAllModules
-  $(sort $(filter-out closed demo sample, $(notdir $(patsubst %/,%, $(dir \
+  $(sort $(filter-out $(MODULES_FILTER) closed demo sample, \
+      $(notdir $(patsubst %/,%, $(dir \
       $(wildcard $(patsubst %, %/*/share, $(ALL_TOP_SRC_DIRS)) \
       $(patsubst %, %/*/$(OPENJDK_TARGET_OS), $(ALL_TOP_SRC_DIRS)) \
       $(patsubst %, %/*/$(OPENJDK_TARGET_OS_TYPE), $(ALL_TOP_SRC_DIRS))))))))
--- a/make/jprt.properties	Thu May 07 20:51:12 2015 -0700
+++ b/make/jprt.properties	Wed Jul 05 20:31:58 2017 +0200
@@ -28,8 +28,8 @@
 # Global settings
 #
 
-# Regression tests depend on test bundle
-jprt.use.reg.test.bundle=true
+# Install test bundle for targets in jprt.test.bundle.targets set
+jprt.selective.test.bundle.installation=true
 
 # The current release name
 jprt.tools.default.release=jdk9
@@ -48,6 +48,9 @@
 # Use configure when building
 jprt.build.use.configure=true
 
+# Set up the run flavors (jvm variants)
+jprt.run.flavors=c1,c2,default,${my.additional.run.flavors}
+
 # Set make target to use for different build flavors
 jprt.build.flavor.debugOpen.target=jprt_bundle
 jprt.build.flavor.fastdebug.target=jprt_bundle
@@ -73,6 +76,7 @@
 # Select test targets - jprt default for jprt.test.set is "default"
 jprt.test.targets=${my.test.targets.${jprt.test.set}}
 jprt.make.rule.test.targets=${my.make.rule.test.targets.${jprt.test.set}}
+jprt.test.bundle.targets=${my.jprt.test.bundle.targets.${jprt.test.set}}
 
 # 7155453: Work-around to prevent popups on OSX from blocking test completion
 # but the work-around is added to all platforms to be consistent
@@ -415,19 +419,15 @@
 
 # Make file based test targets
 
-my.make.rule.test.targets.hotspot.clienttests=				\
-  linux_i586_2.6-*-c1-hotspot_clienttest,				\
-  windows_i586_6.2-*-c1-hotspot_clienttest
-
-my.make.rule.test.targets.hotspot.servertests=				\
-  solaris_sparcv9_5.11-*-c2-hotspot_servertest,				\
-  solaris_x64_5.11-*-c2-hotspot_servertest,				\
-  linux_i586_2.6-*-c2-hotspot_servertest,				\
-  linux_x64_2.6-*-c2-hotspot_servertest,				\
-  macosx_x64_10.9-*-c2-hotspot_servertest,				\
-  windows_i586_6.2-*-c2-hotspot_servertest,				\
-  windows_x64_6.2-*-c2-hotspot_servertest
-
+my.make.rule.test.targets.hotspot.basicvmtests=                         \
+  linux_i586_2.6-*-default-hotspot_basicvmtest,                         \
+  linux_x64_2.6-*-default-hotspot_basicvmtest,                          \
+  macosx_x64_10.9-*-default-hotspot_basicvmtest,                        \
+  solaris_sparcv9_5.11-*-default-hotspot_basicvmtest,                   \
+  solaris_x64_5.11-*-default-hotspot_basicvmtest,                       \
+  windows_i586_6.2-*-default-hotspot_basicvmtest,                       \
+  windows_x64_6.2-*-default-hotspot_basicvmtest
+  
 my.make.rule.test.targets.hotspot.internalvmtests=			\
   solaris_sparcv9_5.11-fastdebug-c2-hotspot_internalvmtests,		\
   solaris_x64_5.11-fastdebug-c2-hotspot_internalvmtests,		\
@@ -448,10 +448,8 @@
   linux_i586_2.6-fastdebug-c1-GROUP,					\
   windows_i586_6.2-fastdebug-c1-GROUP
 
-my.make.rule.test.targets.hotspot=						\
-  ${my.make.rule.test.targets.hotspot.clienttests},				\
-  ${my.make.rule.test.targets.hotspot.servertests},				\
-  ${my.make.rule.test.targets.hotspot.internalvmtests},				\
+# Hotspot jtreg tests
+my.make.rule.test.targets.hotspot.reg=						\
   ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_wbapitest},	\
   ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler_1},	\
   ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler_2},	\
@@ -461,12 +459,29 @@
   ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_gc_closed},       \
   ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_gc_gcold},        \
   ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_runtime},		\
-  ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_runtime_closed},	\
   ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_serviceability},	\
   ${my.make.rule.test.targets.hotspot.reg.group:GROUP=jdk_svc_sanity},		\
-  ${my.additional.make.rule.test.targets.hotspot}
+  ${my.additional.make.rule.test.targets.hotspot.reg}
+
+# Other Makefile based Hotspot tests
+my.make.rule.test.targets.hotspot.other=                                \
+  ${my.make.rule.test.targets.hotspot.basicvmtests},                    \
+  ${my.make.rule.test.targets.hotspot.internalvmtests},                 \
+  ${my.additional.make.rule.test.targets.hotspot.other}
+
+# All the makefile based tests to run
+my.make.rule.test.targets.hotspot=                                      \
+  ${my.make.rule.test.targets.hotspot.reg}                              \
+  ${my.make.rule.test.targets.hotspot.other}
+
+# Install the test bundle for the testset hotspot jtreg tests
+# (but not for the other Makefile based tests)
+my.jprt.test.bundle.targets.hotspot=${my.make.rule.test.targets.hotspot.reg}
 
 # Native jdk and hotspot test targets (testset=nativesanity)
 my.make.rule.test.targets.nativesanity=					\
     ${my.test.target.set:TESTNAME=jdk_native_sanity},			\
     ${my.test.target.set:TESTNAME=hotspot_native_sanity}
+
+# Install the test bundle for the nativesanity jtreg tests
+my.jprt.test.bundle.targets.nativesanity=${my.make.rule.test.targets.nativesanity}
--- a/modules.xml	Thu May 07 20:51:12 2015 -0700
+++ b/modules.xml	Wed Jul 05 20:31:58 2017 +0200
@@ -222,11 +222,13 @@
       <name>jdk.internal.org.objectweb.asm</name>
       <to>jdk.jfr</to>
       <to>jdk.scripting.nashorn</to>
+      <to>java.instrument</to>
     </export>
     <export>
       <name>jdk.internal.org.objectweb.asm.commons</name>
       <to>jdk.jfr</to>
       <to>jdk.scripting.nashorn</to>
+      <to>java.instrument</to>
     </export>
     <export>
       <name>jdk.internal.org.objectweb.asm.signature</name>
@@ -235,11 +237,13 @@
     <export>
       <name>jdk.internal.org.objectweb.asm.tree</name>
       <to>jdk.jfr</to>
+      <to>java.instrument</to>
     </export>
     <export>
       <name>jdk.internal.org.objectweb.asm.util</name>
       <to>jdk.jfr</to>
       <to>jdk.scripting.nashorn</to>
+      <to>java.instrument</to>
     </export>
     <export>
       <name>sun.misc</name>
@@ -266,6 +270,7 @@
       <to>jdk.security.auth</to>
       <to>jdk.security.jgss</to>
       <to>jdk.snmp</to>
+      <to>java.instrument</to>
     </export>
     <export>
       <name>sun.net.dns</name>
@@ -310,6 +315,7 @@
       <to>java.sql</to>
       <to>java.sql.rowset</to>
       <to>jdk.scripting.nashorn</to>
+      <to>java.instrument</to>
     </export>
     <export>
       <name>sun.reflect.annotation</name>
@@ -766,6 +772,10 @@
     <export>
       <name>java.lang.instrument</name>
     </export>
+    <export>
+      <name>jdk.internal.instrumentation</name>
+      <to>jdk.jfr</to>
+    </export>
   </module>
   <module>
     <name>java.logging</name>
@@ -781,9 +791,6 @@
     <depend>java.naming</depend>
     <depend re-exports="true">java.rmi</depend>
     <export>
-      <name>com.sun.management</name>
-    </export>
-    <export>
       <name>java.lang.management</name>
     </export>
     <export>
@@ -816,9 +823,11 @@
     <export>
       <name>sun.management</name>
       <to>jdk.jconsole</to>
+      <to>jdk.management</to>
     </export>
     <export>
       <name>sun.management.spi</name>
+      <to>jdk.management</to>
       <to>jdk.management.cmm</to>
     </export>
   </module>
@@ -1664,6 +1673,7 @@
     <depend>java.rmi</depend>
     <depend>jdk.attach</depend>
     <depend>jdk.jvmstat</depend>
+    <depend>jdk.management</depend>
     <export>
       <name>com.sun.tools.jconsole</name>
     </export>
@@ -1716,6 +1726,14 @@
     <depend>java.base</depend>
   </module>
   <module>
+    <name>jdk.management</name>
+    <depend>java.base</depend>
+    <depend re-exports="true">java.management</depend>
+    <export>
+      <name>com.sun.management</name>
+    </export>
+  </module>
+  <module>
     <name>jdk.naming.dns</name>
     <depend>java.base</depend>
     <depend>java.naming</depend>
--- a/test/lib/sun/hotspot/WhiteBox.java	Thu May 07 20:51:12 2015 -0700
+++ b/test/lib/sun/hotspot/WhiteBox.java	Wed Jul 05 20:31:58 2017 +0200
@@ -32,6 +32,7 @@
 import java.util.function.Function;
 import java.util.stream.Stream;
 import java.security.BasicPermission;
+import java.util.Objects;
 
 import sun.hotspot.parser.DiagnosticCommand;
 
@@ -74,11 +75,27 @@
   public native void printHeapSizes();
 
   // Memory
-  public native long getObjectAddress(Object o);
+  private native long getObjectAddress0(Object o);
+  public           long getObjectAddress(Object o) {
+    Objects.requireNonNull(o);
+    return getObjectAddress0(o);
+  }
+
   public native int  getHeapOopSize();
   public native int  getVMPageSize();
-  public native boolean isObjectInOldGen(Object o);
-  public native long getObjectSize(Object o);
+  public native long getVMLargePageSize();
+
+  private native boolean isObjectInOldGen0(Object o);
+  public         boolean isObjectInOldGen(Object o) {
+    Objects.requireNonNull(o);
+    return isObjectInOldGen0(o);
+  }
+
+  private native long getObjectSize0(Object o);
+  public         long getObjectSize(Object o) {
+    Objects.requireNonNull(o);
+    return getObjectSize0(o);
+  }
 
   // Runtime
   // Make sure class name is in the correct format
@@ -86,21 +103,45 @@
     return isClassAlive0(name.replace('.', '/'));
   }
   private native boolean isClassAlive0(String name);
-  public native boolean isMonitorInflated(Object obj);
+
+  private native boolean isMonitorInflated0(Object obj);
+  public         boolean isMonitorInflated(Object obj) {
+    Objects.requireNonNull(obj);
+    return isMonitorInflated0(obj);
+  }
+
   public native void forceSafepoint();
 
   // JVMTI
-  public native void addToBootstrapClassLoaderSearch(String segment);
-  public native void addToSystemClassLoaderSearch(String segment);
+  private native void addToBootstrapClassLoaderSearch0(String segment);
+  public         void addToBootstrapClassLoaderSearch(String segment){
+    Objects.requireNonNull(segment);
+    addToBootstrapClassLoaderSearch0(segment);
+  }
+
+  private native void addToSystemClassLoaderSearch0(String segment);
+  public         void addToSystemClassLoaderSearch(String segment) {
+    Objects.requireNonNull(segment);
+    addToSystemClassLoaderSearch0(segment);
+  }
 
   // G1
   public native boolean g1InConcurrentMark();
-  public native boolean g1IsHumongous(Object o);
+  private native boolean g1IsHumongous0(Object o);
+  public         boolean g1IsHumongous(Object o) {
+    Objects.requireNonNull(o);
+    return g1IsHumongous0(o);
+  }
+
   public native long    g1NumMaxRegions();
   public native long    g1NumFreeRegions();
   public native int     g1RegionSize();
   public native MemoryUsage g1AuxiliaryMemoryUsage();
-  public native Object[]    parseCommandLine(String commandline, char delim, DiagnosticCommand[] args);
+  private  native Object[]    parseCommandLine0(String commandline, char delim, DiagnosticCommand[] args);
+  public          Object[]    parseCommandLine(String commandline, char delim, DiagnosticCommand[] args) {
+    Objects.requireNonNull(args);
+    return parseCommandLine0(commandline, delim, args);
+  }
 
   // NMT
   public native long NMTMalloc(long size);
@@ -119,45 +160,93 @@
   public        boolean isMethodCompiled(Executable method) {
     return isMethodCompiled(method, false /*not osr*/);
   }
-  public native boolean isMethodCompiled(Executable method, boolean isOsr);
+  private native boolean isMethodCompiled0(Executable method, boolean isOsr);
+  public         boolean isMethodCompiled(Executable method, boolean isOsr){
+    Objects.requireNonNull(method);
+    return isMethodCompiled0(method, isOsr);
+  }
   public        boolean isMethodCompilable(Executable method) {
     return isMethodCompilable(method, -1 /*any*/);
   }
   public        boolean isMethodCompilable(Executable method, int compLevel) {
     return isMethodCompilable(method, compLevel, false /*not osr*/);
   }
-  public native boolean isMethodCompilable(Executable method, int compLevel, boolean isOsr);
-  public native boolean isMethodQueuedForCompilation(Executable method);
+  private native boolean isMethodCompilable0(Executable method, int compLevel, boolean isOsr);
+  public         boolean isMethodCompilable(Executable method, int compLevel, boolean isOsr) {
+    Objects.requireNonNull(method);
+    return isMethodCompilable0(method, compLevel, isOsr);
+  }
+  private native boolean isMethodQueuedForCompilation0(Executable method);
+  public         boolean isMethodQueuedForCompilation(Executable method) {
+    Objects.requireNonNull(method);
+    return isMethodQueuedForCompilation0(method);
+  }
   public        int     deoptimizeMethod(Executable method) {
     return deoptimizeMethod(method, false /*not osr*/);
   }
-  public native int     deoptimizeMethod(Executable method, boolean isOsr);
+  private native int     deoptimizeMethod0(Executable method, boolean isOsr);
+  public         int     deoptimizeMethod(Executable method, boolean isOsr) {
+    Objects.requireNonNull(method);
+    return deoptimizeMethod0(method, isOsr);
+  }
   public        void    makeMethodNotCompilable(Executable method) {
     makeMethodNotCompilable(method, -1 /*any*/);
   }
   public        void    makeMethodNotCompilable(Executable method, int compLevel) {
     makeMethodNotCompilable(method, compLevel, false /*not osr*/);
   }
-  public native void    makeMethodNotCompilable(Executable method, int compLevel, boolean isOsr);
+  private native void    makeMethodNotCompilable0(Executable method, int compLevel, boolean isOsr);
+  public         void    makeMethodNotCompilable(Executable method, int compLevel, boolean isOsr) {
+    Objects.requireNonNull(method);
+    makeMethodNotCompilable0(method, compLevel, isOsr);
+  }
   public        int     getMethodCompilationLevel(Executable method) {
     return getMethodCompilationLevel(method, false /*not ost*/);
   }
-  public native int     getMethodCompilationLevel(Executable method, boolean isOsr);
-  public native boolean testSetDontInlineMethod(Executable method, boolean value);
+  private native int     getMethodCompilationLevel0(Executable method, boolean isOsr);
+  public         int     getMethodCompilationLevel(Executable method, boolean isOsr) {
+    Objects.requireNonNull(method);
+    return getMethodCompilationLevel0(method, isOsr);
+  }
+  private native boolean testSetDontInlineMethod0(Executable method, boolean value);
+  public         boolean testSetDontInlineMethod(Executable method, boolean value) {
+    Objects.requireNonNull(method);
+    return testSetDontInlineMethod0(method, value);
+  }
   public        int     getCompileQueuesSize() {
     return getCompileQueueSize(-1 /*any*/);
   }
   public native int     getCompileQueueSize(int compLevel);
-  public native boolean testSetForceInlineMethod(Executable method, boolean value);
+  private native boolean testSetForceInlineMethod0(Executable method, boolean value);
+  public         boolean testSetForceInlineMethod(Executable method, boolean value) {
+    Objects.requireNonNull(method);
+    return testSetForceInlineMethod0(method, value);
+  }
   public        boolean enqueueMethodForCompilation(Executable method, int compLevel) {
     return enqueueMethodForCompilation(method, compLevel, -1 /*InvocationEntryBci*/);
   }
-  public native boolean enqueueMethodForCompilation(Executable method, int compLevel, int entry_bci);
-  public native void    clearMethodState(Executable method);
+  private native boolean enqueueMethodForCompilation0(Executable method, int compLevel, int entry_bci);
+  public  boolean enqueueMethodForCompilation(Executable method, int compLevel, int entry_bci) {
+    Objects.requireNonNull(method);
+    return enqueueMethodForCompilation0(method, compLevel, entry_bci);
+  }
+  private native void    clearMethodState0(Executable method);
+  public         void    clearMethodState(Executable method) {
+    Objects.requireNonNull(method);
+    clearMethodState0(method);
+  }
   public native void    lockCompilation();
   public native void    unlockCompilation();
-  public native int     getMethodEntryBci(Executable method);
-  public native Object[] getNMethod(Executable method, boolean isOsr);
+  private native int     getMethodEntryBci0(Executable method);
+  public         int     getMethodEntryBci(Executable method) {
+    Objects.requireNonNull(method);
+    return getMethodEntryBci0(method);
+  }
+  private native Object[] getNMethod0(Executable method, boolean isOsr);
+  public         Object[] getNMethod(Executable method, boolean isOsr) {
+    Objects.requireNonNull(method);
+    return getNMethod0(method, isOsr);
+  }
   public native long    allocateCodeBlob(int size, int type);
   public        long    allocateCodeBlob(long size, int type) {
       int intSize = (int) size;
@@ -168,14 +257,7 @@
       return allocateCodeBlob( intSize, type);
   }
   public native void    freeCodeBlob(long addr);
-  public        void    forceNMethodSweep() {
-    try {
-        forceNMethodSweep0().join();
-    } catch (InterruptedException e) {
-        Thread.currentThread().interrupt();
-    }
-  }
-  public native Thread  forceNMethodSweep0();
+  public native void    forceNMethodSweep();
   public native Object[] getCodeHeapEntries(int type);
   public native int     getCompilationActivityMode();
   public native Object[] getCodeBlob(long addr);
@@ -213,7 +295,11 @@
   // Native extensions
   public native long getHeapUsageForContext(int context);
   public native long getHeapRegionCountForContext(int context);
-  public native int getContextForObject(Object obj);
+  private native int getContextForObject0(Object obj);
+  public         int getContextForObject(Object obj) {
+    Objects.requireNonNull(obj);
+    return getContextForObject0(obj);
+  }
   public native void printRegionInfo(int context);
 
   // VM flags
--- a/test/make/TestJavaCompilation.gmk	Thu May 07 20:51:12 2015 -0700
+++ b/test/make/TestJavaCompilation.gmk	Wed Jul 05 20:31:58 2017 +0200
@@ -231,6 +231,117 @@
 .PHONY: clean-jar3 create-jar3 update-jar3
 
 ################################################################################
+# Test SetupJavaCompilation overrides of java files
+
+$(eval $(call SetupJavaCompiler,BOOT_JAVAC, \
+    JAVAC := $(JAVAC), \
+))
+
+JAVA_SRC_ROOT1 := $(OUTPUT_DIR)/javaroot1
+JAVA_SRC_ROOT2 := $(OUTPUT_DIR)/javaroot2
+
+# Since this makefile calls itself a number of times, protect this macro from
+# being executed more than once.
+# Param 1 - File name
+# Param 2 - Package name
+# Param 3 - Class name
+# Param 4 - Message
+CreateJavaSrc = \
+    $(if $(wildcard $1),,$(shell \
+        $(MKDIR) -p $(dir $1); \
+        $(ECHO) "package $2;" > $1; \
+        $(ECHO) "public class $3 {" >> $1; \
+        $(ECHO) "    public static void main(String[] args) {" >> $1; \
+        $(ECHO) "        System.out.print(\"$4\");" >> $1; \
+        $(ECHO) "    }" >> $1; \
+        $(ECHO) "}" >> $1; \
+    ))
+
+# Since this makefile calls itself a number of times, protect this macro from
+# being executed more than once.
+# Param 1 - File name
+# Param 2 - Message
+CreateTextFile = \
+    $(if $(wildcard $1),,$(shell \
+        $(MKDIR) -p $(dir $1); \
+        $(PRINTF) '$2' > $1; \
+    ))
+
+$(call CreateJavaSrc,$(JAVA_SRC_ROOT1)/a/A.java,a,A,javaroot1)
+$(call CreateJavaSrc,$(JAVA_SRC_ROOT2)/a/A.java,a,A,javaroot2)
+$(call CreateTextFile,$(JAVA_SRC_ROOT1)/a/b.txt,javaroot1\n)
+$(call CreateTextFile,$(JAVA_SRC_ROOT2)/a/b.txt,javaroot2\n)
+$(call CreateTextFile,$(JAVA_SRC_ROOT1)/a/c.properties,#javaroot1\nname=value1\n)
+$(call CreateTextFile,$(JAVA_SRC_ROOT2)/a/c.properties,#javaroot2\nname=value2\n)
+
+# Due to a bug in gnu make 3.81, need to add the src roots with trailing slash,
+# otherwise $(wildcard ) will not find the directories and the sanity check in
+# SetupJavaCompilation will fail.
+$(eval $(call SetupJavaCompilation, BUILD_ROOT1_FIRST, \
+    SETUP := BOOT_JAVAC, \
+    SRC := $(JAVA_SRC_ROOT1)/ $(JAVA_SRC_ROOT2)/, \
+    COPY := .txt .java, \
+    CLEAN := .properties, \
+    BIN := $(OUTPUT_DIR)/root1first/, \
+))
+
+$(BUILD_ROOT1_FIRST):
+
+verify-root1-first: $(BUILD_ROOT1_FIRST)
+	$(JAVA_SMALL) -cp $(OUTPUT_DIR)/root1first a.A > $(OUTPUT_DIR)/root1first.output
+	if [ "`$(CAT) $(OUTPUT_DIR)/root1first.output`" != "javaroot1" ]; then \
+	  $(ECHO) "The wrong class was compiled. Expected >javaroot1<"; \
+	  $(ECHO) "Got >`$(CAT) $(OUTPUT_DIR)/root1first.output`<"; \
+	  false; \
+	fi
+	if [ "`$(CAT) $(OUTPUT_DIR)/root1first/a/b.txt`" != "javaroot1" ]; then \
+	  $(ECHO) "The wrong file was copied. Expected >javaroot1<"; \
+	  $(ECHO) "Got >`$(CAT) $(OUTPUT_DIR)/root1first/a/b.txt`<"; \
+	  false; \
+	fi
+	if [ ! -e "$(OUTPUT_DIR)/root1first/a/A.java" ]; then \
+	  $(ECHO) "Missed copying $(OUTPUT_DIR)/root1first/a/A.java"; \
+	  false; \
+	fi
+	if [ "`$(CAT) $(OUTPUT_DIR)/root1first/a/c.properties`" != "name=value1" ]; then \
+	  $(ECHO) "The wrong file was cleaned. Expected >name=value1<"; \
+	  $(ECHO) "Got >`$(CAT) $(OUTPUT_DIR)/root1first/a/c.properties`<"; \
+	  false; \
+	fi
+
+$(eval $(call SetupJavaCompilation, BUILD_ROOT2_FIRST, \
+    SETUP := BOOT_JAVAC, \
+    SRC := $(JAVA_SRC_ROOT2)/ $(JAVA_SRC_ROOT1)/, \
+    COPY := .txt, \
+    CLEAN := .properties, \
+    BIN := $(OUTPUT_DIR)/root2first/, \
+))
+
+$(BUILD_ROOT2_FIRST):
+
+verify-root2-first: $(BUILD_ROOT2_FIRST)
+	$(JAVA_SMALL) -cp $(OUTPUT_DIR)/root2first a.A > $(OUTPUT_DIR)/root2first.output
+	if [ "`$(CAT) $(OUTPUT_DIR)/root2first.output`" != "javaroot2" ]; then \
+	  $(ECHO) "The wrong class was compiled. Expected >javaroot2<"; \
+	  $(ECHO) "Got >`$(CAT) $(OUTPUT_DIR)/root2first.output`<"; \
+	  false; \
+	fi
+	if [ "`$(CAT) $(OUTPUT_DIR)/root2first/a/b.txt`" != "javaroot2" ]; then \
+	  $(ECHO) "The wrong file was cleaned. Expected >javaroot2<"; \
+	  $(ECHO) "Got >`$(CAT) $(OUTPUT_DIR)/root2first/a/b.txt`<"; \
+	  false; \
+	fi
+	if [ "`$(CAT) $(OUTPUT_DIR)/root2first/a/c.properties`" != "name=value2" ]; then \
+	  $(ECHO) "The wrong file was cleaned. Expected >name=value2<"; \
+	  $(ECHO) "Got >`$(CAT) $(OUTPUT_DIR)/root2first/a/c.properties`<"; \
+	  false; \
+	fi
+
+TEST_TARGETS += verify-root1-first verify-root2-first
+
+.PHONY: verify-root1-first verify-root2-first
+
+################################################################################
 
 all: $(TEST_TARGETS)
 
--- a/test/make/TestMakeBase.gmk	Thu May 07 20:51:12 2015 -0700
+++ b/test/make/TestMakeBase.gmk	Wed Jul 05 20:31:58 2017 +0200
@@ -33,6 +33,16 @@
     $(SRC_ROOT)/make/common/MakeBase.gmk \
     #
 
+# Assert two strings are equal
+# 1 - Tested value
+# 2 - Exepected value
+# 3 - Error message
+define assert-equals
+  ifneq ($$(strip $1),$$(strip $2))
+    $$(error $3 - Expected >$$(strip $2)< - Got >$$(strip $1)<)
+  endif
+endef
+
 # On macosx, file system timestamps only have 1 second resultion so must add
 # sleeps to properly test dependencies.
 ifeq ($(OPENJDK_BUILD_OS), macosx)
@@ -77,6 +87,17 @@
 endif
 
 ################################################################################
+# Test remove-prefixes
+
+$(eval $(call assert-equals, \
+    $(call remove-prefixes, pre, prefix postfix), fix postfix, \
+    Prefixes not properly removed))
+
+$(eval $(call assert-equals, \
+    $(call remove-prefixes, pre post, prefix postfix), fix fix, \
+    Prefixes not properly removed))
+
+################################################################################
 # Test ShellQuote
 
 SHELL_QUOTE_VALUE := foo '""' "''" bar