diff --git a/.hgtags b/.hgtags index 19a55a23eb9..9ee80f4f235 100644 --- a/.hgtags +++ b/.hgtags @@ -289,3 +289,8 @@ b409bc51bc23cfd51f2bd04ea919ec83535af9d0 jdk9-b37 abbfccd659b91a7bb815d5e36fed635dcdd40f31 jdk9-b44 bfc24ae2b900187585079bb11e66e459d1e525fe jdk9-b45 722378bc599e38d9a1dd484de30f10dfd7b21438 jdk9-b46 +8327024a99559982b848e9c2191da9c0bf8838fd jdk9-b47 +b2f9702efbe95527ea3a991474fda23987ff1c5c jdk9-b48 +5b8db585a33c3cc48e70e688ceee57dd9271dc5d jdk9-b49 +1550b2f6b63d1411fa84dc7bbc6f04809aedb43f jdk9-b50 +6efe265424e3f1ea596408a1f71baf2de316c772 jdk9-b51 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 2539f7e2c81..f8935a56868 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -289,3 +289,8 @@ f7c11da0b0481d49cc7a65a453336c108191e821 jdk9-b42 8994f5d87b3bb5e8d317d4e8ccb326da1a73684a jdk9-b44 3dd628fde2086218d548841022ee8436b6b88185 jdk9-b45 12f1e276447bcc81516e85367d53e4f08897049d jdk9-b46 +b6cca3e6175a69f39e5799b7349ddb0176630291 jdk9-b47 +0064e246d83f6f9fc245c19b6d05041ecaf4b6d4 jdk9-b48 +d91ed1951b948210590ce1394bea5515357246ba jdk9-b49 +d1f37d39ff2421f956a6ddf316cf763807bc3363 jdk9-b50 +6207b4b8731ca75c51b031c47daa813ab92ef558 jdk9-b51 diff --git a/Makefile b/Makefile index 0814d3867c6..825bad1fcb7 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,17 @@ else endif root_dir:=$(patsubst %/,%,$(dir $(makefile_path))) +ifeq ($(MAIN_TARGETS), ) + COMMAND_LINE_VARIABLES:=$(subst =command,,$(filter %=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var)))))) + MAKE_CONTROL_VARIABLES:=LOG CONF SPEC JOBS TEST IGNORE_OLD_CONFIG + UNKNOWN_COMMAND_LINE_VARIABLES:=$(strip $(filter-out $(MAKE_CONTROL_VARIABLES), $(COMMAND_LINE_VARIABLES))) + ifneq ($(UNKNOWN_COMMAND_LINE_VARIABLES), ) + $(info Note: Command line contains non-control variables: $(UNKNOWN_COMMAND_LINE_VARIABLES).) + $(info Make sure it is not mistyped, and that you intend to override this variable.) + $(info 'make help' will list known control variables) + endif +endif + ifneq ($(findstring qp,$(MAKEFLAGS)),) # When called with -qp, assume an external part (e.g. bash completion) is trying # to understand our targets. @@ -148,62 +159,64 @@ endif # Here are "global" targets, i.e. targets that can be executed without specifying a single configuration. # If you add more global targets, please update the variable global_targets in MakeHelpers. +# Helper macro to allow $(info) to properly print strings beginning with spaces. +_:= + help: $(info ) $(info OpenJDK Makefile help) $(info =====================) $(info ) $(info Common make targets) - $(info . make [default] # Compile all modules in langtools, hotspot, jaxp, jaxws,) - $(info . # corba and jdk and create a runnable "exploded" image) - $(info . make all # Compile everything, all repos, docs and images) - $(info . make images # Create complete jdk and jre images) - $(info . make # Compile the specified phase and everything it depends on) - $(info . # (gensrc, java, copy, libs, launchers, gendata, rmic)) - $(info . make *-only # Applies to most targets and disables compling the) - $(info . # dependencies for the target. This is faster but may) - $(info . # result in incorrect build results!) - $(info . make docs # Create all docs) - $(info . make docs-javadoc # Create just javadocs, depends on less than full docs) - $(info . make profiles # Create complete jre compact profile images) - $(info . make bootcycle-images # Build images twice, second time with newly built JDK) - $(info . make install # Install the generated images locally) - $(info . make reconfigure # Rerun configure with the same arguments as last time) - $(info . make help # Give some help on using make) - $(info . make test # Run tests, default is all tests (see TEST below)) + $(info $(_) make [default] # Compile all modules in langtools, hotspot, jdk, jaxws,) + $(info $(_) # jaxp and corba, and create a runnable "exploded" image) + $(info $(_) make all # Compile everything, all repos, docs and images) + $(info $(_) make images # Create complete j2sdk and j2re images) + $(info $(_) make # Build the specified phase and everything it depends on) + $(info $(_) # (gensrc, java, copy, libs, launchers, gendata, rmic)) + $(info $(_) make *-only # Applies to most targets and disables compling the) + $(info $(_) # dependencies for the target. This is faster but may) + $(info $(_) # result in incorrect build results!) + $(info $(_) make docs # Create all docs) + $(info $(_) make docs-javadoc # Create just javadocs, depends on less than full docs) + $(info $(_) make profiles # Create complete j2re compact profile images) + $(info $(_) make bootcycle-images # Build images twice, second time with newly built JDK) + $(info $(_) make install # Install the generated images locally) + $(info $(_) make reconfigure # Rerun configure with the same arguments as last time) + $(info $(_) make help # Give some help on using make) + $(info $(_) make test # Run tests, default is all tests (see TEST below)) $(info ) $(info Targets for cleaning) - $(info . make clean # Remove all files generated by make, but not those) - $(info . # generated by configure) - $(info . make dist-clean # Remove all files, including configuration) - $(info . make clean- # Remove the subdir in the output dir with the name) - $(info . make clean- # Remove all build results related to a certain build) - $(info . # phase (gensrc, java, libs, launchers)) - $(info . make clean- # Remove all build results related to a certain module) - $(info . make clean-- # Remove all build results related to a certain) - $(info . # module and phase) + $(info $(_) make clean # Remove all files generated by make, but not those) + $(info $(_) # generated by configure) + $(info $(_) make dist-clean # Remove all files, including configuration) + $(info $(_) make clean- # Remove the subdir in the output dir with the name) + $(info $(_) make clean- # Remove all build results related to a certain build) + $(info $(_) # phase (gensrc, java, libs, launchers)) + $(info $(_) make clean- # Remove all build results related to a certain module) + $(info $(_) make clean-- # Remove all build results related to a certain) + $(info $(_) # module and phase) $(info ) $(info Targets for specific modules) - $(info . make # Build and everything it depends on. ) - $(info . make - # Compile the specified phase for the specified module) - $(info . # and everything it depends on) - $(info . # (gensrc, java, copy, libs, launchers, gendata, rmic)) + $(info $(_) make # Build and everything it depends on.) + $(info $(_) make - # Compile the specified phase for the specified module) + $(info $(_) # and everything it depends on) + $(info $(_) # (gensrc, java, copy, libs, launchers, gendata, rmic)) $(info ) - $(info Useful make variables) - $(info . make CONF= # Build all configurations (note, assignment is empty)) - $(info . make CONF= # Build the configuration(s) with a name matching) - $(info . # ) - $(info ) - $(info . make LOG= # Change the log level from warn to ) - $(info . # Available log levels are:) - $(info . # 'warn' (default), 'info', 'debug' and 'trace') - $(info . # To see executed command lines, use LOG=debug) - $(info ) - $(info . make JOBS= # Run parallel make jobs) - $(info . # Note that -jN does not work as expected!) - $(info ) - $(info . make test TEST= # Only run the given test or tests, e.g.) - $(info . # make test TEST="jdk_lang jdk_net") + $(info Make control variables) + $(info $(_) CONF= # Build all configurations (note, assignment is empty)) + $(info $(_) CONF= # Build the configuration(s) with a name matching) + $(info $(_) # ) + $(info $(_) SPEC= # Build the configuration given by the spec file) + $(info $(_) LOG= # Change the log level from warn to ) + $(info $(_) # Available log levels are:) + $(info $(_) # 'warn' (default), 'info', 'debug' and 'trace') + $(info $(_) # To see executed command lines, use LOG=debug) + $(info $(_) JOBS= # Run parallel make jobs) + $(info $(_) # Note that -jN does not work as expected!) + $(info $(_) IGNORE_OLD_CONFIG=true # Skip tests if spec file is up to date) + $(info $(_) make test TEST= # Only run the given test or tests, e.g.) + $(info $(_) # make test TEST="jdk_lang jdk_net") $(info ) .PHONY: help diff --git a/README-builds.html b/README-builds.html index 438c9907a9d..85a1040db38 100644 --- a/README-builds.html +++ b/README-builds.html @@ -1463,14 +1463,13 @@

Building with ccache

-

A simple way to radically speed up compilation of native code - (typically hotspot and native libraries in JDK) is to install - ccache. This will cache and reuse prior compilation results, if the - source code is unchanged. However, ccache versions prior to 3.1.4 - does not work correctly with the precompiled headers used in - OpenJDK. So if your platform supports ccache at 3.1.4 or later, we - highly recommend installing it. This is currently only supported on - linux.

+

The OpenJDK build supports building with ccache + when using gcc or clang. Using ccache can + radically speed up compilation of native code if + you often rebuild the same sources. Your milage + may vary however so we recommend evaluating it for + yourself. To enable it, make sure it's on the path + and configure with --enable-ccache.

Building on local disk

diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index 62d83574289..422837aae88 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -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 @@ -77,26 +77,30 @@ AC_DEFUN([BASIC_PREPEND_TO_PATH], # $1: The name of the variable to fix AC_DEFUN([BASIC_FIXUP_PATH], [ - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - BASIC_FIXUP_PATH_CYGWIN($1) - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - BASIC_FIXUP_PATH_MSYS($1) - else - # We're on a unix platform. Hooray! :) - path="[$]$1" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.]) - AC_MSG_ERROR([Spaces are not allowed in this path.]) - fi + # Only process if variable expands to non-empty + + if test "x[$]$1" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + BASIC_FIXUP_PATH_CYGWIN($1) + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + BASIC_FIXUP_PATH_MSYS($1) + else + # We're on a unix platform. Hooray! :) + path="[$]$1" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.]) + AC_MSG_ERROR([Spaces are not allowed in this path.]) + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.]) - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.]) + fi - $1="`cd "$path"; $THEPWDCMD -L`" + $1="`cd "$path"; $THEPWDCMD -L`" + fi fi ]) @@ -113,57 +117,61 @@ AC_DEFUN([BASIC_FIXUP_PATH], # $1: The name of the variable to fix AC_DEFUN([BASIC_FIXUP_EXECUTABLE], [ - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - BASIC_FIXUP_EXECUTABLE_CYGWIN($1) - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - BASIC_FIXUP_EXECUTABLE_MSYS($1) - else - # We're on a unix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="[$]$1" - 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" + # Only process if variable expands to non-empty + + if test "x[$]$1" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + BASIC_FIXUP_EXECUTABLE_CYGWIN($1) + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + BASIC_FIXUP_EXECUTABLE_MSYS($1) else - # This is an absolute path, we can use it without further modifications. - new_path="$path" - fi + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="[$]$1" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.]) - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - AC_MSG_NOTICE([This might be caused by spaces in the path, which is not allowed.]) + # 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 + AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.]) + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + AC_MSG_NOTICE([This might be caused by spaces in the path, which is not allowed.]) + fi + AC_MSG_ERROR([Cannot locate the the path of $1]) fi - AC_MSG_ERROR([Cannot locate the the path of $1]) 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 + # 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 - $1="$new_complete" - AC_MSG_NOTICE([Rewriting $1 to "$new_complete"]) + if test "x$complete" != "x$new_complete"; then + $1="$new_complete" + AC_MSG_NOTICE([Rewriting $1 to "$new_complete"]) + fi fi ]) @@ -242,6 +250,9 @@ AC_DEFUN_ONCE([BASIC_INIT], [ # Save the original command line. This is passed to us by the wrapper configure script. AC_SUBST(CONFIGURE_COMMAND_LINE) + # Save the path variable before it gets changed + ORIGINAL_PATH="$PATH" + AC_SUBST(ORIGINAL_PATH) DATE_WHEN_CONFIGURED=`LANG=C date` AC_SUBST(DATE_WHEN_CONFIGURED) AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.]) @@ -896,10 +907,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS], fi AC_SUBST(IS_GNU_TIME) - if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - BASIC_REQUIRE_PROGS(COMM, comm) - fi - if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then BASIC_REQUIRE_PROGS(DSYMUTIL, dsymutil) BASIC_REQUIRE_PROGS(XATTR, xattr) @@ -987,3 +994,26 @@ AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES], IS_RECONFIGURE=no fi ]) + +# Check for support for specific options in bash +AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS], +[ + # Test if bash supports pipefail. + AC_MSG_CHECKING([if bash supports pipefail]) + if ${BASH} -c 'set -o pipefail'; then + BASH_ARGS="$BASH_ARGS -o pipefail" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + + AC_MSG_CHECKING([if bash supports errexit (-e)]) + if ${BASH} -e -c 'true'; then + BASH_ARGS="$BASH_ARGS -e" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + + AC_SUBST(BASH_ARGS) +]) diff --git a/common/autoconf/bootcycle-spec.gmk.in b/common/autoconf/bootcycle-spec.gmk.in index a547f34c951..6e68c3a0b34 100644 --- a/common/autoconf/bootcycle-spec.gmk.in +++ b/common/autoconf/bootcycle-spec.gmk.in @@ -46,8 +46,12 @@ endif BOOT_JDK := $(JDK_IMAGE_DIR) # The bootcycle build has a different output directory -BUILD_OUTPUT:=@BUILD_OUTPUT@/bootcycle-build -SJAVAC_SERVER_DIR:=$(subst @BUILD_OUTPUT@,$(BUILD_OUTPUT),$(SJAVAC_SERVER_DIR)) +OLD_BUILD_OUTPUT:=@BUILD_OUTPUT@ +BUILD_OUTPUT:=$(OLD_BUILD_OUTPUT)/bootcycle-build +# The HOTSPOT_DIST dir is not defined relative to BUILD_OUTPUT in spec.gmk. Must not +# use space in this patsubst to avoid leading space in HOTSPOT_DIST. +HOTSPOT_DIST:=$(patsubst $(OLD_BUILD_OUTPUT)%,$(BUILD_OUTPUT)%,$(HOTSPOT_DIST)) +SJAVAC_SERVER_DIR:=$(patsubst $(OLD_BUILD_OUTPUT)%, $(BUILD_OUTPUT)%, $(SJAVAC_SERVER_DIR)) JAVA_CMD:=$(BOOT_JDK)/bin/java JAVAC_CMD:=$(BOOT_JDK)/bin/javac diff --git a/common/autoconf/build-performance.m4 b/common/autoconf/build-performance.m4 index 5c106cd1f68..49316f7eb41 100644 --- a/common/autoconf/build-performance.m4 +++ b/common/autoconf/build-performance.m4 @@ -164,19 +164,26 @@ AC_DEFUN([BPERF_SETUP_CCACHE], [enable using ccache to speed up recompilations @<:@disabled@:>@])]) CCACHE= + CCACHE_STATUS= AC_MSG_CHECKING([is ccache enabled]) - ENABLE_CCACHE=$enable_ccache if test "x$enable_ccache" = xyes; then - AC_MSG_RESULT([yes]) - OLD_PATH="$PATH" - if test "x$TOOLCHAIN_PATH" != x; then - PATH=$TOOLCHAIN_PATH:$PATH + if test "x$TOOLCHAIN_TYPE" = "xgcc" -o "x$TOOLCHAIN_TYPE" = "xclang"; then + AC_MSG_RESULT([yes]) + OLD_PATH="$PATH" + if test "x$TOOLCHAIN_PATH" != x; then + PATH=$TOOLCHAIN_PATH:$PATH + fi + BASIC_REQUIRE_PROGS(CCACHE, ccache) + PATH="$OLD_PATH" + CCACHE_VERSION=[`$CCACHE --version | head -n1 | $SED 's/[A-Za-z ]*//'`] + CCACHE_STATUS="Active ($CCACHE_VERSION)" + else + AC_MSG_RESULT([no]) + AC_MSG_WARN([ccache is not supported with toolchain type $TOOLCHAIN_TYPE]) fi - BASIC_REQUIRE_PROGS(CCACHE, ccache) - CCACHE_STATUS="enabled" - PATH="$OLD_PATH" elif test "x$enable_ccache" = xno; then AC_MSG_RESULT([no, explicitly disabled]) + CCACHE_STATUS="Disabled" elif test "x$enable_ccache" = x; then AC_MSG_RESULT([no]) else @@ -206,35 +213,31 @@ AC_DEFUN([BPERF_SETUP_CCACHE], AC_DEFUN([BPERF_SETUP_CCACHE_USAGE], [ if test "x$CCACHE" != x; then - # Only use ccache if it is 3.1.4 or later, which supports - # precompiled headers. - AC_MSG_CHECKING([if ccache supports precompiled headers]) - HAS_GOOD_CCACHE=`($CCACHE --version | head -n 1 | grep -E 3.1.@<:@456789@:>@) 2> /dev/null` - if test "x$HAS_GOOD_CCACHE" = x; then - AC_MSG_RESULT([no, disabling ccache]) - CCACHE= - CCACHE_STATUS="disabled" - else - AC_MSG_RESULT([yes]) + if test "x$USE_PRECOMPILED_HEADER" = "x1"; then + HAS_BAD_CCACHE=[`$ECHO $CCACHE_VERSION | \ + $GREP -e '^1.*' -e '^2.*' -e '^3\.0.*' -e '^3\.1\.[0123]'`] + if test "x$HAS_BAD_CCACHE" != "x"; then + AC_MSG_ERROR([Precompiled headers requires ccache 3.1.4 or later, found $CCACHE_VERSION]) + fi AC_MSG_CHECKING([if C-compiler supports ccache precompiled headers]) + CCACHE_PRECOMP_FLAG="-fpch-preprocess" PUSHED_FLAGS="$CXXFLAGS" - CXXFLAGS="-fpch-preprocess $CXXFLAGS" + CXXFLAGS="$CCACHE_PRECOMP_FLAG $CXXFLAGS" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [CC_KNOWS_CCACHE_TRICK=yes], [CC_KNOWS_CCACHE_TRICK=no]) CXXFLAGS="$PUSHED_FLAGS" if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then AC_MSG_RESULT([yes]) + CFLAGS_CCACHE="$CCACHE_PRECOMP_FLAG" + AC_SUBST(CFLAGS_CCACHE) + CCACHE_SLOPPINESS=pch_defines,time_macros else - AC_MSG_RESULT([no, disabling ccaching of precompiled headers]) - CCACHE= - CCACHE_STATUS="disabled" + AC_MSG_RESULT([no]) + AC_MSG_ERROR([Cannot use ccache with precompiled headers without compiler support for $CCACHE_PRECOMP_FLAG]) fi fi - fi - if test "x$CCACHE" != x; then - CCACHE_SLOPPINESS=time_macros - CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS $CCACHE" - CCACHE_FLAGS=-fpch-preprocess + CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR \ + CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$TOPDIR $CCACHE" if test "x$SET_CCACHE_DIR" != x; then mkdir -p $CCACHE_DIR > /dev/null 2>&1 diff --git a/common/autoconf/configure b/common/autoconf/configure index b6a38a307e3..e786ff81916 100644 --- a/common/autoconf/configure +++ b/common/autoconf/configure @@ -40,8 +40,9 @@ if test "x$BASH" = x; then echo "Error: This script must be run using bash." 1>&2 exit 1 fi -# Force autoconf to use bash +# Force autoconf to use bash. This also means we must disable autoconf re-exec. export CONFIG_SHELL=$BASH +export _as_can_reexec=no conf_script_dir="$TOPDIR/common/autoconf" diff --git a/common/autoconf/configure.ac b/common/autoconf/configure.ac index 146556f479e..902ba475684 100644 --- a/common/autoconf/configure.ac +++ b/common/autoconf/configure.ac @@ -113,6 +113,7 @@ HELP_SETUP_DEPENDENCY_HELP # Setup tools that requires more complex handling, or that is not needed by the configure script. BASIC_SETUP_COMPLEX_TOOLS +BASIC_CHECK_BASH_OPTIONS # Check if pkg-config is available. PKG_PROG_PKG_CONFIG diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index b4bbfe476c3..aa1bc2b849f 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -558,15 +558,23 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \ - -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \ - -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ - -DWIN32 -DIAL" + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK \ + -Zi -MD -Zc:wchar_t- -W3 -wd4800 \ + -DWIN32_LEAN_AND_MEAN \ + -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ + -DWIN32 -DIAL" if test "x$OPENJDK_TARGET_CPU" = xx86_64; then COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64" else COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86" fi + # If building with Visual Studio 2010, we can still use _STATIC_CPPLIB to + # avoid bundling msvcpNNN.dll. Doesn't work with newer versions of visual + # studio. + if test "x$TOOLCHAIN_VERSION" = "x2010"; then + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \ + -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB" + fi fi ############################################################################### diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index bb2da367573..6029574b757 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -629,6 +629,7 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS LIBOBJS +CFLAGS_CCACHE CCACHE USE_PRECOMPILED_HEADER SJAVAC_SERVER_DIR @@ -645,6 +646,7 @@ NUM_CORES ENABLE_INTREE_EC SALIB_NAME HOTSPOT_MAKE_ARGS +MSVCP_DLL MSVCR_DLL LIBCXX LLVM_LIBS @@ -853,6 +855,7 @@ OS_VERSION_MICRO OS_VERSION_MINOR OS_VERSION_MAJOR PKG_CONFIG +BASH_ARGS CODESIGN XATTR DSYMUTIL @@ -990,6 +993,7 @@ CAT BASH BASENAME DATE_WHEN_CONFIGURED +ORIGINAL_PATH CONFIGURE_COMMAND_LINE target_alias host_alias @@ -1076,6 +1080,7 @@ with_override_nashorn with_override_jdk with_import_hotspot with_toolchain_type +with_toolchain_version with_jtreg with_extra_cflags with_extra_cxxflags @@ -1100,6 +1105,7 @@ with_libpng with_zlib with_stdc__lib with_msvcr_dll +with_msvcp_dll with_dxsdk with_dxsdk_lib with_dxsdk_include @@ -1931,6 +1937,10 @@ Optional Packages: source --with-toolchain-type the toolchain type (or family) to use, use '--help' to show possible values [platform dependent] + --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 @@ -1966,8 +1976,10 @@ Optional Packages: force linking of the C++ runtime on Linux to either static or dynamic, default is static with dynamic as fallback - --with-msvcr-dll copy this msvcr100.dll into the built JDK (Windows - only) [probed] + --with-msvcr-dll path to microsoft C runtime dll (msvcr*.dll) + (Windows only) [probed] + --with-msvcp-dll path to microsoft C++ runtime dll (msvcp*.dll) + (Windows only) [probed] --with-dxsdk Deprecated. Option is kept for backwards compatibility and is ignored --with-dxsdk-lib Deprecated. Option is kept for backwards @@ -3374,7 +3386,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Include these first... # -# 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 @@ -3522,6 +3534,9 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +# Check for support for specific options in bash + + # # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -4303,12 +4318,59 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++" # questions. # +################################################################################ + +VALID_VS_VERSIONS="2010 2012 2013" + +VS_DESCRIPTION_2010="Microsoft Visual Studio 2010" +VS_VERSION_INTERNAL_2010=100 +VS_MSVCR_2010=msvcr100.dll +# We don't use msvcp on Visual Studio 2010 +#VS_MSVCP_2010=msvcp100.dll +VS_ENVVAR_2010="VS100COMNTOOLS" +VS_VS_INSTALLDIR_2010="Microsoft Visual Studio 10.0" +VS_SDK_INSTALLDIR_2010="Microsoft SDKs/Windows/v7.1" +VS_VS_PLATFORM_NAME_2010="v100" +VS_SDK_PLATFORM_NAME_2010="Windows7.1SDK" + +VS_DESCRIPTION_2012="Microsoft Visual Studio 2012" +VS_VERSION_INTERNAL_2012=110 +VS_MSVCR_2012=msvcr110.dll +VS_MSVCP_2012=msvcp110.dll +VS_ENVVAR_2012="VS110COMNTOOLS" +VS_VS_INSTALLDIR_2012="Microsoft Visual Studio 11.0" +VS_SDK_INSTALLDIR_2012= +VS_VS_PLATFORM_NAME_2012="v110" +VS_SDK_PLATFORM_NAME_2012= + +VS_DESCRIPTION_2013="Microsoft Visual Studio 2013" +VS_VERSION_INTERNAL_2013=120 +VS_MSVCR_2013=msvcr120.dll +VS_MSVCP_2013=msvcp120.dll +VS_ENVVAR_2013="VS120COMNTOOLS" +VS_VS_INSTALLDIR_2013="Microsoft Visual Studio 12.0" +VS_SDK_INSTALLDIR_2013= +VS_VS_PLATFORM_NAME_2013="v120" +VS_SDK_PLATFORM_NAME_2013= + +################################################################################ +################################################################################ +################################################################################ +# Finds the bat or cmd file in Visual Studio or the SDK that sets up a proper +# build environment and assigns it to VS_ENV_CMD + + +################################################################################ + + + +################################################################################ # Check if the VS env variables were setup prior to running configure. # If not, then find vcvarsall.bat and run it automatically, and integrate # the set env variables into the spec file. @@ -4323,13 +4385,15 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++" + + # This line needs to be here, verbatim, after all includes and the dummy hook # definitions. It is replaced with custom functionality when building # custom sources. #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1421796117 +DATE_WHEN_GENERATED=1424976950 ############################################################################### # @@ -4362,6 +4426,9 @@ DATE_WHEN_GENERATED=1421796117 # Save the original command line. This is passed to us by the wrapper configure script. + # Save the path variable before it gets changed + ORIGINAL_PATH="$PATH" + DATE_WHEN_CONFIGURED=`LANG=C date` { $as_echo "$as_me:${as_lineno-$LINENO}: Configuration created at $DATE_WHEN_CONFIGURED." >&5 @@ -14100,7 +14167,10 @@ $as_echo "$TOPDIR" >&6; } # We can only call BASIC_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS. - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$CURDIR" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -14161,7 +14231,7 @@ $as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid." $as_echo "$as_me: Rewriting CURDIR to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$CURDIR" has_colon=`$ECHO $path | $GREP ^.:` @@ -14202,27 +14272,31 @@ $as_echo "$as_me: Rewriting CURDIR to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$CURDIR" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CURDIR, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$CURDIR" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CURDIR, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of CURDIR, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of CURDIR, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - CURDIR="`cd "$path"; $THEPWDCMD -L`" + CURDIR="`cd "$path"; $THEPWDCMD -L`" + fi fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$TOPDIR" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -14283,7 +14357,7 @@ $as_echo "$as_me: The path of TOPDIR, which resolves as \"$path\", is invalid." $as_echo "$as_me: Rewriting TOPDIR to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$TOPDIR" has_colon=`$ECHO $path | $GREP ^.:` @@ -14324,23 +14398,24 @@ $as_echo "$as_me: Rewriting TOPDIR to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$TOPDIR" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of TOPDIR, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$TOPDIR" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of TOPDIR, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of TOPDIR, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of TOPDIR, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of TOPDIR, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - TOPDIR="`cd "$path"; $THEPWDCMD -L`" + TOPDIR="`cd "$path"; $THEPWDCMD -L`" + fi fi # SRC_ROOT is a traditional alias for TOPDIR. @@ -14745,7 +14820,10 @@ $as_echo "$DEBUG_LEVEL" >&6; } if test "${with_devkit+set}" = set; then : withval=$with_devkit; - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$with_devkit" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -14806,7 +14884,7 @@ $as_echo "$as_me: The path of with_devkit, which resolves as \"$path\", is inval $as_echo "$as_me: Rewriting with_devkit to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$with_devkit" has_colon=`$ECHO $path | $GREP ^.:` @@ -14847,23 +14925,24 @@ $as_echo "$as_me: Rewriting with_devkit to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$with_devkit" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_devkit, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$with_devkit" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_devkit, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of with_devkit, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of with_devkit, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of with_devkit, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - with_devkit="`cd "$path"; $THEPWDCMD -L`" + with_devkit="`cd "$path"; $THEPWDCMD -L`" + fi fi DEVKIT_ROOT="$with_devkit" @@ -15219,7 +15298,10 @@ $as_echo_n "checking what configuration name to use... " >&6; } $as_echo "$CONF_NAME" >&6; } - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$OUTPUT_ROOT" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -15280,7 +15362,7 @@ $as_echo "$as_me: The path of OUTPUT_ROOT, which resolves as \"$path\", is inval $as_echo "$as_me: Rewriting OUTPUT_ROOT to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$OUTPUT_ROOT" has_colon=`$ECHO $path | $GREP ^.:` @@ -15321,23 +15403,24 @@ $as_echo "$as_me: Rewriting OUTPUT_ROOT to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$OUTPUT_ROOT" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$OUTPUT_ROOT" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of OUTPUT_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of OUTPUT_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - OUTPUT_ROOT="`cd "$path"; $THEPWDCMD -L`" + OUTPUT_ROOT="`cd "$path"; $THEPWDCMD -L`" + fi fi @@ -15459,7 +15542,10 @@ $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE else FOUND_MAKE=$MAKE_CANDIDATE - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$FOUND_MAKE" != 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. @@ -15573,7 +15659,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -15688,56 +15774,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$FOUND_MAKE" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, 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;} + # 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 FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, 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 FOUND_MAKE" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$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 + # 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 - FOUND_MAKE="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + FOUND_MAKE="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} + fi fi fi @@ -15832,7 +15919,10 @@ $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE else FOUND_MAKE=$MAKE_CANDIDATE - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$FOUND_MAKE" != 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. @@ -15946,7 +16036,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -16061,56 +16151,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$FOUND_MAKE" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, 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;} + # 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 FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, 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 FOUND_MAKE" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$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 + # 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 - FOUND_MAKE="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + FOUND_MAKE="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} + fi fi fi @@ -16202,7 +16293,10 @@ $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE else FOUND_MAKE=$MAKE_CANDIDATE - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$FOUND_MAKE" != 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. @@ -16316,7 +16410,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -16431,56 +16525,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$FOUND_MAKE" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, 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;} + # 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 FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, 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 FOUND_MAKE" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$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 + # 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 - FOUND_MAKE="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + FOUND_MAKE="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} + fi fi fi @@ -16577,7 +16672,10 @@ $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE else FOUND_MAKE=$MAKE_CANDIDATE - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$FOUND_MAKE" != 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. @@ -16691,7 +16789,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -16806,56 +16904,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$FOUND_MAKE" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, 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;} + # 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 FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, 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 FOUND_MAKE" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$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 + # 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 - FOUND_MAKE="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + FOUND_MAKE="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} + fi fi fi @@ -16946,7 +17045,10 @@ $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE else FOUND_MAKE=$MAKE_CANDIDATE - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$FOUND_MAKE" != 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. @@ -17060,7 +17162,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -17175,56 +17277,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$FOUND_MAKE" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of FOUND_MAKE, 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;} + # 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 FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, 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 FOUND_MAKE" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$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 + # 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 - FOUND_MAKE="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + FOUND_MAKE="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} + fi fi fi @@ -18836,202 +18939,6 @@ $as_echo "$tool_specified" >&6; } fi - if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - - - - # Publish this variable in the help. - - - if test "x$COMM" = x; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in comm -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_COMM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $COMM in - [\\/]* | ?:[\\/]*) - ac_cv_path_COMM="$COMM" # 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_COMM="$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 -COMM=$ac_cv_path_COMM -if test -n "$COMM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMM" >&5 -$as_echo "$COMM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$COMM" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !COMM! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!COMM!/} - 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 "xCOMM" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of COMM from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of COMM from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in comm -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_COMM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $COMM in - [\\/]* | ?:[\\/]*) - ac_cv_path_COMM="$COMM" # 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_COMM="$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 -COMM=$ac_cv_path_COMM -if test -n "$COMM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMM" >&5 -$as_echo "$COMM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$COMM" && 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="$COMM" - 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 COMM=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool COMM=$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_COMM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $COMM in - [\\/]* | ?:[\\/]*) - ac_cv_path_COMM="$COMM" # 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_COMM="$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 -COMM=$ac_cv_path_COMM -if test -n "$COMM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMM" >&5 -$as_echo "$COMM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$COMM" = 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 COMM=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool COMM=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for COMM" >&5 -$as_echo_n "checking for COMM... " >&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 COMM=$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 - - - - if test "x$COMM" = x; then - as_fn_error $? "Could not find required tool for COMM" "$LINENO" 5 - fi - - - fi - if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then @@ -19624,6 +19531,32 @@ $as_echo "yes" >&6; } fi + # Test if bash supports pipefail. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if bash supports pipefail" >&5 +$as_echo_n "checking if bash supports pipefail... " >&6; } + if ${BASH} -c 'set -o pipefail'; then + BASH_ARGS="$BASH_ARGS -o pipefail" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if bash supports errexit (-e)" >&5 +$as_echo_n "checking if bash supports errexit (-e)... " >&6; } + if ${BASH} -e -c 'true'; then + BASH_ARGS="$BASH_ARGS -e" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + + + # Check if pkg-config is available. @@ -20234,7 +20167,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -20295,7 +20231,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -20336,23 +20272,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -20559,7 +20496,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -20620,7 +20560,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -20661,23 +20601,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -20746,7 +20687,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -20807,7 +20751,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -20848,23 +20792,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -20926,7 +20871,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -20987,7 +20935,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -21028,23 +20976,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -21105,7 +21054,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -21166,7 +21118,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -21207,23 +21159,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -21284,7 +21237,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -21345,7 +21301,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -21386,23 +21342,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -21454,7 +21411,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -21515,7 +21475,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -21556,23 +21516,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -21599,7 +21560,10 @@ $as_echo "$BOOT_JDK_VERSION" >&6; } if test "x$JAVA_HOME" != x; then JAVA_HOME_PROCESSED="$JAVA_HOME" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$JAVA_HOME_PROCESSED" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -21660,7 +21624,7 @@ $as_echo "$as_me: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", $as_echo "$as_me: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$JAVA_HOME_PROCESSED" has_colon=`$ECHO $path | $GREP ^.:` @@ -21701,23 +21665,24 @@ $as_echo "$as_me: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$JAVA_HOME_PROCESSED" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$JAVA_HOME_PROCESSED" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - JAVA_HOME_PROCESSED="`cd "$path"; $THEPWDCMD -L`" + JAVA_HOME_PROCESSED="`cd "$path"; $THEPWDCMD -L`" + fi fi if test ! -d "$JAVA_HOME_PROCESSED"; then @@ -21765,7 +21730,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -21826,7 +21794,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -21867,23 +21835,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -22086,7 +22055,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -22147,7 +22119,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -22188,23 +22160,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -22294,7 +22267,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -22355,7 +22331,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -22396,23 +22372,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -22467,7 +22444,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -22528,7 +22508,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -22569,23 +22549,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -22668,7 +22649,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -22729,7 +22713,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -22770,23 +22754,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -22841,7 +22826,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -22902,7 +22890,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -22943,23 +22931,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -23042,7 +23031,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -23103,7 +23095,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -23144,23 +23136,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -23215,7 +23208,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -23276,7 +23272,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -23317,23 +23313,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -23416,7 +23413,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -23477,7 +23477,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -23518,23 +23518,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -23589,7 +23590,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -23650,7 +23654,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -23691,23 +23695,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -23777,7 +23782,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -23838,7 +23846,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -23879,23 +23887,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -23948,7 +23957,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -24009,7 +24021,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -24050,23 +24062,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -24137,7 +24150,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -24198,7 +24214,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -24239,23 +24255,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -24308,7 +24325,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -24369,7 +24389,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -24410,23 +24430,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -24496,7 +24517,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -24557,7 +24581,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -24598,23 +24622,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -24667,7 +24692,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -24728,7 +24756,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -24769,23 +24797,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -24856,7 +24885,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -24917,7 +24949,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -24958,23 +24990,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -25027,7 +25060,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -25088,7 +25124,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -25129,23 +25165,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -25197,7 +25234,10 @@ $as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;} # We're done! :-) BOOT_JDK_FOUND=yes - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BOOT_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -25258,7 +25298,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid. $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$BOOT_JDK" has_colon=`$ECHO $path | $GREP ^.:` @@ -25299,23 +25339,24 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$BOOT_JDK" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$BOOT_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + BOOT_JDK="`cd "$path"; $THEPWDCMD -L`" + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -26680,86 +26721,177 @@ $as_echo "no" >&6; } # First-hand choice is to locate and run the vsvars bat file. - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - VCVARSFILE="vc/bin/vcvars32.bat" + +# Check whether --with-toolchain-version was given. +if test "${with_toolchain_version+set}" = set; then : + withval=$with_toolchain_version; +fi + + + if test "x$with_toolchain_version" = xlist; then + # List all toolchains + { $as_echo "$as_me:${as_lineno-$LINENO}: The following toolchain versions are valid on this platform:" >&5 +$as_echo "$as_me: The following toolchain versions are valid on this platform:" >&6;} + for version in $VALID_VS_VERSIONS; do + eval VS_DESCRIPTION=\${VS_DESCRIPTION_$version} + $PRINTF " %-10s %s\n" $version "$VS_DESCRIPTION" + done + + exit 0 + elif test "x$with_toolchain_version" != x; then + # User override; check that it is valid + if test "x${VALID_VS_VERSIONS/$with_toolchain_version/}" = "x${VALID_VS_VERSIONS}"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Visual Studio version $with_toolchain_version is not valid." >&5 +$as_echo "$as_me: Visual Studio version $with_toolchain_version is not valid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Valid Visual Studio versions: $VALID_VS_VERSIONS." >&5 +$as_echo "$as_me: Valid Visual Studio versions: $VALID_VS_VERSIONS." >&6;} + as_fn_error $? "Cannot continue." "$LINENO" 5 + fi + VS_VERSIONS_PROBE_LIST="$with_toolchain_version" else - VCVARSFILE="vc/bin/amd64/vcvars64.bat" + # No flag given, use default + VS_VERSIONS_PROBE_LIST="$VALID_VS_VERSIONS" + fi + + for VS_VERSION in $VS_VERSIONS_PROBE_LIST; do + + VS_VERSION="$VS_VERSION" + eval VS_COMNTOOLS_VAR="\${VS_ENVVAR_${VS_VERSION}}" + eval VS_COMNTOOLS="\$${VS_COMNTOOLS_VAR}" + eval VS_INSTALL_DIR="\${VS_VS_INSTALLDIR_${VS_VERSION}}" + eval SDK_INSTALL_DIR="\${VS_SDK_INSTALLDIR_${VS_VERSION}}" + + # When using --with-tools-dir, assume it points to the correct and default + # version of Visual Studio or that --with-toolchain-version was also set. + if test "x$with_tools_dir" != x; then + + if test "x$VS_ENV_CMD" = x; then + VS_VERSION="${VS_VERSION}" + VS_BASE="$with_tools_dir/../.." + METHOD="--with-tools-dir" + + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VCVARSFILE="vc/bin/vcvars32.bat" + else + VCVARSFILE="vc/bin/amd64/vcvars64.bat" + fi + + + windows_path="$VS_BASE" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + VS_BASE="$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'` + VS_BASE="$unix_path" + fi + + if test -d "$VS_BASE"; then + if test -f "$VS_BASE/$VCVARSFILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} + VS_ENV_CMD="$VS_BASE/$VCVARSFILE" + # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see + # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 + eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 +$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} + fi + fi + fi + + + if test "x$VS_ENV_CMD" = x; then + VS_VERSION="${VS_VERSION}" + VS_BASE="$with_tools_dir/../../.." + METHOD="--with-tools-dir" + + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VCVARSFILE="vc/bin/vcvars32.bat" + else + VCVARSFILE="vc/bin/amd64/vcvars64.bat" + fi + + + windows_path="$VS_BASE" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + VS_BASE="$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'` + VS_BASE="$unix_path" + fi + + if test -d "$VS_BASE"; then + if test -f "$VS_BASE/$VCVARSFILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} + VS_ENV_CMD="$VS_BASE/$VCVARSFILE" + # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see + # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 + eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 +$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} + fi + fi + fi + + if test "x$VS_ENV_CMD" = x; then + # Having specified an argument which is incorrect will produce an instant failure; + # we should not go on looking + { $as_echo "$as_me:${as_lineno-$LINENO}: The path given by --with-tools-dir does not contain a valid" >&5 +$as_echo "$as_me: The path given by --with-tools-dir does not contain a valid" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Visual Studio installation. Please point to the VC/bin or VC/bin/amd64" >&5 +$as_echo "$as_me: Visual Studio installation. Please point to the VC/bin or VC/bin/amd64" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: directory within the Visual Studio installation" >&5 +$as_echo "$as_me: directory within the Visual Studio installation" >&6;} + as_fn_error $? "Cannot locate a valid Visual Studio installation" "$LINENO" 5 + fi fi VS_ENV_CMD="" VS_ENV_ARGS="" - if test "x$with_toolsdir" != x; then + + if test "x$VS_COMNTOOLS" != x; then if test "x$VS_ENV_CMD" = x; then - VS100BASE="$with_toolsdir/../.." - METHOD="--with-tools-dir" + VS_VERSION="${VS_VERSION}" + VS_BASE="$VS_COMNTOOLS/../.." + METHOD="$VS_COMNTOOLS_VAR variable" - windows_path="$VS100BASE" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - VS100BASE="$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'` - VS100BASE="$unix_path" - fi - - if test -d "$VS100BASE"; then - if test -f "$VS100BASE/$VCVARSFILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} - VS_ENV_CMD="$VS100BASE/$VCVARSFILE" - # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see - # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 - # TODO: improve detection for other versions of VS - PLATFORM_TOOLSET="v100" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 -$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} - fi + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VCVARSFILE="vc/bin/vcvars32.bat" + else + VCVARSFILE="vc/bin/amd64/vcvars64.bat" fi - fi - fi - if test "x$with_toolsdir" != x && test "x$VS_ENV_CMD" = x; then - # Having specified an argument which is incorrect will produce an instant failure; - # we should not go on looking - { $as_echo "$as_me:${as_lineno-$LINENO}: The path given by --with-tools-dir does not contain a valid Visual Studio installation" >&5 -$as_echo "$as_me: The path given by --with-tools-dir does not contain a valid Visual Studio installation" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Please point to the VC/bin directory within the Visual Studio installation" >&5 -$as_echo "$as_me: Please point to the VC/bin directory within the Visual Studio installation" >&6;} - as_fn_error $? "Cannot locate a valid Visual Studio installation" "$LINENO" 5 - fi - - if test "x$VS100COMNTOOLS" != x; then - - if test "x$VS_ENV_CMD" = x; then - VS100BASE="$VS100COMNTOOLS/../.." - METHOD="VS100COMNTOOLS variable" - - windows_path="$VS100BASE" + windows_path="$VS_BASE" if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then unix_path=`$CYGPATH -u "$windows_path"` - VS100BASE="$unix_path" + VS_BASE="$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'` - VS100BASE="$unix_path" + VS_BASE="$unix_path" fi - if test -d "$VS100BASE"; then - if test -f "$VS100BASE/$VCVARSFILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} - VS_ENV_CMD="$VS100BASE/$VCVARSFILE" + if test -d "$VS_BASE"; then + if test -f "$VS_BASE/$VCVARSFILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} + VS_ENV_CMD="$VS_BASE/$VCVARSFILE" # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 - # TODO: improve detection for other versions of VS - PLATFORM_TOOLSET="v100" + eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} fi @@ -26770,30 +26902,80 @@ $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studi if test "x$PROGRAMFILES" != x; then if test "x$VS_ENV_CMD" = x; then - VS100BASE="$PROGRAMFILES/Microsoft Visual Studio 10.0" + VS_VERSION="${VS_VERSION}" + VS_BASE="$PROGRAMFILES/$VS_INSTALL_DIR" METHOD="well-known name" - windows_path="$VS100BASE" + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VCVARSFILE="vc/bin/vcvars32.bat" + else + VCVARSFILE="vc/bin/amd64/vcvars64.bat" + fi + + + windows_path="$VS_BASE" if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then unix_path=`$CYGPATH -u "$windows_path"` - VS100BASE="$unix_path" + VS_BASE="$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'` - VS100BASE="$unix_path" + VS_BASE="$unix_path" fi - if test -d "$VS100BASE"; then - if test -f "$VS100BASE/$VCVARSFILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} - VS_ENV_CMD="$VS100BASE/$VCVARSFILE" + if test -d "$VS_BASE"; then + if test -f "$VS_BASE/$VCVARSFILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} + VS_ENV_CMD="$VS_BASE/$VCVARSFILE" # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 - # TODO: improve detection for other versions of VS - PLATFORM_TOOLSET="v100" + eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 +$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} + fi + fi + fi + + fi + # Work around the insanely named ProgramFiles(x86) env variable + PROGRAMFILES_X86="`env | $SED -n 's/^ProgramFiles(x86)=//p'`" + if test "x$PROGRAMFILES_X86" != x; then + + if test "x$VS_ENV_CMD" = x; then + VS_VERSION="${VS_VERSION}" + VS_BASE="$PROGRAMFILES_X86/$VS_INSTALL_DIR" + METHOD="well-known name" + + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VCVARSFILE="vc/bin/vcvars32.bat" + else + VCVARSFILE="vc/bin/amd64/vcvars64.bat" + fi + + + windows_path="$VS_BASE" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + VS_BASE="$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'` + VS_BASE="$unix_path" + fi + + if test -d "$VS_BASE"; then + if test -f "$VS_BASE/$VCVARSFILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} + VS_ENV_CMD="$VS_BASE/$VCVARSFILE" + # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see + # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 + eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} fi @@ -26803,30 +26985,37 @@ $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studi fi if test "x$VS_ENV_CMD" = x; then - VS100BASE="C:/Program Files/Microsoft Visual Studio 10.0" + VS_VERSION="${VS_VERSION}" + VS_BASE="C:/Program Files/$VS_INSTALL_DIR" METHOD="well-known name" - windows_path="$VS100BASE" + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VCVARSFILE="vc/bin/vcvars32.bat" + else + VCVARSFILE="vc/bin/amd64/vcvars64.bat" + fi + + + windows_path="$VS_BASE" if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then unix_path=`$CYGPATH -u "$windows_path"` - VS100BASE="$unix_path" + VS_BASE="$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'` - VS100BASE="$unix_path" + VS_BASE="$unix_path" fi - if test -d "$VS100BASE"; then - if test -f "$VS100BASE/$VCVARSFILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} - VS_ENV_CMD="$VS100BASE/$VCVARSFILE" + if test -d "$VS_BASE"; then + if test -f "$VS_BASE/$VCVARSFILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} + VS_ENV_CMD="$VS_BASE/$VCVARSFILE" # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 - # TODO: improve detection for other versions of VS - PLATFORM_TOOLSET="v100" + eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} fi @@ -26835,30 +27024,37 @@ $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studi if test "x$VS_ENV_CMD" = x; then - VS100BASE="C:/Program Files (x86)/Microsoft Visual Studio 10.0" + VS_VERSION="${VS_VERSION}" + VS_BASE="C:/Program Files (x86)/$VS_INSTALL_DIR" METHOD="well-known name" - windows_path="$VS100BASE" + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VCVARSFILE="vc/bin/vcvars32.bat" + else + VCVARSFILE="vc/bin/amd64/vcvars64.bat" + fi + + + windows_path="$VS_BASE" if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then unix_path=`$CYGPATH -u "$windows_path"` - VS100BASE="$unix_path" + VS_BASE="$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'` - VS100BASE="$unix_path" + VS_BASE="$unix_path" fi - if test -d "$VS100BASE"; then - if test -f "$VS100BASE/$VCVARSFILE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} - VS_ENV_CMD="$VS100BASE/$VCVARSFILE" + if test -d "$VS_BASE"; then + if test -f "$VS_BASE/$VCVARSFILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} + VS_ENV_CMD="$VS_BASE/$VCVARSFILE" # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 - # TODO: improve detection for other versions of VS - PLATFORM_TOOLSET="v100" + eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} fi @@ -26866,10 +27062,12 @@ $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studi fi - if test "x$ProgramW6432" != x; then + if test "x$SDK_INSTALL_DIR" != x; then + if test "x$ProgramW6432" != x; then if test "x$VS_ENV_CMD" = x; then - WIN_SDK_BASE="$ProgramW6432/Microsoft SDKs/Windows/v7.1/Bin" + VS_VERSION="${VS_VERSION}" + WIN_SDK_BASE="$ProgramW6432/$SDK_INSTALL_DIR" METHOD="well-known name" windows_path="$WIN_SDK_BASE" @@ -26884,15 +27082,15 @@ $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studi if test -d "$WIN_SDK_BASE"; then # There have been cases of partial or broken SDK installations. A missing # lib dir is not going to work. - if test ! -d "$WIN_SDK_BASE/../lib"; then + if test ! -d "$WIN_SDK_BASE/lib"; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5 $as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;} - elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then + elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd" + VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd" if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then VS_ENV_ARGS="/x86" else @@ -26901,7 +27099,7 @@ $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK # TODO: improve detection for other versions of SDK - PLATFORM_TOOLSET="Windows7.1SDK" + eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}" else { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} @@ -26911,11 +27109,12 @@ $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignori fi fi - fi - if test "x$PROGRAMW6432" != x; then + fi + if test "x$PROGRAMW6432" != x; then if test "x$VS_ENV_CMD" = x; then - WIN_SDK_BASE="$PROGRAMW6432/Microsoft SDKs/Windows/v7.1/Bin" + VS_VERSION="${VS_VERSION}" + WIN_SDK_BASE="$PROGRAMW6432/$SDK_INSTALL_DIR" METHOD="well-known name" windows_path="$WIN_SDK_BASE" @@ -26930,15 +27129,15 @@ $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignori if test -d "$WIN_SDK_BASE"; then # There have been cases of partial or broken SDK installations. A missing # lib dir is not going to work. - if test ! -d "$WIN_SDK_BASE/../lib"; then + if test ! -d "$WIN_SDK_BASE/lib"; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5 $as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;} - elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then + elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd" + VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd" if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then VS_ENV_ARGS="/x86" else @@ -26947,7 +27146,7 @@ $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK # TODO: improve detection for other versions of SDK - PLATFORM_TOOLSET="Windows7.1SDK" + eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}" else { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} @@ -26957,11 +27156,12 @@ $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignori fi fi - fi - if test "x$PROGRAMFILES" != x; then + fi + if test "x$PROGRAMFILES" != x; then if test "x$VS_ENV_CMD" = x; then - WIN_SDK_BASE="$PROGRAMFILES/Microsoft SDKs/Windows/v7.1/Bin" + VS_VERSION="${VS_VERSION}" + WIN_SDK_BASE="$PROGRAMFILES/$SDK_INSTALL_DIR" METHOD="well-known name" windows_path="$WIN_SDK_BASE" @@ -26976,15 +27176,15 @@ $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignori if test -d "$WIN_SDK_BASE"; then # There have been cases of partial or broken SDK installations. A missing # lib dir is not going to work. - if test ! -d "$WIN_SDK_BASE/../lib"; then + if test ! -d "$WIN_SDK_BASE/lib"; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5 $as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;} - elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then + elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd" + VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd" if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then VS_ENV_ARGS="/x86" else @@ -26993,7 +27193,7 @@ $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK # TODO: improve detection for other versions of SDK - PLATFORM_TOOLSET="Windows7.1SDK" + eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}" else { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} @@ -27003,10 +27203,11 @@ $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignori fi fi - fi + fi if test "x$VS_ENV_CMD" = x; then - WIN_SDK_BASE="C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin" + VS_VERSION="${VS_VERSION}" + WIN_SDK_BASE="C:/Program Files/$SDK_INSTALL_DIR" METHOD="well-known name" windows_path="$WIN_SDK_BASE" @@ -27021,15 +27222,15 @@ $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignori if test -d "$WIN_SDK_BASE"; then # There have been cases of partial or broken SDK installations. A missing # lib dir is not going to work. - if test ! -d "$WIN_SDK_BASE/../lib"; then + if test ! -d "$WIN_SDK_BASE/lib"; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5 $as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;} - elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then + elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd" + VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd" if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then VS_ENV_ARGS="/x86" else @@ -27038,7 +27239,7 @@ $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK # TODO: improve detection for other versions of SDK - PLATFORM_TOOLSET="Windows7.1SDK" + eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}" else { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} @@ -27050,7 +27251,8 @@ $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignori if test "x$VS_ENV_CMD" = x; then - WIN_SDK_BASE="C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1/Bin" + VS_VERSION="${VS_VERSION}" + WIN_SDK_BASE="C:/Program Files (x86)/$SDK_INSTALL_DIR" METHOD="well-known name" windows_path="$WIN_SDK_BASE" @@ -27065,15 +27267,15 @@ $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignori if test -d "$WIN_SDK_BASE"; then # There have been cases of partial or broken SDK installations. A missing # lib dir is not going to work. - if test ! -d "$WIN_SDK_BASE/../lib"; then + if test ! -d "$WIN_SDK_BASE/lib"; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5 $as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;} - elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then + elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} - VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd" + VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd" if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then VS_ENV_ARGS="/x86" else @@ -27082,7 +27284,7 @@ $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK # TODO: improve detection for other versions of SDK - PLATFORM_TOOLSET="Windows7.1SDK" + eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}" else { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} @@ -27092,11 +27294,29 @@ $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignori fi fi + fi + + if test "x$VS_ENV_CMD" != x; then + TOOLCHAIN_VERSION=$VS_VERSION + eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}" + eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}" + eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}" + eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}" + # The rest of the variables are already evaled while probing + { $as_echo "$as_me:${as_lineno-$LINENO}: Found $VS_DESCRIPTION" >&5 +$as_echo "$as_me: Found $VS_DESCRIPTION" >&6;} + break + fi + done + if test "x$VS_ENV_CMD" != x; then # We have found a Visual Studio environment on disk, let's extract variables from the vsvars bat file. - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$VS_ENV_CMD" != 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. @@ -27210,7 +27430,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -27325,56 +27545,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$VS_ENV_CMD" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$VS_ENV_CMD" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of VS_ENV_CMD, 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;} + # 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 VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of VS_ENV_CMD, 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 VS_ENV_CMD" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$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 + # 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 - VS_ENV_CMD="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting VS_ENV_CMD to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + VS_ENV_CMD="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting VS_ENV_CMD to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting VS_ENV_CMD to \"$new_complete\"" >&6;} + fi fi @@ -27471,9 +27692,9 @@ $as_echo "present but broken" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } - # Remove any trailing "\" and " " from the variables. - VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED 's/\\\\* *$//'` - VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\* *$//'` + # Remove any trailing "\" ";" and " " from the variables. + VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED -e 's/\\\\*;* *$//'` + VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\*;* *$//'` VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'` WindowsSDKDir=`$ECHO "$WindowsSDKDir" | $SED 's/\\\\* *$//'` WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'` @@ -27484,6 +27705,310 @@ $as_echo "ok" >&6; } + + # Convert VS_INCLUDE into SYSROOT_CFLAGS + OLDIFS="$IFS" + IFS=";" + for i in $VS_INCLUDE; do + ipath=$i + # Only process non-empty elements + if test "x$ipath" != x; then + IFS="$OLDIFS" + # Check that directory exists before calling fixup_path + testpath=$ipath + + windows_path="$testpath" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + testpath="$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'` + testpath="$unix_path" + fi + + if test -d "$testpath"; then + + # Only process if variable expands to non-empty + + if test "x$ipath" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$ipath" + new_path=`$CYGPATH -u "$path"` + + # 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 precense. + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of ipath, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of ipath, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of ipath" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $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 \) + 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-stile (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 $new_path | $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 + + + if test "x$path" != "x$new_path"; then + ipath="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting ipath to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting ipath to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$ipath" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + 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 + + + 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 + + if test "x$path" != "x$new_path"; then + ipath="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting ipath to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting ipath to \"$new_path\"" >&6;} + fi + + # 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}") + + else + # We're on a unix platform. Hooray! :) + path="$ipath" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of ipath, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of ipath, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of ipath, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + ipath="`cd "$path"; $THEPWDCMD -L`" + fi + fi + + SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath" + fi + IFS=";" + fi + done + # Convert VS_LIB into SYSROOT_LDFLAGS + for i in $VS_LIB; do + libpath=$i + # Only process non-empty elements + if test "x$libpath" != x; then + IFS="$OLDIFS" + # Check that directory exists before calling fixup_path + testpath=$libpath + + windows_path="$testpath" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + testpath="$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'` + testpath="$unix_path" + fi + + if test -d "$testpath"; then + + # Only process if variable expands to non-empty + + if test "x$libpath" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$libpath" + new_path=`$CYGPATH -u "$path"` + + # 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 precense. + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of libpath, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of libpath, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of libpath" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $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 \) + 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-stile (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 $new_path | $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 + + + if test "x$path" != "x$new_path"; then + libpath="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting libpath to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting libpath to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$libpath" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + 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 + + + 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 + + if test "x$path" != "x$new_path"; then + libpath="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting libpath to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting libpath to \"$new_path\"" >&6;} + fi + + # 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}") + + else + # We're on a unix platform. Hooray! :) + path="$libpath" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of libpath, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of libpath, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of libpath, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + libpath="`cd "$path"; $THEPWDCMD -L`" + fi + fi + + SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath" + fi + IFS=";" + fi + done + IFS="$OLDIFS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 @@ -27756,7 +28281,10 @@ done # Now we have a compiler binary in CC. Make sure it's okay. - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$CC" != 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. @@ -27870,7 +28398,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -27985,56 +28513,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$CC" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$CC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CC, 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;} + # 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 CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CC, 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 CC" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of CC" "$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 + # 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 - CC="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CC to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + CC="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CC to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting CC to \"$new_complete\"" >&6;} + fi fi TEST_COMPILER="$CC" @@ -28213,7 +28742,10 @@ esac fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$PROPER_COMPILER_CC" != 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. @@ -28327,7 +28859,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -28442,56 +28974,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$PROPER_COMPILER_CC" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$PROPER_COMPILER_CC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of PROPER_COMPILER_CC, 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;} + # 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 PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CC, 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 PROPER_COMPILER_CC" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$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 + # 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 - PROPER_COMPILER_CC="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + PROPER_COMPILER_CC="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&6;} + fi fi PATH="$RETRY_COMPILER_SAVED_PATH" @@ -29496,7 +30029,10 @@ done # Now we have a compiler binary in CXX. Make sure it's okay. - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$CXX" != 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. @@ -29610,7 +30146,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -29725,56 +30261,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$CXX" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$CXX" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CXX, 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;} + # 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 CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CXX, 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 CXX" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of CXX" "$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 + # 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 - CXX="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXX to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + CXX="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXX to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting CXX to \"$new_complete\"" >&6;} + fi fi TEST_COMPILER="$CXX" @@ -29953,7 +30490,10 @@ esac fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$PROPER_COMPILER_CXX" != 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. @@ -30067,7 +30607,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -30182,56 +30722,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$PROPER_COMPILER_CXX" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$PROPER_COMPILER_CXX" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of PROPER_COMPILER_CXX, 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;} + # 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 PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CXX, 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 PROPER_COMPILER_CXX" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$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 + # 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 - PROPER_COMPILER_CXX="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + PROPER_COMPILER_CXX="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&6;} + fi fi PATH="$RETRY_COMPILER_SAVED_PATH" @@ -30815,7 +31356,10 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$CPP" != 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. @@ -30929,7 +31473,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -31044,56 +31588,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$CPP" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$CPP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CPP, 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;} + # 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 CPP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CPP, 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 CPP" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of CPP" "$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 + # 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 - CPP="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CPP to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + CPP="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CPP to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting CPP to \"$new_complete\"" >&6;} + fi fi ac_ext=cpp @@ -31230,7 +31775,10 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$CXXCPP" != 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. @@ -31344,7 +31892,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -31459,56 +32007,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$CXXCPP" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$CXXCPP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CXXCPP, 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;} + # 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 CXXCPP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CXXCPP, 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 CXXCPP" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of CXXCPP" "$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 + # 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 - CXXCPP="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXXCPP to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + CXXCPP="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXXCPP to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting CXXCPP to \"$new_complete\"" >&6;} + fi fi @@ -31574,7 +32123,10 @@ fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$LD" != 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. @@ -31688,7 +32240,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -31803,56 +32355,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$LD" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$LD" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LD, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of LD, 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;} + # 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 LD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of LD, 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 LD" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of LD" "$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 + # 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 - LD="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LD to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + LD="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LD to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting LD to \"$new_complete\"" >&6;} + fi fi # Verify that we indeed succeeded with this trick. @@ -32069,7 +32622,10 @@ $as_echo "$tool_specified" >&6; } - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$AS" != 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. @@ -32183,7 +32739,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -32298,56 +32854,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$AS" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$AS" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of AS, 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;} + # 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 AS, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of AS, 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 AS" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of AS" "$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 + # 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 - AS="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AS to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + AS="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AS to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting AS to \"$new_complete\"" >&6;} + fi fi else @@ -32697,7 +33254,10 @@ $as_echo "$tool_specified" >&6; } fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$AR" != 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. @@ -32811,7 +33371,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -32926,56 +33486,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$AR" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$AR" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of AR, 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;} + # 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 AR, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of AR, 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 AR" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of AR" "$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 + # 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 - AR="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AR to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + AR="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AR to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting AR to \"$new_complete\"" >&6;} + fi fi @@ -33233,7 +33794,10 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$OBJC" != 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. @@ -33347,7 +33911,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -33462,56 +34026,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$OBJC" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$OBJC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OBJC, 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;} + # 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 OBJC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJC, 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 OBJC" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of OBJC" "$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 + # 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 - OBJC="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJC to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + OBJC="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJC to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting OBJC to \"$new_complete\"" >&6;} + fi fi @@ -33701,7 +34266,10 @@ $as_echo "$tool_specified" >&6; } - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$LIPO" != 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. @@ -33815,7 +34383,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -33930,56 +34498,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$LIPO" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$LIPO" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of LIPO, 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;} + # 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 LIPO, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of LIPO, 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 LIPO" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of LIPO" "$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 + # 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 - LIPO="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LIPO to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + LIPO="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LIPO to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting LIPO to \"$new_complete\"" >&6;} + fi fi else @@ -34042,7 +34611,10 @@ fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$MT" != 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. @@ -34156,7 +34728,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -34271,56 +34843,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$MT" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$MT" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of MT, 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;} + # 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 MT, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of MT, 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 MT" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of MT" "$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 + # 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 - MT="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MT to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + MT="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MT to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting MT to \"$new_complete\"" >&6;} + fi fi # Setup the resource compiler (RC) @@ -34379,7 +34952,10 @@ fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$RC" != 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. @@ -34493,7 +35069,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -34608,56 +35184,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$RC" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$RC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of RC, 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;} + # 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 RC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of RC, 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 RC" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of RC" "$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 + # 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 - RC="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting RC to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + RC="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting RC to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting RC to \"$new_complete\"" >&6;} + fi fi # Extract the first word of "dumpbin", so it can be a program name with args. @@ -34698,7 +35275,10 @@ fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$DUMPBIN" != 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. @@ -34812,7 +35392,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -34927,56 +35507,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$DUMPBIN" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$DUMPBIN" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of DUMPBIN, 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;} + # 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 DUMPBIN, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of DUMPBIN, 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 DUMPBIN" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of DUMPBIN" "$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 + # 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 - DUMPBIN="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DUMPBIN to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + DUMPBIN="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DUMPBIN to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting DUMPBIN to \"$new_complete\"" >&6;} + fi fi # We need to check for 'msbuild.exe' because at the place where we expect to @@ -35213,7 +35794,10 @@ $as_echo "$tool_specified" >&6; } - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$STRIP" != 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. @@ -35327,7 +35911,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -35442,56 +36026,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$STRIP" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$STRIP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of STRIP, 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;} + # 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 STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of STRIP, 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 STRIP" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of STRIP" "$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 + # 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 - STRIP="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + STRIP="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;} + fi fi @@ -35681,7 +36266,10 @@ $as_echo "$tool_specified" >&6; } - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$NM" != 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. @@ -35795,7 +36383,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -35910,56 +36498,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$NM" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$NM" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of NM, 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;} + # 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 NM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of NM, 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 NM" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of NM" "$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 + # 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 - NM="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + NM="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;} + fi fi @@ -36149,7 +36738,10 @@ $as_echo "$tool_specified" >&6; } - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$GNM" != 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. @@ -36263,7 +36855,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -36378,56 +36970,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$GNM" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$GNM" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of GNM, 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;} + # 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 GNM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of GNM, 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 GNM" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of GNM" "$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 + # 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 - GNM="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting GNM to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + GNM="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting GNM to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting GNM to \"$new_complete\"" >&6;} + fi fi @@ -36618,7 +37211,10 @@ $as_echo "$tool_specified" >&6; } - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # 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. @@ -36732,7 +37328,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -36847,56 +37443,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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 + # 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#* }" - 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;} + # 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 - 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 + # 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 + 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 @@ -37198,7 +37795,10 @@ $as_echo "$tool_specified" >&6; } - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$STRIP" != 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. @@ -37312,7 +37912,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -37427,56 +38027,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$STRIP" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$STRIP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of STRIP, 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;} + # 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 STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of STRIP, 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 STRIP" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of STRIP" "$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 + # 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 - STRIP="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + STRIP="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;} + fi fi @@ -37776,7 +38377,10 @@ $as_echo "$tool_specified" >&6; } - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$NM" != 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. @@ -37890,7 +38494,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -38005,56 +38609,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$NM" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$NM" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of NM, 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;} + # 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 NM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of NM, 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 NM" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of NM" "$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 + # 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 - NM="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + NM="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;} + fi fi GNM="$NM" @@ -38363,7 +38968,10 @@ $as_echo "$tool_specified" >&6; } # Only call fixup if objcopy was found. if test -n "$OBJCOPY"; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$OBJCOPY" != 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. @@ -38477,7 +39085,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -38592,56 +39200,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$OBJCOPY" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$OBJCOPY" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OBJCOPY, 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;} + # 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 OBJCOPY, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJCOPY, 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 OBJCOPY" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of OBJCOPY" "$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 + # 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 - OBJCOPY="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJCOPY to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + OBJCOPY="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJCOPY to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting OBJCOPY to \"$new_complete\"" >&6;} + fi fi fi @@ -38947,7 +39556,10 @@ $as_echo "$tool_specified" >&6; } # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE # bails if argument is missing. - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$OBJDUMP" != 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. @@ -39061,7 +39673,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -39176,56 +39788,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$OBJDUMP" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$OBJDUMP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OBJDUMP, 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;} + # 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 OBJDUMP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJDUMP, 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 OBJDUMP" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of OBJDUMP" "$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 + # 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 - OBJDUMP="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJDUMP to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + OBJDUMP="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJDUMP to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting OBJDUMP to \"$new_complete\"" >&6;} + fi fi fi @@ -39440,7 +40053,10 @@ $as_echo "$tool_specified" >&6; } - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BUILD_CC" != 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. @@ -39554,7 +40170,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -39669,56 +40285,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$BUILD_CC" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_CC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_CC, 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;} + # 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 BUILD_CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_CC, 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 BUILD_CC" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of BUILD_CC" "$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 + # 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 - BUILD_CC="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CC to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + BUILD_CC="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CC to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting BUILD_CC to \"$new_complete\"" >&6;} + fi fi @@ -39908,7 +40525,10 @@ $as_echo "$tool_specified" >&6; } - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BUILD_CXX" != 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. @@ -40022,7 +40642,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -40137,56 +40757,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$BUILD_CXX" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_CXX" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_CXX, 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;} + # 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 BUILD_CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_CXX, 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 BUILD_CXX" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$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 + # 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 - BUILD_CXX="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CXX to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + BUILD_CXX="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CXX to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting BUILD_CXX to \"$new_complete\"" >&6;} + fi fi @@ -40376,7 +40997,10 @@ $as_echo "$tool_specified" >&6; } - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$BUILD_LD" != 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. @@ -40490,7 +41114,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # remove trailing .exe if any new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # First separate the path from the arguments. This will split at the first # space. @@ -40605,56 +41229,57 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh 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="$BUILD_LD" - 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 + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_LD" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_LD, 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;} + # 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 BUILD_LD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_LD, 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 BUILD_LD" "$LINENO" 5 fi - as_fn_error $? "Cannot locate the the path of BUILD_LD" "$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 + # 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 - BUILD_LD="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_LD to \"$new_complete\"" >&5 + if test "x$complete" != "x$new_complete"; then + BUILD_LD="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_LD to \"$new_complete\"" >&5 $as_echo "$as_me: Rewriting BUILD_LD to \"$new_complete\"" >&6;} + fi fi else @@ -40752,8 +41377,8 @@ $as_echo "$as_me: Rewriting BUILD_LD to \"$new_complete\"" >&6;} CC_VERSION_OUTPUT=`$CC 2>&1 | $HEAD -n 1 | $TR -d '\r'` COMPILER_CPU_TEST=`$ECHO $CC_VERSION_OUTPUT | $SED -n "s/^.* \(.*\)$/\1/p"` if test "x$OPENJDK_TARGET_CPU" = "xx86"; then - if test "x$COMPILER_CPU_TEST" != "x80x86"; then - as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\"." "$LINENO" 5 + if test "x$COMPILER_CPU_TEST" != "x80x86" -a "x$COMPILER_CPU_TEST" != "xx86"; then + as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\" or \"x86\"." "$LINENO" 5 fi elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then if test "x$COMPILER_CPU_TEST" != "xx64"; then @@ -40987,7 +41612,10 @@ $as_echo_n "checking for jtreg... " >&6; } # use JT_HOME enviroment var. - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$JT_HOME" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -41048,7 +41676,7 @@ $as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." $as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$JT_HOME" has_colon=`$ECHO $path | $GREP ^.:` @@ -41089,23 +41717,24 @@ $as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$JT_HOME" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$JT_HOME" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of JT_HOME, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of JT_HOME, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - JT_HOME="`cd "$path"; $THEPWDCMD -L`" + JT_HOME="`cd "$path"; $THEPWDCMD -L`" + fi fi @@ -42401,15 +43030,23 @@ fi CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \ - -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \ - -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ - -DWIN32 -DIAL" + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK \ + -Zi -MD -Zc:wchar_t- -W3 -wd4800 \ + -DWIN32_LEAN_AND_MEAN \ + -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ + -DWIN32 -DIAL" if test "x$OPENJDK_TARGET_CPU" = xx86_64; then COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64" else COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86" fi + # If building with Visual Studio 2010, we can still use _STATIC_CPPLIB to + # avoid bundling msvcpNNN.dll. Doesn't work with newer versions of visual + # studio. + if test "x$TOOLCHAIN_VERSION" = "x2010"; then + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \ + -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB" + fi fi ############################################################################### @@ -44370,7 +45007,10 @@ $as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} if test "x$FOUND_FREETYPE" = xyes; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -44431,7 +45071,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_INCLUDE_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -44472,27 +45112,31 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >& # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -44553,7 +45197,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_LIB_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -44594,23 +45238,24 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi @@ -44723,7 +45368,10 @@ $as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} if test "x$FOUND_FREETYPE" = xyes; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -44784,7 +45432,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_INCLUDE_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -44825,27 +45473,31 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >& # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -44906,7 +45558,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_LIB_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -44947,23 +45599,24 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi @@ -45337,7 +45990,10 @@ $as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} if test "x$FOUND_FREETYPE" = xyes; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -45398,7 +46054,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_INCLUDE_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -45439,27 +46095,31 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >& # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -45520,7 +46180,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_LIB_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -45561,23 +46221,24 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi @@ -45665,7 +46326,10 @@ $as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} if test "x$FOUND_FREETYPE" = xyes; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -45726,7 +46390,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_INCLUDE_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -45767,27 +46431,31 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >& # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -45848,7 +46516,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_LIB_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -45889,23 +46557,24 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi @@ -45984,7 +46653,10 @@ $as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} if test "x$FOUND_FREETYPE" = xyes; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -46045,7 +46717,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_INCLUDE_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -46086,27 +46758,31 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >& # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -46167,7 +46843,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_LIB_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -46208,23 +46884,24 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi @@ -46303,7 +46980,10 @@ $as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} if test "x$FOUND_FREETYPE" = xyes; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -46364,7 +47044,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_INCLUDE_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -46405,27 +47085,31 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >& # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -46486,7 +47170,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_LIB_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -46527,23 +47211,24 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi @@ -46623,7 +47308,10 @@ $as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} if test "x$FOUND_FREETYPE" = xyes; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -46684,7 +47372,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_INCLUDE_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -46725,27 +47413,31 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >& # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -46806,7 +47498,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_LIB_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -46847,23 +47539,24 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi @@ -46944,7 +47637,10 @@ $as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} if test "x$FOUND_FREETYPE" = xyes; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -47005,7 +47701,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_INCLUDE_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -47046,27 +47742,31 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >& # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -47127,7 +47827,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_LIB_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -47168,23 +47868,24 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi @@ -47261,7 +47962,10 @@ $as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} if test "x$FOUND_FREETYPE" = xyes; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -47322,7 +48026,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_INCLUDE_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -47363,27 +48067,31 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >& # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -47444,7 +48152,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_LIB_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -47485,23 +48193,24 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi @@ -47578,7 +48287,10 @@ $as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} if test "x$FOUND_FREETYPE" = xyes; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -47639,7 +48351,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_INCLUDE_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -47680,27 +48392,31 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >& # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -47761,7 +48477,7 @@ $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$POTENTIAL_FREETYPE_LIB_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -47802,23 +48518,24 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$POTENTIAL_FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi @@ -47878,7 +48595,10 @@ $as_echo "$FREETYPE_LIB_PATH" >&6; } # Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir. if test "x$FREETYPE_CFLAGS" = x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$FREETYPE_INCLUDE_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -47939,7 +48659,7 @@ $as_echo "$as_me: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\" $as_echo "$as_me: Rewriting FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$FREETYPE_INCLUDE_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -47980,23 +48700,24 @@ $as_echo "$as_me: Rewriting FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$FREETYPE_INCLUDE_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype; then @@ -48008,7 +48729,10 @@ $as_echo "$as_me: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\" if test "x$FREETYPE_LIBS" = x; then - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$FREETYPE_LIB_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -48069,7 +48793,7 @@ $as_echo "$as_me: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is $as_echo "$as_me: Rewriting FREETYPE_LIB_PATH to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$FREETYPE_LIB_PATH" has_colon=`$ECHO $path | $GREP ^.:` @@ -48110,23 +48834,24 @@ $as_echo "$as_me: Rewriting FREETYPE_LIB_PATH to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$FREETYPE_LIB_PATH" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi fi if test "x$OPENJDK_TARGET_OS" = xwindows; then @@ -49560,16 +50285,17 @@ fi if test "x$with_msvcr_dll" != x; then # If given explicitely by user, do not probe. If not present, fail directly. - POSSIBLE_MSVCR_DLL="$with_msvcr_dll" + DLL_NAME="$DLL_NAME" + POSSIBLE_MSVC_DLL="$with_msvcr_dll" METHOD="--with-msvcr-dll" - if test -e "$POSSIBLE_MSVCR_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; } - MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; } + MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. @@ -49585,28 +50311,32 @@ $as_echo_n "checking found msvcr100.dll architecture... " >&6; } CORRECT_MSVCR_ARCH=x86-64 fi fi - if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then + if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } - MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 -$as_echo "$MSVCR_DLL" >&6; } + MSVC_DLL="$POSSIBLE_MSVC_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 +$as_echo_n "checking for $DLL_NAME... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 +$as_echo "$MSVC_DLL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 $as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} fi fi - if test "x$MSVCR_DLL" = x; then - as_fn_error $? "Could not find a proper msvcr100.dll as specified by --with-msvcr-dll" "$LINENO" 5 + if test "x$MSVC_DLL" = x; then + as_fn_error $? "Could not find a proper $MSVCR_NAME as specified by --with-msvcr-dll" "$LINENO" 5 fi - fi + else - if test "x$MSVCR_DLL" = x; then + VAR_NAME="MSVCR_DLL" + DLL_NAME="${MSVCR_NAME}" + MSVC_DLL= + + if test "x$MSVC_DLL" = x; then # Probe: Using well-known location from Visual Studio 10.0 if test "x$VCINSTALLDIR" != x; then CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR" @@ -49621,21 +50351,23 @@ $as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETY fi if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC100.CRT/msvcr100.dll" + POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" else - POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC100.CRT/msvcr100.dll" + POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" fi + $ECHO "POSSIBLE_MSVC_DLL $POSSIBLEMSVC_DLL" - POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + DLL_NAME="$DLL_NAME" + POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" METHOD="well-known location in VCINSTALLDIR" - if test -e "$POSSIBLE_MSVCR_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; } - MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; } + MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. @@ -49651,39 +50383,40 @@ $as_echo_n "checking found msvcr100.dll architecture... " >&6; } CORRECT_MSVCR_ARCH=x86-64 fi fi - if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then + if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } - MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 -$as_echo "$MSVCR_DLL" >&6; } + MSVC_DLL="$POSSIBLE_MSVC_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 +$as_echo_n "checking for $DLL_NAME... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 +$as_echo "$MSVC_DLL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 $as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} fi fi fi fi - if test "x$MSVCR_DLL" = x; then + if test "x$MSVC_DLL" = x; then # Probe: Check in the Boot JDK directory. - POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll" + POSSIBLE_MSVC_DLL="$BOOT_JDK/bin/$DLL_NAME" - POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + DLL_NAME="$DLL_NAME" + POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" METHOD="well-known location in Boot JDK" - if test -e "$POSSIBLE_MSVCR_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; } - MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; } + MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. @@ -49699,25 +50432,25 @@ $as_echo_n "checking found msvcr100.dll architecture... " >&6; } CORRECT_MSVCR_ARCH=x86-64 fi fi - if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then + if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } - MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 -$as_echo "$MSVCR_DLL" >&6; } + MSVC_DLL="$POSSIBLE_MSVC_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 +$as_echo_n "checking for $DLL_NAME... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 +$as_echo "$MSVC_DLL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 $as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} fi fi fi - if test "x$MSVCR_DLL" = x; then + if test "x$MSVC_DLL" = x; then # Probe: Look in the Windows system32 directory CYGWIN_SYSTEMROOT="$SYSTEMROOT" @@ -49730,18 +50463,19 @@ $as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETY CYGWIN_SYSTEMROOT="$unix_path" fi - POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll" + POSSIBLE_MSVC_DLL="$CYGWIN_SYSTEMROOT/system32/$DLL_NAME" - POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + DLL_NAME="$DLL_NAME" + POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" METHOD="well-known location in SYSTEMROOT" - if test -e "$POSSIBLE_MSVCR_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; } - MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; } + MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. @@ -49757,25 +50491,25 @@ $as_echo_n "checking found msvcr100.dll architecture... " >&6; } CORRECT_MSVCR_ARCH=x86-64 fi fi - if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then + if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } - MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 -$as_echo "$MSVCR_DLL" >&6; } + MSVC_DLL="$POSSIBLE_MSVC_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 +$as_echo_n "checking for $DLL_NAME... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 +$as_echo "$MSVC_DLL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 $as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} fi fi fi - if test "x$MSVCR_DLL" = x; then + if test "x$MSVC_DLL" = x; then # Probe: If Visual Studio Express is installed, there is usually one with the debugger if test "x$VS100COMNTOOLS" != x; then CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.." @@ -49790,21 +50524,24 @@ $as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETY fi if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x64/ | $HEAD --lines 1` + POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \ + | $GREP -i /x64/ | $HEAD --lines 1` else - POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x86/ | $HEAD --lines 1` + POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \ + | $GREP -i /x86/ | $HEAD --lines 1` fi - POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + DLL_NAME="$DLL_NAME" + POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" METHOD="search of VS100COMNTOOLS" - if test -e "$POSSIBLE_MSVCR_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; } - MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; } + MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. @@ -49820,50 +50557,54 @@ $as_echo_n "checking found msvcr100.dll architecture... " >&6; } CORRECT_MSVCR_ARCH=x86-64 fi fi - if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then + if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } - MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 -$as_echo "$MSVCR_DLL" >&6; } + MSVC_DLL="$POSSIBLE_MSVC_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 +$as_echo_n "checking for $DLL_NAME... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 +$as_echo "$MSVC_DLL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 $as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} fi fi fi fi - if test "x$MSVCR_DLL" = x; then + if test "x$MSVC_DLL" = x; then # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now. - # (This was the original behaviour; kept since it might turn up something) + # (This was the original behaviour; kept since it might turn something up) if test "x$CYGWIN_VC_INSTALL_DIR" != x; then if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x64 | $HEAD --lines 1` + POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ + | $GREP x64 | $HEAD --lines 1` else - POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1` - if test "x$POSSIBLE_MSVCR_DLL" = x; then + POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ + | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1` + if test "x$POSSIBLE_MSVC_DLL" = x; then # We're grasping at straws now... - POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1` + POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ + | $HEAD --lines 1` fi fi - POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + DLL_NAME="$DLL_NAME" + POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" METHOD="search of VCINSTALLDIR" - if test -e "$POSSIBLE_MSVCR_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; } - MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; } + MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. @@ -49879,35 +50620,39 @@ $as_echo_n "checking found msvcr100.dll architecture... " >&6; } CORRECT_MSVCR_ARCH=x86-64 fi fi - if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then + if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } - MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 -$as_echo "$MSVCR_DLL" >&6; } + MSVC_DLL="$POSSIBLE_MSVC_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 +$as_echo_n "checking for $DLL_NAME... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 +$as_echo "$MSVC_DLL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 $as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} fi fi fi fi - if test "x$MSVCR_DLL" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } + if test "x$MSVC_DLL" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 +$as_echo_n "checking for $DLL_NAME... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - as_fn_error $? "Could not find msvcr100.dll. Please specify using --with-msvcr-dll." "$LINENO" 5 + as_fn_error $? "Could not find $DLL_NAME. Please specify using --with-msvcr-dll." "$LINENO" 5 fi + MSVCR_DLL=$MSVC_DLL - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + # Only process if variable expands to non-empty + + if test "x$MSVCR_DLL" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. @@ -49968,7 +50713,7 @@ $as_echo "$as_me: The path of MSVCR_DLL, which resolves as \"$path\", is invalid $as_echo "$as_me: Rewriting MSVCR_DLL to \"$new_path\"" >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then path="$MSVCR_DLL" has_colon=`$ECHO $path | $GREP ^.:` @@ -50009,25 +50754,536 @@ $as_echo "$as_me: Rewriting MSVCR_DLL to \"$new_path\"" >&6;} # 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}") - else - # We're on a unix platform. Hooray! :) - path="$MSVCR_DLL" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&5 + else + # We're on a unix platform. Hooray! :) + path="$MSVCR_DLL" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVCR_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of MSVCR_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 + fi - MSVCR_DLL="`cd "$path"; $THEPWDCMD -L`" + MSVCR_DLL="`cd "$path"; $THEPWDCMD -L`" + fi fi + MSVCR_DLL=$MSVCR_DLL + + + fi + + +# Check whether --with-msvcp-dll was given. +if test "${with_msvcp_dll+set}" = set; then : + withval=$with_msvcp_dll; +fi + + + if test "x$MSVCP_NAME" != "x"; then + if test "x$with_msvcp_dll" != x; then + # If given explicitely by user, do not probe. If not present, fail directly. + + DLL_NAME="$DLL_NAME" + POSSIBLE_MSVC_DLL="$with_msvcp_dll" + METHOD="--with-msvcp-dll" + if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; } + MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" + # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH="PE32 executable" + else + CORRECT_MSVCR_ARCH="PE32+ executable" + fi + else + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + fi + if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVC_DLL="$POSSIBLE_MSVC_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 +$as_echo_n "checking for $DLL_NAME... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 +$as_echo "$MSVC_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} + fi + fi + + if test "x$MSVC_DLL" = x; then + as_fn_error $? "Could not find a proper $MSVCP_NAME as specified by --with-msvcp-dll" "$LINENO" 5 + fi + else + + VAR_NAME="MSVCP_DLL" + DLL_NAME="${MSVCP_NAME}" + MSVC_DLL= + + if test "x$MSVC_DLL" = x; then + # Probe: Using well-known location from Visual Studio 10.0 + if test "x$VCINSTALLDIR" != x; then + CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR" + + windows_path="$CYGWIN_VC_INSTALL_DIR" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + CYGWIN_VC_INSTALL_DIR="$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'` + CYGWIN_VC_INSTALL_DIR="$unix_path" + fi + + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" + else + POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" + fi + $ECHO "POSSIBLE_MSVC_DLL $POSSIBLEMSVC_DLL" + + DLL_NAME="$DLL_NAME" + POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" + METHOD="well-known location in VCINSTALLDIR" + if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; } + MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" + # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH="PE32 executable" + else + CORRECT_MSVCR_ARCH="PE32+ executable" + fi + else + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + fi + if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVC_DLL="$POSSIBLE_MSVC_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 +$as_echo_n "checking for $DLL_NAME... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 +$as_echo "$MSVC_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} + fi + fi + + fi + fi + + if test "x$MSVC_DLL" = x; then + # Probe: Check in the Boot JDK directory. + POSSIBLE_MSVC_DLL="$BOOT_JDK/bin/$DLL_NAME" + + DLL_NAME="$DLL_NAME" + POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" + METHOD="well-known location in Boot JDK" + if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; } + MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" + # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH="PE32 executable" + else + CORRECT_MSVCR_ARCH="PE32+ executable" + fi + else + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + fi + if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVC_DLL="$POSSIBLE_MSVC_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 +$as_echo_n "checking for $DLL_NAME... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 +$as_echo "$MSVC_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} + fi + fi + + fi + + if test "x$MSVC_DLL" = x; then + # Probe: Look in the Windows system32 directory + CYGWIN_SYSTEMROOT="$SYSTEMROOT" + + windows_path="$CYGWIN_SYSTEMROOT" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + CYGWIN_SYSTEMROOT="$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'` + CYGWIN_SYSTEMROOT="$unix_path" + fi + + POSSIBLE_MSVC_DLL="$CYGWIN_SYSTEMROOT/system32/$DLL_NAME" + + DLL_NAME="$DLL_NAME" + POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" + METHOD="well-known location in SYSTEMROOT" + if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; } + MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" + # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH="PE32 executable" + else + CORRECT_MSVCR_ARCH="PE32+ executable" + fi + else + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + fi + if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVC_DLL="$POSSIBLE_MSVC_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 +$as_echo_n "checking for $DLL_NAME... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 +$as_echo "$MSVC_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} + fi + fi + + fi + + if test "x$MSVC_DLL" = x; then + # Probe: If Visual Studio Express is installed, there is usually one with the debugger + if test "x$VS100COMNTOOLS" != x; then + CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.." + + windows_path="$CYGWIN_VS_TOOLS_DIR" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + CYGWIN_VS_TOOLS_DIR="$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'` + CYGWIN_VS_TOOLS_DIR="$unix_path" + fi + + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \ + | $GREP -i /x64/ | $HEAD --lines 1` + else + POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \ + | $GREP -i /x86/ | $HEAD --lines 1` + fi + + DLL_NAME="$DLL_NAME" + POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" + METHOD="search of VS100COMNTOOLS" + if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; } + MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" + # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH="PE32 executable" + else + CORRECT_MSVCR_ARCH="PE32+ executable" + fi + else + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + fi + if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVC_DLL="$POSSIBLE_MSVC_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 +$as_echo_n "checking for $DLL_NAME... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 +$as_echo "$MSVC_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} + fi + fi + + fi + fi + + if test "x$MSVC_DLL" = x; then + # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now. + # (This was the original behaviour; kept since it might turn something up) + if test "x$CYGWIN_VC_INSTALL_DIR" != x; then + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ + | $GREP x64 | $HEAD --lines 1` + else + POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ + | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1` + if test "x$POSSIBLE_MSVC_DLL" = x; then + # We're grasping at straws now... + POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ + | $HEAD --lines 1` + fi + fi + + + DLL_NAME="$DLL_NAME" + POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL" + METHOD="search of VCINSTALLDIR" + if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; } + MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" + # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH="PE32 executable" + else + CORRECT_MSVCR_ARCH="PE32+ executable" + fi + else + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + fi + if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVC_DLL="$POSSIBLE_MSVC_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 +$as_echo_n "checking for $DLL_NAME... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5 +$as_echo "$MSVC_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;} + fi + fi + + fi + fi + + if test "x$MSVC_DLL" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5 +$as_echo_n "checking for $DLL_NAME... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "Could not find $DLL_NAME. Please specify using --with-msvcr-dll." "$LINENO" 5 + fi + + MSVCP_DLL=$MSVC_DLL + + # Only process if variable expands to non-empty + + if test "x$MSVCP_DLL" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$MSVCP_DLL" + new_path=`$CYGPATH -u "$path"` + + # 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 precense. + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCP_DLL, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of MSVCP_DLL, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of MSVCP_DLL" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $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 \) + 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-stile (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 $new_path | $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 + + + if test "x$path" != "x$new_path"; then + MSVCP_DLL="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVCP_DLL to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting MSVCP_DLL to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$MSVCP_DLL" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + 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 + + + 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 + + if test "x$path" != "x$new_path"; then + MSVCP_DLL="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVCP_DLL to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting MSVCP_DLL to \"$new_path\"" >&6;} + fi + + # 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}") + + else + # We're on a unix platform. Hooray! :) + path="$MSVCP_DLL" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCP_DLL, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of MSVCP_DLL, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of MSVCP_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + MSVCP_DLL="`cd "$path"; $THEPWDCMD -L`" + fi + fi + + MSVCP_DLL=$MSVCP_DLL + + + fi + fi @@ -50059,7 +51315,6 @@ fi fi - ############################################################################### # # We need to do some final tweaking, when everything else is done. @@ -50601,16 +51856,17 @@ fi CCACHE= + CCACHE_STATUS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking is ccache enabled" >&5 $as_echo_n "checking is ccache enabled... " >&6; } - ENABLE_CCACHE=$enable_ccache if test "x$enable_ccache" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + if test "x$TOOLCHAIN_TYPE" = "xgcc" -o "x$TOOLCHAIN_TYPE" = "xclang"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - OLD_PATH="$PATH" - if test "x$TOOLCHAIN_PATH" != x; then - PATH=$TOOLCHAIN_PATH:$PATH - fi + OLD_PATH="$PATH" + if test "x$TOOLCHAIN_PATH" != x; then + PATH=$TOOLCHAIN_PATH:$PATH + fi @@ -50804,11 +52060,19 @@ $as_echo "$tool_specified" >&6; } fi - CCACHE_STATUS="enabled" - PATH="$OLD_PATH" + PATH="$OLD_PATH" + CCACHE_VERSION=`$CCACHE --version | head -n1 | $SED 's/[A-Za-z ]*//'` + CCACHE_STATUS="Active ($CCACHE_VERSION)" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ccache is not supported with toolchain type $TOOLCHAIN_TYPE" >&5 +$as_echo "$as_me: WARNING: ccache is not supported with toolchain type $TOOLCHAIN_TYPE" >&2;} + fi elif test "x$enable_ccache" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, explicitly disabled" >&5 $as_echo "no, explicitly disabled" >&6; } + CCACHE_STATUS="Disabled" elif test "x$enable_ccache" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -50839,23 +52103,17 @@ $as_echo "$as_me: WARNING: --with-ccache-dir has no meaning when ccache is not e if test "x$CCACHE" != x; then if test "x$CCACHE" != x; then - # Only use ccache if it is 3.1.4 or later, which supports - # precompiled headers. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ccache supports precompiled headers" >&5 -$as_echo_n "checking if ccache supports precompiled headers... " >&6; } - HAS_GOOD_CCACHE=`($CCACHE --version | head -n 1 | grep -E 3.1.[456789]) 2> /dev/null` - if test "x$HAS_GOOD_CCACHE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, disabling ccache" >&5 -$as_echo "no, disabling ccache" >&6; } - CCACHE= - CCACHE_STATUS="disabled" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + if test "x$USE_PRECOMPILED_HEADER" = "x1"; then + HAS_BAD_CCACHE=`$ECHO $CCACHE_VERSION | \ + $GREP -e '^1.*' -e '^2.*' -e '^3\.0.*' -e '^3\.1\.[0123]'` + if test "x$HAS_BAD_CCACHE" != "x"; then + as_fn_error $? "Precompiled headers requires ccache 3.1.4 or later, found $CCACHE_VERSION" "$LINENO" 5 + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if C-compiler supports ccache precompiled headers" >&5 $as_echo_n "checking if C-compiler supports ccache precompiled headers... " >&6; } + CCACHE_PRECOMP_FLAG="-fpch-preprocess" PUSHED_FLAGS="$CXXFLAGS" - CXXFLAGS="-fpch-preprocess $CXXFLAGS" + CXXFLAGS="$CCACHE_PRECOMP_FLAG $CXXFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -50877,19 +52135,18 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } + CFLAGS_CCACHE="$CCACHE_PRECOMP_FLAG" + + CCACHE_SLOPPINESS=pch_defines,time_macros else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, disabling ccaching of precompiled headers" >&5 -$as_echo "no, disabling ccaching of precompiled headers" >&6; } - CCACHE= - CCACHE_STATUS="disabled" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "Cannot use ccache with precompiled headers without compiler support for $CCACHE_PRECOMP_FLAG" "$LINENO" 5 fi fi - fi - if test "x$CCACHE" != x; then - CCACHE_SLOPPINESS=time_macros - CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS $CCACHE" - CCACHE_FLAGS=-fpch-preprocess + CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR \ + CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$TOPDIR $CCACHE" if test "x$SET_CCACHE_DIR" != x; then mkdir -p $CCACHE_DIR > /dev/null 2>&1 @@ -52186,7 +53443,10 @@ $CHMOD +x $OUTPUT_ROOT/compare.sh printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" fi printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" - printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n" + if test "x$TOOLCHAIN_VERSION" != "x"; then + print_version=" $TOOLCHAIN_VERSION" + fi + printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n" printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n" printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n" diff --git a/common/autoconf/help.m4 b/common/autoconf/help.m4 index 9e7fb73d9ef..61f608389d5 100644 --- a/common/autoconf/help.m4 +++ b/common/autoconf/help.m4 @@ -209,7 +209,10 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS], printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" fi printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" - printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n" + if test "x$TOOLCHAIN_VERSION" != "x"; then + print_version=" $TOOLCHAIN_VERSION" + fi + printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n" printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n" printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n" diff --git a/common/autoconf/hotspot-spec.gmk.in b/common/autoconf/hotspot-spec.gmk.in index dcd2fd8f360..2cc8be74416 100644 --- a/common/autoconf/hotspot-spec.gmk.in +++ b/common/autoconf/hotspot-spec.gmk.in @@ -109,8 +109,8 @@ LD:=@HOTSPOT_LD@ MT:=@HOTSPOT_MT@ RC:=@HOTSPOT_RC@ -EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ -EXTRA_CXXFLAGS=@LEGACY_EXTRA_CXXFLAGS@ +EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ $(CFLAGS_CCACHE) +EXTRA_CXXFLAGS=@LEGACY_EXTRA_CXXFLAGS@ $(CFLAGS_CCACHE) EXTRA_LDFLAGS=@LEGACY_EXTRA_LDFLAGS@ USE_PRECOMPILED_HEADER=@USE_PRECOMPILED_HEADER@ @@ -132,6 +132,13 @@ else ZIP_DEBUGINFO_FILES:=0 endif +ifeq ($(OPENJDK_TARGET_OS), windows) + # On Windows, the Visual Studio toolchain needs the LIB and INCLUDE + # environment variables (in Windows path style). + export INCLUDE:=@VS_INCLUDE@ + export LIB:=@VS_LIB@ +endif + # Sneak this in via the spec.gmk file, since we don't want to mess around too much with the Hotspot make files. # This is needed to get the LOG setting to work properly. include $(SRC_ROOT)/make/common/MakeBase.gmk diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4 index 8d4e73488bc..6e963b280de 100644 --- a/common/autoconf/libraries.m4 +++ b/common/autoconf/libraries.m4 @@ -1124,10 +1124,9 @@ AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP], AC_DEFUN_ONCE([LIB_SETUP_ON_WINDOWS], [ if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - TOOLCHAIN_SETUP_MSVCR_DLL + TOOLCHAIN_SETUP_VS_RUNTIME_DLLS BASIC_DEPRECATED_ARG_WITH([dxsdk]) BASIC_DEPRECATED_ARG_WITH([dxsdk-lib]) BASIC_DEPRECATED_ARG_WITH([dxsdk-include]) fi - AC_SUBST(MSVCR_DLL) ]) diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index 1c6c1c40132..02d45316d4c 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -78,6 +78,11 @@ endif OUTPUT_SYNC_SUPPORTED:=@OUTPUT_SYNC_SUPPORTED@ OUTPUT_SYNC:=@OUTPUT_SYNC@ +# Override the shell with bash +BASH:=@BASH@ +BASH_ARGS:=@BASH_ARGS@ +SHELL:=$(BASH) $(BASH_ARGS) + # The "human readable" name of this configuration CONF_NAME:=@CONF_NAME@ @@ -124,14 +129,12 @@ LIBDL:=@LIBDL@ # colon or semicolon PATH_SEP:=@PATH_SEP@ +# Save the original path before replacing it with the Visual Studio tools +ORIGINAL_PATH:=@ORIGINAL_PATH@ ifeq ($(OPENJDK_TARGET_OS), windows) - # On Windows, the Visual Studio toolchain needs the LIB and INCLUDE - # environment variables (in Windows path style), and the PATH needs to - # be adjusted to include Visual Studio tools (but this needs to be in - # cygwin/msys style). + # On Windows, the Visual Studio toolchain needs the PATH to be adjusted + # to include Visual Studio tools (this needs to be in cygwin/msys style). export PATH:=@VS_PATH@ - export INCLUDE:=@VS_INCLUDE@ - export LIB:=@VS_LIB@ endif SYSROOT_CFLAGS := @SYSROOT_CFLAGS@ @@ -243,7 +246,7 @@ MAKESUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/makesupport HOTSPOT_OUTPUTDIR=$(BUILD_OUTPUT)/hotspot JDK_OUTPUTDIR=$(BUILD_OUTPUT)/jdk IMAGES_OUTPUTDIR=$(BUILD_OUTPUT)/images -TESTMAKE_OUTPUTDIR=$(BUILD_OUTPUT)/testmake +TESTMAKE_OUTPUTDIR=$(BUILD_OUTPUT)/test-make MAKESUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/make-support HOTSPOT_DIST=@HOTSPOT_DIST@ @@ -323,6 +326,8 @@ CXX_FLAG_DEPS:=@CXX_FLAG_DEPS@ CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@ +CFLAGS_CCACHE:=@CFLAGS_CCACHE@ + # Tools that potentially need to be cross compilation aware. CC:=@FIXPATH@ @CCACHE@ @CC@ @@ -495,7 +500,6 @@ endif # Tools adhering to a minimal and common standard of posix compliance. AWK:=@AWK@ BASENAME:=@BASENAME@ -BASH:=@BASH@ CAT:=@CAT@ CCACHE:=@CCACHE@ # CD is going away, but remains to cater for legacy makefiles. @@ -579,6 +583,7 @@ USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@ USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@ LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@ MSVCR_DLL:=@MSVCR_DLL@ +MSVCP_DLL:=@MSVCP_DLL@ # ADD_SRCS takes a single argument with source roots diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 index 9b16574848f..1939fb8740f 100644 --- a/common/autoconf/toolchain.m4 +++ b/common/autoconf/toolchain.m4 @@ -691,8 +691,8 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS], CC_VERSION_OUTPUT=`$CC 2>&1 | $HEAD -n 1 | $TR -d '\r'` COMPILER_CPU_TEST=`$ECHO $CC_VERSION_OUTPUT | $SED -n "s/^.* \(.*\)$/\1/p"` if test "x$OPENJDK_TARGET_CPU" = "xx86"; then - if test "x$COMPILER_CPU_TEST" != "x80x86"; then - AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86".]) + if test "x$COMPILER_CPU_TEST" != "x80x86" -a "x$COMPILER_CPU_TEST" != "xx86"; then + AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86" or "x86".]) fi elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then if test "x$COMPILER_CPU_TEST" != "xx64"; then diff --git a/common/autoconf/toolchain_windows.m4 b/common/autoconf/toolchain_windows.m4 index e1ec6f3db5b..78e03f78c40 100644 --- a/common/autoconf/toolchain_windows.m4 +++ b/common/autoconf/toolchain_windows.m4 @@ -23,43 +23,90 @@ # questions. # +################################################################################ + +VALID_VS_VERSIONS="2010 2012 2013" + +VS_DESCRIPTION_2010="Microsoft Visual Studio 2010" +VS_VERSION_INTERNAL_2010=100 +VS_MSVCR_2010=msvcr100.dll +# We don't use msvcp on Visual Studio 2010 +#VS_MSVCP_2010=msvcp100.dll +VS_ENVVAR_2010="VS100COMNTOOLS" +VS_VS_INSTALLDIR_2010="Microsoft Visual Studio 10.0" +VS_SDK_INSTALLDIR_2010="Microsoft SDKs/Windows/v7.1" +VS_VS_PLATFORM_NAME_2010="v100" +VS_SDK_PLATFORM_NAME_2010="Windows7.1SDK" + +VS_DESCRIPTION_2012="Microsoft Visual Studio 2012" +VS_VERSION_INTERNAL_2012=110 +VS_MSVCR_2012=msvcr110.dll +VS_MSVCP_2012=msvcp110.dll +VS_ENVVAR_2012="VS110COMNTOOLS" +VS_VS_INSTALLDIR_2012="Microsoft Visual Studio 11.0" +VS_SDK_INSTALLDIR_2012= +VS_VS_PLATFORM_NAME_2012="v110" +VS_SDK_PLATFORM_NAME_2012= + +VS_DESCRIPTION_2013="Microsoft Visual Studio 2013" +VS_VERSION_INTERNAL_2013=120 +VS_MSVCR_2013=msvcr120.dll +VS_MSVCP_2013=msvcp120.dll +VS_ENVVAR_2013="VS120COMNTOOLS" +VS_VS_INSTALLDIR_2013="Microsoft Visual Studio 12.0" +VS_SDK_INSTALLDIR_2013= +VS_VS_PLATFORM_NAME_2013="v120" +VS_SDK_PLATFORM_NAME_2013= + +################################################################################ + AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT], [ if test "x$VS_ENV_CMD" = x; then - VS100BASE="$1" - METHOD="$2" - BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VS100BASE) - if test -d "$VS100BASE"; then - if test -f "$VS100BASE/$VCVARSFILE"; then - AC_MSG_NOTICE([Found Visual Studio installation at $VS100BASE using $METHOD]) - VS_ENV_CMD="$VS100BASE/$VCVARSFILE" + VS_VERSION="$1" + VS_BASE="$2" + METHOD="$3" + + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VCVARSFILE="vc/bin/vcvars32.bat" + else + VCVARSFILE="vc/bin/amd64/vcvars64.bat" + fi + + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VS_BASE) + if test -d "$VS_BASE"; then + if test -f "$VS_BASE/$VCVARSFILE"; then + AC_MSG_NOTICE([Found Visual Studio installation at $VS_BASE using $METHOD]) + VS_ENV_CMD="$VS_BASE/$VCVARSFILE" # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013 - # TODO: improve detection for other versions of VS - PLATFORM_TOOLSET="v100" + eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" else - AC_MSG_NOTICE([Found Visual Studio installation at $VS100BASE using $METHOD]) + AC_MSG_NOTICE([Found Visual Studio installation at $VS_BASE using $METHOD]) AC_MSG_NOTICE([Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring]) fi fi fi ]) +################################################################################ + AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT], [ if test "x$VS_ENV_CMD" = x; then - WIN_SDK_BASE="$1" - METHOD="$2" + VS_VERSION="$1" + WIN_SDK_BASE="$2" + METHOD="$3" BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(WIN_SDK_BASE) if test -d "$WIN_SDK_BASE"; then # There have been cases of partial or broken SDK installations. A missing # lib dir is not going to work. - if test ! -d "$WIN_SDK_BASE/../lib"; then + if test ! -d "$WIN_SDK_BASE/lib"; then AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD]) AC_MSG_NOTICE([Warning: Installation is broken, lib dir is missing. Ignoring]) - elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then + elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD]) - VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd" + VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd" if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then VS_ENV_ARGS="/x86" else @@ -68,7 +115,7 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT], # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK # TODO: improve detection for other versions of SDK - PLATFORM_TOOLSET="Windows7.1SDK" + eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}" else AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD]) AC_MSG_NOTICE([Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring]) @@ -77,50 +124,121 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT], fi ]) +################################################################################ +# Finds the bat or cmd file in Visual Studio or the SDK that sets up a proper +# build environment and assigns it to VS_ENV_CMD AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE], [ - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - VCVARSFILE="vc/bin/vcvars32.bat" - else - VCVARSFILE="vc/bin/amd64/vcvars64.bat" + VS_VERSION="$1" + eval VS_COMNTOOLS_VAR="\${VS_ENVVAR_${VS_VERSION}}" + eval VS_COMNTOOLS="\$${VS_COMNTOOLS_VAR}" + eval VS_INSTALL_DIR="\${VS_VS_INSTALLDIR_${VS_VERSION}}" + eval SDK_INSTALL_DIR="\${VS_SDK_INSTALLDIR_${VS_VERSION}}" + + # When using --with-tools-dir, assume it points to the correct and default + # version of Visual Studio or that --with-toolchain-version was also set. + if test "x$with_tools_dir" != x; then + TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], + [$with_tools_dir/../..], [--with-tools-dir]) + TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], + [$with_tools_dir/../../..], [--with-tools-dir]) + if test "x$VS_ENV_CMD" = x; then + # Having specified an argument which is incorrect will produce an instant failure; + # we should not go on looking + AC_MSG_NOTICE([The path given by --with-tools-dir does not contain a valid]) + AC_MSG_NOTICE([Visual Studio installation. Please point to the VC/bin or VC/bin/amd64]) + AC_MSG_NOTICE([directory within the Visual Studio installation]) + AC_MSG_ERROR([Cannot locate a valid Visual Studio installation]) + fi fi VS_ENV_CMD="" VS_ENV_ARGS="" - if test "x$with_toolsdir" != x; then - TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$with_toolsdir/../..], [--with-tools-dir]) - fi - if test "x$with_toolsdir" != x && test "x$VS_ENV_CMD" = x; then - # Having specified an argument which is incorrect will produce an instant failure; - # we should not go on looking - AC_MSG_NOTICE([The path given by --with-tools-dir does not contain a valid Visual Studio installation]) - AC_MSG_NOTICE([Please point to the VC/bin directory within the Visual Studio installation]) - AC_MSG_ERROR([Cannot locate a valid Visual Studio installation]) - fi - - if test "x$VS100COMNTOOLS" != x; then - TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$VS100COMNTOOLS/../..], [VS100COMNTOOLS variable]) + if test "x$VS_COMNTOOLS" != x; then + TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], + [$VS_COMNTOOLS/../..], [$VS_COMNTOOLS_VAR variable]) fi if test "x$PROGRAMFILES" != x; then - TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$PROGRAMFILES/Microsoft Visual Studio 10.0], [well-known name]) + TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], + [$PROGRAMFILES/$VS_INSTALL_DIR], [well-known name]) fi - TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([C:/Program Files/Microsoft Visual Studio 10.0], [well-known name]) - TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([C:/Program Files (x86)/Microsoft Visual Studio 10.0], [well-known name]) + # Work around the insanely named ProgramFiles(x86) env variable + PROGRAMFILES_X86="`env | $SED -n 's/^ProgramFiles(x86)=//p'`" + if test "x$PROGRAMFILES_X86" != x; then + TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], + [$PROGRAMFILES_X86/$VS_INSTALL_DIR], [well-known name]) + fi + TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], + [C:/Program Files/$VS_INSTALL_DIR], [well-known name]) + TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], + [C:/Program Files (x86)/$VS_INSTALL_DIR], [well-known name]) - if test "x$ProgramW6432" != x; then - TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([$ProgramW6432/Microsoft SDKs/Windows/v7.1/Bin], [well-known name]) + if test "x$SDK_INSTALL_DIR" != x; then + if test "x$ProgramW6432" != x; then + TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}], + [$ProgramW6432/$SDK_INSTALL_DIR], [well-known name]) + fi + if test "x$PROGRAMW6432" != x; then + TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}], + [$PROGRAMW6432/$SDK_INSTALL_DIR], [well-known name]) + fi + if test "x$PROGRAMFILES" != x; then + TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}], + [$PROGRAMFILES/$SDK_INSTALL_DIR], [well-known name]) + fi + TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}], + [C:/Program Files/$SDK_INSTALL_DIR], [well-known name]) + TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}], + [C:/Program Files (x86)/$SDK_INSTALL_DIR], [well-known name]) fi - if test "x$PROGRAMW6432" != x; then - TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([$PROGRAMW6432/Microsoft SDKs/Windows/v7.1/Bin], [well-known name]) - fi - if test "x$PROGRAMFILES" != x; then - TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([$PROGRAMFILES/Microsoft SDKs/Windows/v7.1/Bin], [well-known name]) - fi - TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin], [well-known name]) - TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1/Bin], [well-known name]) ]) +################################################################################ + +AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO], +[ + AC_ARG_WITH(toolchain-version, [AS_HELP_STRING([--with-toolchain-version], + [the version of the toolchain to look for, use '--help' to show possible values @<:@platform dependent@:>@])]) + + if test "x$with_toolchain_version" = xlist; then + # List all toolchains + AC_MSG_NOTICE([The following toolchain versions are valid on this platform:]) + for version in $VALID_VS_VERSIONS; do + eval VS_DESCRIPTION=\${VS_DESCRIPTION_$version} + $PRINTF " %-10s %s\n" $version "$VS_DESCRIPTION" + done + + exit 0 + elif test "x$with_toolchain_version" != x; then + # User override; check that it is valid + if test "x${VALID_VS_VERSIONS/$with_toolchain_version/}" = "x${VALID_VS_VERSIONS}"; then + AC_MSG_NOTICE([Visual Studio version $with_toolchain_version is not valid.]) + AC_MSG_NOTICE([Valid Visual Studio versions: $VALID_VS_VERSIONS.]) + AC_MSG_ERROR([Cannot continue.]) + fi + VS_VERSIONS_PROBE_LIST="$with_toolchain_version" + else + # No flag given, use default + VS_VERSIONS_PROBE_LIST="$VALID_VS_VERSIONS" + fi + + for VS_VERSION in $VS_VERSIONS_PROBE_LIST; do + TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE([$VS_VERSION]) + if test "x$VS_ENV_CMD" != x; then + TOOLCHAIN_VERSION=$VS_VERSION + eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}" + eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}" + eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}" + eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}" + # The rest of the variables are already evaled while probing + AC_MSG_NOTICE([Found $VS_DESCRIPTION]) + break + fi + done +]) + +################################################################################ # Check if the VS env variables were setup prior to running configure. # If not, then find vcvarsall.bat and run it automatically, and integrate # the set env variables into the spec file. @@ -142,7 +260,8 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV], fi # First-hand choice is to locate and run the vsvars bat file. - TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE + TOOLCHAIN_FIND_VISUAL_STUDIO + if test "x$VS_ENV_CMD" != x; then # We have found a Visual Studio environment on disk, let's extract variables from the vsvars bat file. BASIC_FIXUP_EXECUTABLE(VS_ENV_CMD) @@ -213,9 +332,9 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV], AC_MSG_ERROR([Your VC command prompt seems broken, INCLUDE and/or LIB is missing.]) else AC_MSG_RESULT([ok]) - # Remove any trailing "\" and " " from the variables. - VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED 's/\\\\* *$//'` - VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\* *$//'` + # Remove any trailing "\" ";" and " " from the variables. + VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED -e 's/\\\\*;* *$//'` + VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\*;* *$//'` VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'` WindowsSDKDir=`$ECHO "$WindowsSDKDir" | $SED 's/\\\\* *$//'` WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'` @@ -226,6 +345,42 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV], AC_SUBST(VS_PATH) AC_SUBST(VS_INCLUDE) AC_SUBST(VS_LIB) + + # Convert VS_INCLUDE into SYSROOT_CFLAGS + OLDIFS="$IFS" + IFS=";" + for i in $VS_INCLUDE; do + ipath=$i + # Only process non-empty elements + if test "x$ipath" != x; then + IFS="$OLDIFS" + # Check that directory exists before calling fixup_path + testpath=$ipath + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH([testpath]) + if test -d "$testpath"; then + BASIC_FIXUP_PATH([ipath]) + SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath" + fi + IFS=";" + fi + done + # Convert VS_LIB into SYSROOT_LDFLAGS + for i in $VS_LIB; do + libpath=$i + # Only process non-empty elements + if test "x$libpath" != x; then + IFS="$OLDIFS" + # Check that directory exists before calling fixup_path + testpath=$libpath + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH([testpath]) + if test -d "$testpath"; then + BASIC_FIXUP_PATH([libpath]) + SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath" + fi + IFS=";" + fi + done + IFS="$OLDIFS" fi else AC_MSG_RESULT([not found]) @@ -242,16 +397,17 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV], fi ]) -AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL], +AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL], [ - POSSIBLE_MSVCR_DLL="$1" - METHOD="$2" - if test -e "$POSSIBLE_MSVCR_DLL"; then - AC_MSG_NOTICE([Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD]) - + DLL_NAME="$1" + POSSIBLE_MSVC_DLL="$2" + METHOD="$3" + if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then + AC_MSG_NOTICE([Found $1 at $POSSIBLE_MSVC_DLL using $METHOD]) + # Need to check if the found msvcr is correct architecture - AC_MSG_CHECKING([found msvcr100.dll architecture]) - MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + AC_MSG_CHECKING([found $1 architecture]) + MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. @@ -267,96 +423,135 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL], CORRECT_MSVCR_ARCH=x86-64 fi fi - if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then + if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then AC_MSG_RESULT([ok]) - MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - AC_MSG_CHECKING([for msvcr100.dll]) - AC_MSG_RESULT([$MSVCR_DLL]) + MSVC_DLL="$POSSIBLE_MSVC_DLL" + AC_MSG_CHECKING([for $1]) + AC_MSG_RESULT([$MSVC_DLL]) else AC_MSG_RESULT([incorrect, ignoring]) - AC_MSG_NOTICE([The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE]) + AC_MSG_NOTICE([The file type of the located $1 is $MSVC_DLL_FILETYPE]) fi fi ]) -AC_DEFUN([TOOLCHAIN_SETUP_MSVCR_DLL], +AC_DEFUN([TOOLCHAIN_SETUP_MSVC_DLL], [ - AC_ARG_WITH(msvcr-dll, [AS_HELP_STRING([--with-msvcr-dll], - [copy this msvcr100.dll into the built JDK (Windows only) @<:@probed@:>@])]) + VAR_NAME="$1" + DLL_NAME="$2" + MSVC_DLL= - if test "x$with_msvcr_dll" != x; then - # If given explicitely by user, do not probe. If not present, fail directly. - TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$with_msvcr_dll], [--with-msvcr-dll]) - if test "x$MSVCR_DLL" = x; then - AC_MSG_ERROR([Could not find a proper msvcr100.dll as specified by --with-msvcr-dll]) - fi - fi - - if test "x$MSVCR_DLL" = x; then + if test "x$MSVC_DLL" = x; then # Probe: Using well-known location from Visual Studio 10.0 if test "x$VCINSTALLDIR" != x; then CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR" BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VC_INSTALL_DIR) if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC100.CRT/msvcr100.dll" + POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" else - POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC100.CRT/msvcr100.dll" + POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" fi - TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in VCINSTALLDIR]) + $ECHO "POSSIBLE_MSVC_DLL $POSSIBLEMSVC_DLL" + TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL], + [well-known location in VCINSTALLDIR]) fi fi - if test "x$MSVCR_DLL" = x; then + if test "x$MSVC_DLL" = x; then # Probe: Check in the Boot JDK directory. - POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll" - TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in Boot JDK]) + POSSIBLE_MSVC_DLL="$BOOT_JDK/bin/$DLL_NAME" + TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL], + [well-known location in Boot JDK]) fi - - if test "x$MSVCR_DLL" = x; then - # Probe: Look in the Windows system32 directory + + if test "x$MSVC_DLL" = x; then + # Probe: Look in the Windows system32 directory CYGWIN_SYSTEMROOT="$SYSTEMROOT" BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_SYSTEMROOT) - POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll" - TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in SYSTEMROOT]) + POSSIBLE_MSVC_DLL="$CYGWIN_SYSTEMROOT/system32/$DLL_NAME" + TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL], + [well-known location in SYSTEMROOT]) fi - if test "x$MSVCR_DLL" = x; then + if test "x$MSVC_DLL" = x; then # Probe: If Visual Studio Express is installed, there is usually one with the debugger if test "x$VS100COMNTOOLS" != x; then CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.." BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VS_TOOLS_DIR) if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x64/ | $HEAD --lines 1` + POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \ + | $GREP -i /x64/ | $HEAD --lines 1` else - POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x86/ | $HEAD --lines 1` + POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \ + | $GREP -i /x86/ | $HEAD --lines 1` fi - TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VS100COMNTOOLS]) + TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL], + [search of VS100COMNTOOLS]) fi fi - - if test "x$MSVCR_DLL" = x; then + + if test "x$MSVC_DLL" = x; then # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now. - # (This was the original behaviour; kept since it might turn up something) + # (This was the original behaviour; kept since it might turn something up) if test "x$CYGWIN_VC_INSTALL_DIR" != x; then if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x64 | $HEAD --lines 1` + POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ + | $GREP x64 | $HEAD --lines 1` else - POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1` - if test "x$POSSIBLE_MSVCR_DLL" = x; then + POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ + | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1` + if test "x$POSSIBLE_MSVC_DLL" = x; then # We're grasping at straws now... - POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1` + POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ + | $HEAD --lines 1` fi fi - - TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VCINSTALLDIR]) + + TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL], + [search of VCINSTALLDIR]) fi fi - - if test "x$MSVCR_DLL" = x; then - AC_MSG_CHECKING([for msvcr100.dll]) + + if test "x$MSVC_DLL" = x; then + AC_MSG_CHECKING([for $DLL_NAME]) AC_MSG_RESULT([no]) - AC_MSG_ERROR([Could not find msvcr100.dll. Please specify using --with-msvcr-dll.]) + AC_MSG_ERROR([Could not find $DLL_NAME. Please specify using --with-msvcr-dll.]) fi - BASIC_FIXUP_PATH(MSVCR_DLL) + $1=$MSVC_DLL + BASIC_FIXUP_PATH($1) + AC_SUBST($1, [$]$1) +]) + +AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS], +[ + AC_ARG_WITH(msvcr-dll, [AS_HELP_STRING([--with-msvcr-dll], + [path to microsoft C runtime dll (msvcr*.dll) (Windows only) @<:@probed@:>@])]) + + if test "x$with_msvcr_dll" != x; then + # If given explicitely by user, do not probe. If not present, fail directly. + TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$with_msvcr_dll], + [--with-msvcr-dll]) + if test "x$MSVC_DLL" = x; then + AC_MSG_ERROR([Could not find a proper $MSVCR_NAME as specified by --with-msvcr-dll]) + fi + else + TOOLCHAIN_SETUP_MSVC_DLL([MSVCR_DLL], [${MSVCR_NAME}]) + fi + + AC_ARG_WITH(msvcp-dll, [AS_HELP_STRING([--with-msvcp-dll], + [path to microsoft C++ runtime dll (msvcp*.dll) (Windows only) @<:@probed@:>@])]) + + if test "x$MSVCP_NAME" != "x"; then + if test "x$with_msvcp_dll" != x; then + # If given explicitely by user, do not probe. If not present, fail directly. + TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$with_msvcp_dll], + [--with-msvcp-dll]) + if test "x$MSVC_DLL" = x; then + AC_MSG_ERROR([Could not find a proper $MSVCP_NAME as specified by --with-msvcp-dll]) + fi + else + TOOLCHAIN_SETUP_MSVC_DLL([MSVCP_DLL], [${MSVCP_NAME}]) + fi + fi ]) diff --git a/common/bin/unshuffle_list.txt b/common/bin/unshuffle_list.txt index 0219bd7b005..8f1872dc6da 100644 --- a/common/bin/unshuffle_list.txt +++ b/common/bin/unshuffle_list.txt @@ -123,6 +123,7 @@ jdk/src/java.base/share/classes/java/lang/reflect : jdk/src/share/classes/java/l jdk/src/java.base/share/classes/java/math : jdk/src/share/classes/java/math jdk/src/java.base/share/classes/java/net : jdk/src/share/classes/java/net jdk/src/java.base/share/classes/java/nio : jdk/src/share/classes/java/nio +jdk/src/java.base/share/classes/java/security/acl : jdk/src/share/classes/java/security/acl jdk/src/java.base/share/classes/java/security/cert : jdk/src/share/classes/java/security/cert jdk/src/java.base/share/classes/java/security/interfaces : jdk/src/share/classes/java/security/interfaces jdk/src/java.base/share/classes/java/security : jdk/src/share/classes/java/security @@ -1211,8 +1212,6 @@ jdk/src/java.rmi/share/doc/stub/java/rmi/activation : jdk/src/share/doc/stub/jav jdk/src/java.rmi/unix/bin/java-rmi.cgi.sh : jdk/src/solaris/bin/java-rmi.cgi.sh jdk/src/java.scripting/share/classes/javax/script : jdk/src/share/classes/javax/script jdk/src/java.scripting/share/classes/com/sun/tools/script/shell : jdk/src/share/classes/com/sun/tools/script/shell -jdk/src/java.security.acl/share/classes/java/security/acl : jdk/src/share/classes/java/security/acl -jdk/src/java.security.acl/share/classes/sun/security/acl : jdk/src/share/classes/sun/security/acl jdk/src/java.security.jgss/macosx/native/libosxkrb5/nativeccache.c : jdk/src/share/native/sun/security/krb5/nativeccache.c jdk/src/java.security.jgss/macosx/native/libosxkrb5/SCDynamicStoreConfig.m : jdk/src/macosx/native/sun/security/krb5/SCDynamicStoreConfig.m jdk/src/java.security.jgss/share/classes/javax/security/auth/kerberos : jdk/src/share/classes/javax/security/auth/kerberos @@ -1303,6 +1302,7 @@ jdk/src/jdk.deploy.osx/macosx/native/libosx/KeystoreImpl.m : jdk/src/macosx/nati jdk/src/jdk.dev/share/classes/com/sun/jarsigner : jdk/src/share/classes/com/sun/jarsigner jdk/src/jdk.dev/share/classes/com/sun/tools/hat : jdk/src/share/classes/com/sun/tools/hat jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner : jdk/src/share/classes/sun/security/tools/jarsigner +jdk/src/jdk.dev/share/classes/sun/security/tools/policytool : jdk/src/share/classes/sun/security/tools/policytool jdk/src/jdk.dev/share/classes/sun/tools/jar : jdk/src/share/classes/sun/tools/jar jdk/src/jdk.dev/share/classes/sun/tools/native2ascii : jdk/src/share/classes/sun/tools/native2ascii jdk/src/jdk.hprof.agent/share/classes/com/sun/demo/jvmti/hprof : jdk/src/share/classes/com/sun/demo/jvmti/hprof @@ -1443,7 +1443,6 @@ jdk/src/jdk.rmic/share/classes/sun/tools/java : jdk/src/share/classes/sun/tools/ jdk/src/jdk.rmic/share/classes/sun/tools/tree : jdk/src/share/classes/sun/tools/tree jdk/src/jdk.rmic/share/classes/sun/tools/util : jdk/src/share/classes/sun/tools/util jdk/src/jdk.runtime/share/classes/com/sun/tracing : jdk/src/share/classes/com/sun/tracing -jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool : jdk/src/share/classes/sun/security/tools/policytool jdk/src/jdk.runtime/share/classes/sun/tracing : jdk/src/share/classes/sun/tracing jdk/src/jdk.runtime/share/native/common-unpack/bands.cpp : jdk/src/share/native/com/sun/java/util/jar/pack/bands.cpp jdk/src/jdk.runtime/share/native/common-unpack/bands.h : jdk/src/share/native/com/sun/java/util/jar/pack/bands.h diff --git a/corba/.hgtags b/corba/.hgtags index b7b87c5d34e..2db5e411ae5 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -289,3 +289,8 @@ e27c725d6c9d155667b35255f442d4ceb8c3c084 jdk9-b40 1f57bd728c9e6865ccb9d43ccd80a1c11230a32f jdk9-b44 9e3f2bed80c0e5a84a256ce41f1d10c5ade48466 jdk9-b45 326f2068b4a4c05e2fa27d6acf93eba7b54b090d jdk9-b46 +ee8447ca632e1d39180b4767c749db101bff7314 jdk9-b47 +a13c49c5f2899b702652a460ed7aa73123e671e6 jdk9-b48 +9285d14eb7b6b0815679bae98dd936dbc136218d jdk9-b49 +224f593393e5b01b3c8f1e591b7f4b1790a3737a jdk9-b50 +2309c02386d1fa4ced5051873ffb9e04874f7a44 jdk9-b51 diff --git a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORB.java b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORB.java index e597b1daa03..3f8056cff4d 100644 --- a/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORB.java +++ b/corba/src/java.corba/share/classes/com/sun/corba/se/spi/orb/ORB.java @@ -176,42 +176,9 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB staticWrapper = ORBUtilSystemException.get( CORBALogDomains.RPC_PRESENTATION ) ; - boolean useDynamicStub = - ((Boolean)AccessController.doPrivileged( - new PrivilegedAction() { - public java.lang.Object run() { - return Boolean.valueOf( Boolean.getBoolean ( - ORBConstants.USE_DYNAMIC_STUB_PROPERTY ) ) ; - } - } - )).booleanValue() ; + boolean useDynamicStub = false; - PresentationManager.StubFactoryFactory dynamicStubFactoryFactory = - (PresentationManager.StubFactoryFactory)AccessController.doPrivileged( - new PrivilegedAction() { - public java.lang.Object run() { - PresentationManager.StubFactoryFactory sff = - PresentationDefaults.getProxyStubFactoryFactory() ; - - String className = System.getProperty( - ORBConstants.DYNAMIC_STUB_FACTORY_FACTORY_CLASS, - "com.sun.corba.se.impl.presentation.rmi.bcel.StubFactoryFactoryBCELImpl" ) ; - - try { - // First try the configured class name, if any - Class cls = - sun.corba.SharedSecrets.getJavaCorbaAccess().loadClass(className); - sff = (PresentationManager.StubFactoryFactory)cls.newInstance(); - } catch (Exception exc) { - // Use the default. Log the error as a warning. - staticWrapper.errorInSettingDynamicStubFactoryFactory( - exc, className ) ; - } - - return sff ; - } - } - ) ; + PresentationManager.StubFactoryFactory dynamicStubFactoryFactory = null; PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ; pm.setStubFactoryFactory( false, diff --git a/corba/src/java.corba/share/classes/sun/corba/SharedSecrets.java b/corba/src/java.corba/share/classes/sun/corba/SharedSecrets.java index aba3ee0767a..b4c56080f9f 100644 --- a/corba/src/java.corba/share/classes/sun/corba/SharedSecrets.java +++ b/corba/src/java.corba/share/classes/sun/corba/SharedSecrets.java @@ -28,7 +28,9 @@ package sun.corba; import com.sun.corba.se.impl.io.ValueUtility; import sun.misc.Unsafe; +import java.lang.reflect.Field; import java.security.AccessController; +import java.security.PrivilegedAction; /** A repository of "shared secrets", which are a mechanism for calling implementation-private methods in another package without @@ -41,9 +43,23 @@ import java.security.AccessController; // SharedSecrets cloned in corba repo to avoid build issues public class SharedSecrets { - private static final Unsafe unsafe = Unsafe.getUnsafe(); + private static final Unsafe unsafe = getUnsafe(); private static JavaCorbaAccess javaCorbaAccess; + private static Unsafe getUnsafe() { + PrivilegedAction pa = () -> { + Class unsafeClass = sun.misc.Unsafe.class ; + try { + Field f = unsafeClass.getDeclaredField("theUnsafe"); + f.setAccessible(true); + return (Unsafe) f.get(null); + } catch (Exception e) { + throw new Error(e); + } + }; + return AccessController.doPrivileged(pa); + } + public static JavaCorbaAccess getJavaCorbaAccess() { if (javaCorbaAccess == null) { // Ensure ValueUtility is initialized; we know that that class diff --git a/hotspot/.hgtags b/hotspot/.hgtags index d53cf114653..48d17c8f8ae 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -449,3 +449,8 @@ c363a8b87e477ee45d6d3cb2a36cb365141bc596 jdk9-b38 43a44b56dca61a4d766a20f0528fdd8b5ceff873 jdk9-b44 5dc8184af1e2bb30b0103113d1f1a58a21a80c37 jdk9-b45 a184ee1d717297bd35b7c3e35393e137921a3ed2 jdk9-b46 +3b241fb72b8925b75941d612db762a6d5da66d02 jdk9-b47 +cc775a4a24c7f5d9e624b4205e9fbd48a17331f6 jdk9-b48 +360cd1fc42f10941a9fd17cc32d5b85a22d12a0b jdk9-b49 +e0947f58c9c1426aa0d98b98ebb78357b27a7b99 jdk9-b50 +403b9cbadb04d3d1201823591cf931dc93b38e3a jdk9-b51 diff --git a/hotspot/agent/src/os/linux/ps_proc.c b/hotspot/agent/src/os/linux/ps_proc.c index a3c18c9e0de..7d9d2611c3b 100644 --- a/hotspot/agent/src/os/linux/ps_proc.c +++ b/hotspot/agent/src/os/linux/ps_proc.c @@ -27,9 +27,11 @@ #include #include #include +#include #include #include #include +#include #include "libproc_impl.h" #if defined(x86_64) && !defined(amd64) @@ -138,6 +140,15 @@ static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct use return false; } return true; +#elif defined(PTRACE_GETREGSET) + struct iovec iov; + iov.iov_base = user; + iov.iov_len = sizeof(*user); + if (ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, (void*) &iov) < 0) { + print_debug("ptrace(PTRACE_GETREGSET, ...) failed for lwp %d\n", pid); + return false; + } + return true; #else print_debug("ptrace(PTRACE_GETREGS, ...) not supported\n"); return false; diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java index 7510d08bfd0..cefdcf2aa30 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -44,15 +44,22 @@ public class SymbolTable extends sun.jvm.hotspot.utilities.Hashtable { private static synchronized void initialize(TypeDataBase db) { Type type = db.lookupType("SymbolTable"); theTableField = type.getAddressField("_the_table"); + sharedTableField = type.getAddressField("_shared_table"); } // Fields private static AddressField theTableField; + private static AddressField sharedTableField; + + private CompactHashTable sharedTable; // Accessors public static SymbolTable getTheTable() { Address tmp = theTableField.getValue(); - return (SymbolTable) VMObjectFactory.newObject(SymbolTable.class, tmp); + SymbolTable table = (SymbolTable) VMObjectFactory.newObject(SymbolTable.class, tmp); + Address shared = sharedTableField.getStaticFieldAddress(); + table.sharedTable = (CompactHashTable)VMObjectFactory.newObject(CompactHashTable.class, shared); + return table; } public SymbolTable(Address addr) { @@ -73,8 +80,9 @@ public class SymbolTable extends sun.jvm.hotspot.utilities.Hashtable { /** Clone of VM's "temporary" probe routine, as the SA currently does not support mutation so lookup() would have no effect - anyway. Returns null if the given string is not in the symbol - table. */ + anyway. Searches the regular symbol table and the shared symbol + table. Null is returned if the given name is not found in both + tables. */ public Symbol probe(byte[] name) { long hashValue = hashSymbol(name); for (HashtableEntry e = (HashtableEntry) bucket(hashToIndex(hashValue)); e != null; e = (HashtableEntry) e.next()) { @@ -85,7 +93,8 @@ public class SymbolTable extends sun.jvm.hotspot.utilities.Hashtable { } } } - return null; + + return sharedTable.probe(name, hashValue); } public interface SymbolVisitor { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java index 954052703c8..771f95377ca 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java @@ -423,12 +423,22 @@ public class ClassWriter implements /* imports */ ClassConstants protected void writeMethods() throws IOException { MethodArray methods = klass.getMethods(); - final int len = methods.length(); + ArrayList valid_methods = new ArrayList(); + for (int i = 0; i < methods.length(); i++) { + Method m = methods.at(i); + long accessFlags = m.getAccessFlags(); + // overpass method + if (accessFlags == (JVM_ACC_PUBLIC | JVM_ACC_SYNTHETIC | JVM_ACC_BRIDGE)) { + continue; + } + valid_methods.add(m); + } + final int len = valid_methods.size(); // write number of methods dos.writeShort((short) len); if (DEBUG) debugMessage("number of methods = " + len); for (int m = 0; m < len; m++) { - writeMethod(methods.at(m)); + writeMethod(valid_methods.get(m)); } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java new file mode 100644 index 00000000000..d17c980bc7d --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package sun.jvm.hotspot.utilities; + +import java.util.*; +import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.oops.*; +import sun.jvm.hotspot.types.*; +import sun.jvm.hotspot.runtime.*; +import sun.jvm.hotspot.utilities.*; + +public class CompactHashTable extends VMObject { + static { + VM.registerVMInitializedObserver(new Observer() { + public void update(Observable o, Object data) { + initialize(VM.getVM().getTypeDataBase()); + } + }); + } + + private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { + Type type = db.lookupType("SymbolCompactHashTable"); + baseAddressField = type.getAddressField("_base_address"); + bucketCountField = type.getCIntegerField("_bucket_count"); + tableEndOffsetField = type.getCIntegerField("_table_end_offset"); + bucketsField = type.getAddressField("_buckets"); + uintSize = db.lookupType("juint").getSize(); + } + + // Fields + private static CIntegerField bucketCountField; + private static CIntegerField tableEndOffsetField; + private static AddressField baseAddressField; + private static AddressField bucketsField; + private static long uintSize; + + private static int BUCKET_OFFSET_MASK = 0x3FFFFFFF; + private static int BUCKET_TYPE_SHIFT = 30; + private static int COMPACT_BUCKET_TYPE = 1; + + public CompactHashTable(Address addr) { + super(addr); + } + + private int bucketCount() { + return (int)bucketCountField.getValue(addr); + } + + private int tableEndOffset() { + return (int)tableEndOffsetField.getValue(addr); + } + + private boolean isCompactBucket(int bucket_info) { + return (bucket_info >> BUCKET_TYPE_SHIFT) == COMPACT_BUCKET_TYPE; + } + + private int bucketOffset(int bucket_info) { + return bucket_info & BUCKET_OFFSET_MASK; + } + + public Symbol probe(byte[] name, long hash) { + long symOffset; + Symbol sym; + Address baseAddress = baseAddressField.getValue(addr); + Address bucket = bucketsField.getValue(addr); + Address bucketEnd = bucket; + long index = hash % bucketCount(); + int bucketInfo = (int)bucket.getCIntegerAt(index * uintSize, uintSize, true); + int bucketOffset = bucketOffset(bucketInfo); + int nextBucketInfo = (int)bucket.getCIntegerAt((index+1) * uintSize, uintSize, true); + int nextBucketOffset = bucketOffset(nextBucketInfo); + + bucket = bucket.addOffsetTo(bucketOffset * uintSize); + + if (isCompactBucket(bucketInfo)) { + symOffset = bucket.getCIntegerAt(0, uintSize, true); + sym = Symbol.create(baseAddress.addOffsetTo(symOffset)); + if (sym.equals(name)) { + return sym; + } + } else { + bucketEnd = bucket.addOffsetTo(nextBucketOffset * uintSize); + while (bucket.lessThan(bucketEnd)) { + long symHash = bucket.getCIntegerAt(0, uintSize, true); + if (symHash == hash) { + symOffset = bucket.getCIntegerAt(uintSize, uintSize, true); + Address symAddr = baseAddress.addOffsetTo(symOffset); + sym = Symbol.create(symAddr); + if (sym.equals(name)) { + return sym; + } + } + bucket = bucket.addOffsetTo(2 * uintSize); + } + } + return null; + } +} diff --git a/hotspot/make/aix/Makefile b/hotspot/make/aix/Makefile index e0150749678..bbb92c9d75d 100644 --- a/hotspot/make/aix/Makefile +++ b/hotspot/make/aix/Makefile @@ -246,8 +246,7 @@ endif XSLT_CHECK = $(REMOTE) $(RUN.JAVAP) javax.xml.transform.TransformerFactory # If not found then fail fast. check_j2se_version: - $(QUIETLY) $(XSLT_CHECK) > /dev/null 2>&1; \ - if [ $$? -ne 0 ]; then \ + $(QUIETLY) if ! $(XSLT_CHECK) > /dev/null 2>&1; then \ $(REMOTE) $(RUN.JAVA) -version; \ echo "*** An XSLT processor (J2SE 1.4.x or newer) is required" \ "to bootstrap this build" 1>&2; \ diff --git a/hotspot/make/aix/makefiles/mapfile-vers-debug b/hotspot/make/aix/makefiles/mapfile-vers-debug index 348c128e434..81c7c5b7fd2 100644 --- a/hotspot/make/aix/makefiles/mapfile-vers-debug +++ b/hotspot/make/aix/makefiles/mapfile-vers-debug @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 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 @@ -62,11 +62,6 @@ SUNWprivate_1.1 { JVM_DefineClassWithSourceCond; JVM_DesiredAssertionStatus; JVM_DoPrivileged; - JVM_DTraceGetVersion; - JVM_DTraceActivate; - JVM_DTraceIsProbeEnabled; - JVM_DTraceIsSupported; - JVM_DTraceDispose; JVM_DumpAllStacks; JVM_DumpThreads; JVM_FillInStackTrace; @@ -132,6 +127,7 @@ SUNWprivate_1.1 { JVM_GetMethodIxSignatureUTF; JVM_GetMethodParameters; JVM_GetMethodTypeAnnotations; + JVM_GetNanoTimeAdjustment; JVM_GetPrimitiveArrayElement; JVM_GetProtectionDomain; JVM_GetStackAccessControlContext; diff --git a/hotspot/make/aix/makefiles/mapfile-vers-product b/hotspot/make/aix/makefiles/mapfile-vers-product index 25bd5bfff7c..745901bb4d6 100644 --- a/hotspot/make/aix/makefiles/mapfile-vers-product +++ b/hotspot/make/aix/makefiles/mapfile-vers-product @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 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 @@ -62,11 +62,6 @@ SUNWprivate_1.1 { JVM_DefineClassWithSourceCond; JVM_DesiredAssertionStatus; JVM_DoPrivileged; - JVM_DTraceGetVersion; - JVM_DTraceActivate; - JVM_DTraceIsProbeEnabled; - JVM_DTraceIsSupported; - JVM_DTraceDispose; JVM_DumpAllStacks; JVM_DumpThreads; JVM_FillInStackTrace; @@ -130,6 +125,7 @@ SUNWprivate_1.1 { JVM_GetMethodIxNameUTF; JVM_GetMethodIxSignatureUTF; JVM_GetMethodParameters; + JVM_GetNanoTimeAdjustment; JVM_GetPrimitiveArrayElement; JVM_GetProtectionDomain; JVM_GetStackAccessControlContext; diff --git a/hotspot/make/aix/makefiles/xlc.make b/hotspot/make/aix/makefiles/xlc.make index b6525327528..17a71b60124 100644 --- a/hotspot/make/aix/makefiles/xlc.make +++ b/hotspot/make/aix/makefiles/xlc.make @@ -74,6 +74,12 @@ CFLAGS += -D_REENTRANT # no xlc counterpart for -fcheck-new # CFLAGS += -fcheck-new +# We need to define this on the command line if we want to use the the +# predefined format specifiers from "inttypes.h". Otherwise system headrs +# can indirectly include inttypes.h before we define __STDC_FORMAT_MACROS +# in globalDefinitions.hpp +CFLAGS += -D__STDC_FORMAT_MACROS + ARCHFLAG = -q64 CFLAGS += $(ARCHFLAG) diff --git a/hotspot/make/bsd/Makefile b/hotspot/make/bsd/Makefile index 3f0cfc36344..4d45841475e 100644 --- a/hotspot/make/bsd/Makefile +++ b/hotspot/make/bsd/Makefile @@ -240,8 +240,7 @@ endif XSLT_CHECK = $(REMOTE) $(RUN.JAVAP) javax.xml.transform.TransformerFactory # If not found then fail fast. check_j2se_version: - $(QUIETLY) $(XSLT_CHECK) > /dev/null 2>&1; \ - if [ $$? -ne 0 ]; then \ + $(QUIETLY) if ! $(XSLT_CHECK) > /dev/null 2>&1; then \ $(REMOTE) $(RUN.JAVA) -version; \ echo "*** An XSLT processor (J2SE 1.4.x or newer) is required" \ "to bootstrap this build" 1>&2; \ diff --git a/hotspot/make/bsd/makefiles/dtrace.make b/hotspot/make/bsd/makefiles/dtrace.make index dbb41163e39..80eb4d9a873 100644 --- a/hotspot/make/bsd/makefiles/dtrace.make +++ b/hotspot/make/bsd/makefiles/dtrace.make @@ -179,23 +179,23 @@ $(GENOFFS): $(DTRACE_SRCDIR)/$(GENOFFS)Main.c lib$(GENOFFS).dylib # $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs. $(JVMOFFS).h: $(GENOFFS) $(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -header > $@.tmp; touch $@; \ - if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \ - then rm -f $@; mv $@.tmp $@; \ - else rm -f $@.tmp; \ + if diff $@.tmp $@ > /dev/null 2>&1 ; \ + then rm -f $@.tmp; \ + else rm -f $@; mv $@.tmp $@; \ fi $(JVMOFFS)Index.h: $(GENOFFS) $(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -index > $@.tmp; touch $@; \ - if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \ - then rm -f $@; mv $@.tmp $@; \ - else rm -f $@.tmp; \ + if diff $@.tmp $@ > /dev/null 2>&1 ; \ + then rm -f $@.tmp; \ + else rm -f $@; mv $@.tmp $@; \ fi $(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h $(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -table > $@.tmp; touch $@; \ - if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \ - then rm -f $@; mv $@.tmp $@; \ - else rm -f $@.tmp; \ + if diff $@.tmp $@ > /dev/null 2>&1; \ + then rm -f $@.tmp; \ + else rm -f $@; mv $@.tmp $@; \ fi $(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp diff --git a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug index ba3e771364c..99880a19f4a 100644 --- a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug +++ b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-debug @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 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 @@ -60,11 +60,6 @@ _JVM_DefineClassWithSourceCond _JVM_DesiredAssertionStatus _JVM_DoPrivileged - _JVM_DTraceGetVersion - _JVM_DTraceActivate - _JVM_DTraceIsProbeEnabled - _JVM_DTraceIsSupported - _JVM_DTraceDispose _JVM_DumpAllStacks _JVM_DumpThreads _JVM_FillInStackTrace @@ -130,6 +125,7 @@ _JVM_GetMethodIxSignatureUTF _JVM_GetMethodParameters _JVM_GetMethodTypeAnnotations + _JVM_GetNanoTimeAdjustment _JVM_GetPrimitiveArrayElement _JVM_GetProtectionDomain _JVM_GetStackAccessControlContext diff --git a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product index ba3e771364c..99880a19f4a 100644 --- a/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product +++ b/hotspot/make/bsd/makefiles/mapfile-vers-darwin-product @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 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 @@ -60,11 +60,6 @@ _JVM_DefineClassWithSourceCond _JVM_DesiredAssertionStatus _JVM_DoPrivileged - _JVM_DTraceGetVersion - _JVM_DTraceActivate - _JVM_DTraceIsProbeEnabled - _JVM_DTraceIsSupported - _JVM_DTraceDispose _JVM_DumpAllStacks _JVM_DumpThreads _JVM_FillInStackTrace @@ -130,6 +125,7 @@ _JVM_GetMethodIxSignatureUTF _JVM_GetMethodParameters _JVM_GetMethodTypeAnnotations + _JVM_GetNanoTimeAdjustment _JVM_GetPrimitiveArrayElement _JVM_GetProtectionDomain _JVM_GetStackAccessControlContext diff --git a/hotspot/make/bsd/makefiles/mapfile-vers-debug b/hotspot/make/bsd/makefiles/mapfile-vers-debug index fc05d864ad6..950cf57a64a 100644 --- a/hotspot/make/bsd/makefiles/mapfile-vers-debug +++ b/hotspot/make/bsd/makefiles/mapfile-vers-debug @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 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 @@ -62,11 +62,6 @@ SUNWprivate_1.1 { JVM_DefineClassWithSourceCond; JVM_DesiredAssertionStatus; JVM_DoPrivileged; - JVM_DTraceGetVersion; - JVM_DTraceActivate; - JVM_DTraceIsProbeEnabled; - JVM_DTraceIsSupported; - JVM_DTraceDispose; JVM_DumpAllStacks; JVM_DumpThreads; JVM_FillInStackTrace; @@ -132,6 +127,7 @@ SUNWprivate_1.1 { JVM_GetMethodIxSignatureUTF; JVM_GetMethodParameters; JVM_GetMethodTypeAnnotations; + JVM_GetNanoTimeAdjustment; JVM_GetPrimitiveArrayElement; JVM_GetProtectionDomain; JVM_GetStackAccessControlContext; diff --git a/hotspot/make/bsd/makefiles/mapfile-vers-product b/hotspot/make/bsd/makefiles/mapfile-vers-product index fc05d864ad6..950cf57a64a 100644 --- a/hotspot/make/bsd/makefiles/mapfile-vers-product +++ b/hotspot/make/bsd/makefiles/mapfile-vers-product @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 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 @@ -62,11 +62,6 @@ SUNWprivate_1.1 { JVM_DefineClassWithSourceCond; JVM_DesiredAssertionStatus; JVM_DoPrivileged; - JVM_DTraceGetVersion; - JVM_DTraceActivate; - JVM_DTraceIsProbeEnabled; - JVM_DTraceIsSupported; - JVM_DTraceDispose; JVM_DumpAllStacks; JVM_DumpThreads; JVM_FillInStackTrace; @@ -132,6 +127,7 @@ SUNWprivate_1.1 { JVM_GetMethodIxSignatureUTF; JVM_GetMethodParameters; JVM_GetMethodTypeAnnotations; + JVM_GetNanoTimeAdjustment; JVM_GetPrimitiveArrayElement; JVM_GetProtectionDomain; JVM_GetStackAccessControlContext; diff --git a/hotspot/make/bsd/makefiles/universal.gmk b/hotspot/make/bsd/makefiles/universal.gmk index 12a34d70157..40868adf849 100644 --- a/hotspot/make/bsd/makefiles/universal.gmk +++ b/hotspot/make/bsd/makefiles/universal.gmk @@ -59,7 +59,7 @@ universalize: $(UNIVERSAL_LIPO_LIST) $(UNIVERSAL_COPY_LIST) # Package built libraries in a universal binary $(UNIVERSAL_LIPO_LIST): - BUILT_LIPO_FILES="`find $(EXPORT_JRE_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@) 2>/dev/null`"; \ + BUILT_LIPO_FILES="`find $(EXPORT_JRE_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@) 2>/dev/null`" || test $$? = "1"; \ if [ -n "$${BUILT_LIPO_FILES}" ]; then \ $(MKDIR) -p $(shell dirname $@); \ lipo -create -output $@ $${BUILT_LIPO_FILES}; \ @@ -70,7 +70,7 @@ $(UNIVERSAL_LIPO_LIST): # - copies directories; including empty dirs # - copies files, symlinks, other non-directory files $(UNIVERSAL_COPY_LIST): - BUILT_COPY_FILES="`find $(EXPORT_JRE_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@) -prune 2>/dev/null`"; \ + BUILT_COPY_FILES="`find $(EXPORT_JRE_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@) -prune 2>/dev/null`" || test $$? = "1"; \ if [ -n "$${BUILT_COPY_FILES}" ]; then \ for i in $${BUILT_COPY_FILES}; do \ $(MKDIR) -p $(shell dirname $@); \ diff --git a/hotspot/make/linux/Makefile b/hotspot/make/linux/Makefile index c3ed19f09f1..33ed65db9b8 100644 --- a/hotspot/make/linux/Makefile +++ b/hotspot/make/linux/Makefile @@ -246,8 +246,7 @@ endif XSLT_CHECK = $(REMOTE) $(RUN.JAVAP) javax.xml.transform.TransformerFactory # If not found then fail fast. check_j2se_version: - $(QUIETLY) $(XSLT_CHECK) > /dev/null 2>&1; \ - if [ $$? -ne 0 ]; then \ + $(QUIETLY) if ! $(XSLT_CHECK) > /dev/null 2>&1; then \ $(REMOTE) $(RUN.JAVA) -version; \ echo "*** An XSLT processor (J2SE 1.4.x or newer) is required" \ "to bootstrap this build" 1>&2; \ diff --git a/hotspot/make/linux/makefiles/build_vm_def.sh b/hotspot/make/linux/makefiles/build_vm_def.sh deleted file mode 100644 index ea81ff6c22f..00000000000 --- a/hotspot/make/linux/makefiles/build_vm_def.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -# If we're cross compiling use that path for nm -if [ "$CROSS_COMPILE_ARCH" != "" ]; then -NM=$ALT_COMPILER_PATH/nm -else -NM=nm -fi - -$NM --defined-only $* \ - | awk '{ - if ($3 ~ /^_ZTV/ || $3 ~ /^gHotSpotVM/) print "\t" $3 ";" - if ($3 ~ /^UseSharedSpaces$/) print "\t" $3 ";" - if ($3 ~ /^_ZN9Arguments17SharedArchivePathE$/) print "\t" $3 ";" - }' \ - | sort -u diff --git a/hotspot/make/linux/makefiles/mapfile-vers-debug b/hotspot/make/linux/makefiles/mapfile-vers-debug index fc05d864ad6..950cf57a64a 100644 --- a/hotspot/make/linux/makefiles/mapfile-vers-debug +++ b/hotspot/make/linux/makefiles/mapfile-vers-debug @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 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 @@ -62,11 +62,6 @@ SUNWprivate_1.1 { JVM_DefineClassWithSourceCond; JVM_DesiredAssertionStatus; JVM_DoPrivileged; - JVM_DTraceGetVersion; - JVM_DTraceActivate; - JVM_DTraceIsProbeEnabled; - JVM_DTraceIsSupported; - JVM_DTraceDispose; JVM_DumpAllStacks; JVM_DumpThreads; JVM_FillInStackTrace; @@ -132,6 +127,7 @@ SUNWprivate_1.1 { JVM_GetMethodIxSignatureUTF; JVM_GetMethodParameters; JVM_GetMethodTypeAnnotations; + JVM_GetNanoTimeAdjustment; JVM_GetPrimitiveArrayElement; JVM_GetProtectionDomain; JVM_GetStackAccessControlContext; diff --git a/hotspot/make/linux/makefiles/mapfile-vers-product b/hotspot/make/linux/makefiles/mapfile-vers-product index fc05d864ad6..950cf57a64a 100644 --- a/hotspot/make/linux/makefiles/mapfile-vers-product +++ b/hotspot/make/linux/makefiles/mapfile-vers-product @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 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 @@ -62,11 +62,6 @@ SUNWprivate_1.1 { JVM_DefineClassWithSourceCond; JVM_DesiredAssertionStatus; JVM_DoPrivileged; - JVM_DTraceGetVersion; - JVM_DTraceActivate; - JVM_DTraceIsProbeEnabled; - JVM_DTraceIsSupported; - JVM_DTraceDispose; JVM_DumpAllStacks; JVM_DumpThreads; JVM_FillInStackTrace; @@ -132,6 +127,7 @@ SUNWprivate_1.1 { JVM_GetMethodIxSignatureUTF; JVM_GetMethodParameters; JVM_GetMethodTypeAnnotations; + JVM_GetNanoTimeAdjustment; JVM_GetPrimitiveArrayElement; JVM_GetProtectionDomain; JVM_GetStackAccessControlContext; diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make index a138a163f20..d0c31ca125c 100644 --- a/hotspot/make/linux/makefiles/vm.make +++ b/hotspot/make/linux/makefiles/vm.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 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 @@ -239,8 +239,14 @@ mapfile_reorder : mapfile $(REORDERFILE) rm -f $@ cat $^ > $@ +VMDEF_PAT = ^_ZTV +VMDEF_PAT := ^gHotSpotVM|$(VMDEF_PAT) +VMDEF_PAT := ^UseSharedSpaces$$|$(VMDEF_PAT) +VMDEF_PAT := ^_ZN9Arguments17SharedArchivePathE$$|$(VMDEF_PAT) + vm.def: $(Res_Files) $(Obj_Files) - sh $(GAMMADIR)/make/linux/makefiles/build_vm_def.sh *.o > $@ + $(QUIETLY) $(NM) --defined-only $(Obj_Files) | sort -k3 -u | \ + awk '$$3 ~ /$(VMDEF_PAT)/ { print "\t" $$3 ";" }' > $@ mapfile_ext: rm -f $@ @@ -334,10 +340,8 @@ $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT) rm -f $@.1; ln -s $@ $@.1; \ if [ \"$(CROSS_COMPILE_ARCH)\" = \"\" ] ; then \ if [ -x /usr/sbin/selinuxenabled ] ; then \ - /usr/sbin/selinuxenabled; \ - if [ $$? = 0 ] ; then \ - /usr/bin/chcon -t textrel_shlib_t $@; \ - if [ $$? != 0 ]; then \ + if /usr/sbin/selinuxenabled; then \ + if ! /usr/bin/chcon -t textrel_shlib_t $@; then \ echo "ERROR: Cannot chcon $@"; \ fi \ fi \ diff --git a/hotspot/make/sa.files b/hotspot/make/sa.files index fa807c36dfc..dfe1e53a209 100644 --- a/hotspot/make/sa.files +++ b/hotspot/make/sa.files @@ -39,6 +39,7 @@ $(AGENT_SRC_DIR)/sun/jvm/hotspot/asm/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/asm/sparc/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/c1/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/ci/*.java \ +$(AGENT_SRC_DIR)/sun/jvm/hotspot/classfile/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/code/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/compiler/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/*.java \ @@ -49,8 +50,10 @@ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/bsd/x86/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/cdbg/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/cdbg/basic/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/dummy/*.java \ +$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/ia64/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/amd64/*.java \ +$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/ia64/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/ppc64/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/x86/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/sparc/*.java \ @@ -71,6 +74,7 @@ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/sparc/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/win32/coff/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windbg/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windbg/amd64/*.java \ +$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windbg/ia64/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windbg/x86/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windows/x86/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windows/amd64/*.java \ @@ -101,6 +105,8 @@ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/solaris_sparc/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/solaris_x86/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/sparc/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/x86/*.java \ +$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/win32_amd64/*.java \ +$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/win32_x86/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/ppc64/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/tools/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/tools/jcore/*.java \ diff --git a/hotspot/make/solaris/Makefile b/hotspot/make/solaris/Makefile index 869db69646d..f8fb06c8725 100644 --- a/hotspot/make/solaris/Makefile +++ b/hotspot/make/solaris/Makefile @@ -190,8 +190,7 @@ endif XSLT_CHECK = $(RUN.JAVAP) javax.xml.transform.TransformerFactory # If not found then fail fast. check_j2se_version: - $(QUIETLY) $(XSLT_CHECK) > /dev/null 2>&1; \ - if [ $$? -ne 0 ]; then \ + $(QUIETLY) if ! $(XSLT_CHECK) > /dev/null 2>&1; then \ $(RUN.JAVA) -version; \ echo "*** An XSLT processor (J2SE 1.4.x or newer) is required" \ "to bootstrap this build" 1>&2; \ diff --git a/hotspot/make/solaris/makefiles/dtrace.make b/hotspot/make/solaris/makefiles/dtrace.make index be6e71dba9e..1da02fa01c4 100644 --- a/hotspot/make/solaris/makefiles/dtrace.make +++ b/hotspot/make/solaris/makefiles/dtrace.make @@ -171,11 +171,11 @@ $(GENOFFS): $(DTRACE_SRCDIR)/$(GENOFFS)Main.c lib$(GENOFFS).so ./lib$(GENOFFS).so CONDITIONALLY_UPDATE_JVMOFFS_TARGET = \ - cmp -s $@ $@.tmp; \ - case $$? in \ - 0) rm -f $@.tmp;; \ - *) rm -f $@ && mv $@.tmp $@ && echo Updated $@;; \ - esac + if cmp -s $@ $@.tmp; then \ + rm -f $@.tmp; \ + else \ + rm -f $@ && mv $@.tmp $@ && echo Updated $@; \ + fi # $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs. $(JVMOFFS).h: $(GENOFFS) @@ -336,16 +336,10 @@ $(DTRACE_JHELPER.o) : $(DTRACE_JHELPER).d $(JVMOFFS).h $(JVMOFFS)Index.h .PHONY: dtraceCheck -SYSTEM_DTRACE_H = /usr/include/dtrace.h SYSTEM_DTRACE_PROG = /usr/sbin/dtrace PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG}) patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG}) -systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H)) - -ifneq ("$(systemDtraceHdrFound)", "") -CFLAGS += -DHAVE_DTRACE_H -endif ifneq ("$(patchDtraceFound)", "") DTRACE_PROG=$(PATCH_DTRACE_PROG) diff --git a/hotspot/make/solaris/makefiles/mapfile-vers b/hotspot/make/solaris/makefiles/mapfile-vers index 082b9f0e052..1d7838465f2 100644 --- a/hotspot/make/solaris/makefiles/mapfile-vers +++ b/hotspot/make/solaris/makefiles/mapfile-vers @@ -1,5 +1,5 @@ # -# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 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 @@ -62,11 +62,6 @@ SUNWprivate_1.1 { JVM_DefineClassWithSourceCond; JVM_DesiredAssertionStatus; JVM_DoPrivileged; - JVM_DTraceGetVersion; - JVM_DTraceActivate; - JVM_DTraceIsProbeEnabled; - JVM_DTraceIsSupported; - JVM_DTraceDispose; JVM_DumpAllStacks; JVM_DumpThreads; JVM_FillInStackTrace; @@ -132,6 +127,7 @@ SUNWprivate_1.1 { JVM_GetMethodIxSignatureUTF; JVM_GetMethodParameters; JVM_GetMethodTypeAnnotations; + JVM_GetNanoTimeAdjustment; JVM_GetPrimitiveArrayElement; JVM_GetProtectionDomain; JVM_GetStackAccessControlContext; diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp index 7d9aecb310f..f1087dbc02c 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. 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 @@ -284,19 +284,20 @@ class Assembler : public AbstractAssembler { MTCTR_OPCODE = (MTSPR_OPCODE | 9 << SPR_0_4_SHIFT), MFCTR_OPCODE = (MFSPR_OPCODE | 9 << SPR_0_4_SHIFT), - MTTFHAR_OPCODE = (MTSPR_OPCODE | 128 << SPR_0_4_SHIFT), - MFTFHAR_OPCODE = (MFSPR_OPCODE | 128 << SPR_0_4_SHIFT), - MTTFIAR_OPCODE = (MTSPR_OPCODE | 129 << SPR_0_4_SHIFT), - MFTFIAR_OPCODE = (MFSPR_OPCODE | 129 << SPR_0_4_SHIFT), - MTTEXASR_OPCODE = (MTSPR_OPCODE | 130 << SPR_0_4_SHIFT), - MFTEXASR_OPCODE = (MFSPR_OPCODE | 130 << SPR_0_4_SHIFT), - MTTEXASRU_OPCODE = (MTSPR_OPCODE | 131 << SPR_0_4_SHIFT), - MFTEXASRU_OPCODE = (MFSPR_OPCODE | 131 << SPR_0_4_SHIFT), + // Attention: Higher and lower half are inserted in reversed order. + MTTFHAR_OPCODE = (MTSPR_OPCODE | 4 << SPR_5_9_SHIFT | 0 << SPR_0_4_SHIFT), + MFTFHAR_OPCODE = (MFSPR_OPCODE | 4 << SPR_5_9_SHIFT | 0 << SPR_0_4_SHIFT), + MTTFIAR_OPCODE = (MTSPR_OPCODE | 4 << SPR_5_9_SHIFT | 1 << SPR_0_4_SHIFT), + MFTFIAR_OPCODE = (MFSPR_OPCODE | 4 << SPR_5_9_SHIFT | 1 << SPR_0_4_SHIFT), + MTTEXASR_OPCODE = (MTSPR_OPCODE | 4 << SPR_5_9_SHIFT | 2 << SPR_0_4_SHIFT), + MFTEXASR_OPCODE = (MFSPR_OPCODE | 4 << SPR_5_9_SHIFT | 2 << SPR_0_4_SHIFT), + MTTEXASRU_OPCODE = (MTSPR_OPCODE | 4 << SPR_5_9_SHIFT | 3 << SPR_0_4_SHIFT), + MFTEXASRU_OPCODE = (MFSPR_OPCODE | 4 << SPR_5_9_SHIFT | 3 << SPR_0_4_SHIFT), - MTVRSAVE_OPCODE = (MTSPR_OPCODE | 256 << SPR_0_4_SHIFT), - MFVRSAVE_OPCODE = (MFSPR_OPCODE | 256 << SPR_0_4_SHIFT), + MTVRSAVE_OPCODE = (MTSPR_OPCODE | 8 << SPR_5_9_SHIFT | 0 << SPR_0_4_SHIFT), + MFVRSAVE_OPCODE = (MFSPR_OPCODE | 8 << SPR_5_9_SHIFT | 0 << SPR_0_4_SHIFT), - MFTB_OPCODE = (MFSPR_OPCODE | 268 << SPR_0_4_SHIFT), + MFTB_OPCODE = (MFSPR_OPCODE | 8 << SPR_5_9_SHIFT | 12 << SPR_0_4_SHIFT), MTCRF_OPCODE = (31u << OPCODE_SHIFT | 144u << 1), MFCR_OPCODE = (31u << OPCODE_SHIFT | 19u << 1), @@ -1494,6 +1495,26 @@ class Assembler : public AbstractAssembler { inline void mftexasr(Register d); inline void mftexasru(Register d); + // TEXASR bit description + enum transaction_failure_reason { + // Upper half (TEXASRU): + tm_failure_persistent = 7, // The failure is likely to recur on each execution. + tm_disallowed = 8, // The instruction is not permitted. + tm_nesting_of = 9, // The maximum transaction level was exceeded. + tm_footprint_of = 10, // The tracking limit for transactional storage accesses was exceeded. + tm_self_induced_cf = 11, // A self-induced conflict occurred in Suspended state. + tm_non_trans_cf = 12, // A conflict occurred with a non-transactional access by another processor. + tm_trans_cf = 13, // A conflict occurred with another transaction. + tm_translation_cf = 14, // A conflict occurred with a TLB invalidation. + tm_inst_fetch_cf = 16, // An instruction fetch was performed from a block that was previously written transactionally. + tm_tabort = 31, // Termination was caused by the execution of an abort instruction. + // Lower half: + tm_suspended = 32, // Failure was recorded in Suspended state. + tm_failure_summary = 36, // Failure has been detected and recorded. + tm_tfiar_exact = 37, // Value in the TFIAR is exact. + tm_rot = 38, // Rollback-only transaction. + }; + // PPC 1, section 2.4.1 Branch Instructions inline void b( address a, relocInfo::relocType rt = relocInfo::none); inline void b( Label& L); @@ -1581,6 +1602,7 @@ class Assembler : public AbstractAssembler { inline void bnectrl(ConditionRegister crx, relocInfo::relocType rt = relocInfo::none); // condition register logic instructions + // NOTE: There's a preferred form: d and s2 should point into the same condition register. inline void crand( int d, int s1, int s2); inline void crnand(int d, int s1, int s2); inline void cror( int d, int s1, int s2); @@ -1590,6 +1612,19 @@ class Assembler : public AbstractAssembler { inline void crandc(int d, int s1, int s2); inline void crorc( int d, int s1, int s2); + // More convenient version. + int condition_register_bit(ConditionRegister cr, Condition c) { + return 4 * (int)(intptr_t)cr + c; + } + void crand( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc); + void crnand(ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc); + void cror( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc); + void crxor( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc); + void crnor( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc); + void creqv( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc); + void crandc(ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc); + void crorc( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc); + // icache and dcache related instructions inline void icbi( Register s1, Register s2); //inline void dcba(Register s1, Register s2); // Instruction for embedded processor only. @@ -1673,6 +1708,10 @@ class Assembler : public AbstractAssembler { inline void smt_prio_low(); inline void smt_prio_medium_low(); inline void smt_prio_medium(); + // >= Power7 + inline void smt_yield(); + inline void smt_mdoio(); + inline void smt_mdoom(); // trap instructions inline void twi_0(Register a); // for load with acquire semantics use load+twi_0+isync (trap can't occur) @@ -1958,6 +1997,7 @@ class Assembler : public AbstractAssembler { inline void tbeginrot_(); // R=1 Rollback-Only Transaction inline void tend_(); // A=0 inline void tendall_(); // A=1 + inline void tabort_(); inline void tabort_(Register a); inline void tabortwc_(int t, Register a, Register b); inline void tabortwci_(int t, Register a, int si); @@ -1967,6 +2007,10 @@ class Assembler : public AbstractAssembler { inline void tresume_(); // tsr with L=1 inline void tcheck(int f); + static bool is_tbegin(int x) { + return TBEGIN_OPCODE == (x & (0x3f << OPCODE_SHIFT | 0x3ff << 1)); + } + // The following encoders use r0 as second operand. These instructions // read r0 as '0'. inline void lwzx( Register d, Register s2); diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp index b4a7370994d..5493f124371 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. 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 @@ -453,6 +453,48 @@ inline void Assembler::creqv( int d, int s1, int s2) { emit_int32(CREQV_OPCODE inline void Assembler::crandc(int d, int s1, int s2) { emit_int32(CRANDC_OPCODE | bt(d) | ba(s1) | bb(s2)); } inline void Assembler::crorc( int d, int s1, int s2) { emit_int32(CRORC_OPCODE | bt(d) | ba(s1) | bb(s2)); } +// More convenient version. +inline void Assembler::crand( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc) { + int dst_bit = condition_register_bit(crdst, cdst), + src_bit = condition_register_bit(crsrc, csrc); + crand(dst_bit, src_bit, dst_bit); +} +inline void Assembler::crnand(ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc) { + int dst_bit = condition_register_bit(crdst, cdst), + src_bit = condition_register_bit(crsrc, csrc); + crnand(dst_bit, src_bit, dst_bit); +} +inline void Assembler::cror( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc) { + int dst_bit = condition_register_bit(crdst, cdst), + src_bit = condition_register_bit(crsrc, csrc); + cror(dst_bit, src_bit, dst_bit); +} +inline void Assembler::crxor( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc) { + int dst_bit = condition_register_bit(crdst, cdst), + src_bit = condition_register_bit(crsrc, csrc); + crxor(dst_bit, src_bit, dst_bit); +} +inline void Assembler::crnor( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc) { + int dst_bit = condition_register_bit(crdst, cdst), + src_bit = condition_register_bit(crsrc, csrc); + crnor(dst_bit, src_bit, dst_bit); +} +inline void Assembler::creqv( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc) { + int dst_bit = condition_register_bit(crdst, cdst), + src_bit = condition_register_bit(crsrc, csrc); + creqv(dst_bit, src_bit, dst_bit); +} +inline void Assembler::crandc(ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc) { + int dst_bit = condition_register_bit(crdst, cdst), + src_bit = condition_register_bit(crsrc, csrc); + crandc(dst_bit, src_bit, dst_bit); +} +inline void Assembler::crorc( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc) { + int dst_bit = condition_register_bit(crdst, cdst), + src_bit = condition_register_bit(crsrc, csrc); + crorc(dst_bit, src_bit, dst_bit); +} + // Conditional move (>= Power7) inline void Assembler::isel(Register d, ConditionRegister cr, Condition cc, bool inv, Register a, Register b) { if (b == noreg) { @@ -516,6 +558,10 @@ inline void Assembler::smt_prio_medium_low() { Assembler::or_unchecked(R6, R6, inline void Assembler::smt_prio_medium() { Assembler::or_unchecked(R2, R2, R2); } inline void Assembler::smt_prio_medium_high() { Assembler::or_unchecked(R5, R5, R5); } inline void Assembler::smt_prio_high() { Assembler::or_unchecked(R3, R3, R3); } +// >= Power7 +inline void Assembler::smt_yield() { Assembler::or_unchecked(R27, R27, R27); } +inline void Assembler::smt_mdoio() { Assembler::or_unchecked(R29, R29, R29); } +inline void Assembler::smt_mdoom() { Assembler::or_unchecked(R30, R30, R30); } inline void Assembler::twi_0(Register a) { twi_unchecked(0, a, 0);} @@ -778,7 +824,8 @@ inline void Assembler::tbegin_() { emit_int32( TB inline void Assembler::tbeginrot_() { emit_int32( TBEGIN_OPCODE | /*R=1*/ 1u << (31-10) | rc(1)); } inline void Assembler::tend_() { emit_int32( TEND_OPCODE | rc(1)); } inline void Assembler::tendall_() { emit_int32( TEND_OPCODE | /*A=1*/ 1u << (31-6) | rc(1)); } -inline void Assembler::tabort_(Register a) { emit_int32( TABORT_OPCODE | ra(a) | rc(1)); } +inline void Assembler::tabort_() { emit_int32( TABORT_OPCODE | rc(1)); } +inline void Assembler::tabort_(Register a) { assert(a != R0, "r0 not allowed"); emit_int32( TABORT_OPCODE | ra(a) | rc(1)); } inline void Assembler::tabortwc_(int t, Register a, Register b) { emit_int32( TABORTWC_OPCODE | to(t) | ra(a) | rb(b) | rc(1)); } inline void Assembler::tabortwci_(int t, Register a, int si) { emit_int32( TABORTWCI_OPCODE | to(t) | ra(a) | sh1620(si) | rc(1)); } inline void Assembler::tabortdc_(int t, Register a, Register b) { emit_int32( TABORTDC_OPCODE | to(t) | ra(a) | rb(b) | rc(1)); } diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp index dec0d9732a8..9cb22c11433 100644 --- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. 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 @@ -1712,7 +1712,7 @@ void InterpreterMacroAssembler::profile_obj_type(Register obj, Register mdo_addr andi_(R0, klass, TypeEntries::type_unknown); // Already unknown. Nothing to do anymore. //bne(CCR0, do_nothing); - crorc(/*CCR0 eq*/2, /*CCR1 eq*/4+2, /*CCR0 eq*/2); // cr0 eq = cr1 eq or cr0 ne + crorc(CCR0, Assembler::equal, CCR1, Assembler::equal); // cr0 eq = cr1 eq or cr0 ne beq(CCR0, do_nothing); clrrdi_(R0, tmp, exact_log2(-TypeEntries::type_mask)); @@ -1826,9 +1826,9 @@ void InterpreterMacroAssembler::profile_return_type(Register ret, Register tmp1, lbz(tmp2, Method::intrinsic_id_offset_in_bytes(), R19_method); cmpwi(CCR0, tmp1, Bytecodes::_invokedynamic); cmpwi(CCR1, tmp1, Bytecodes::_invokehandle); - cror(/*CR0 eq*/2, /*CR1 eq*/4+2, /*CR0 eq*/2); + cror(CCR0, Assembler::equal, CCR1, Assembler::equal); cmpwi(CCR1, tmp2, vmIntrinsics::_compiledLambdaForm); - cror(/*CR0 eq*/2, /*CR1 eq*/4+2, /*CR0 eq*/2); + cror(CCR0, Assembler::equal, CCR1, Assembler::equal); bne(CCR0, profile_continue); } diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp index 5c118981415..46216782c97 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp @@ -567,16 +567,21 @@ class MacroAssembler: public Assembler { inline void load_with_trap_null_check(Register d, int si16, Register s1); // Load heap oop and decompress. Loaded oop may not be null. - inline void load_heap_oop_not_null(Register d, RegisterOrConstant offs, Register s1 = noreg); + // Specify tmp to save one cycle. + inline void load_heap_oop_not_null(Register d, RegisterOrConstant offs, Register s1 = noreg, + Register tmp = noreg); + // Store heap oop and decompress. Decompressed oop may not be null. + // Specify tmp register if d should not be changed. inline void store_heap_oop_not_null(Register d, RegisterOrConstant offs, Register s1, - /*specify if d must stay uncompressed*/ Register tmp = noreg); + Register tmp = noreg); // Null allowed. inline void load_heap_oop(Register d, RegisterOrConstant offs, Register s1 = noreg); // Encode/decode heap oop. Oop may not be null, else en/decoding goes wrong. + // src == d allowed. inline Register encode_heap_oop_not_null(Register d, Register src = noreg); - inline void decode_heap_oop_not_null(Register d); + inline Register decode_heap_oop_not_null(Register d, Register src = noreg); // Null allowed. inline void decode_heap_oop(Register d); diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp index 84485d4f6af..f5d19dff066 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp @@ -311,11 +311,14 @@ inline void MacroAssembler::load_with_trap_null_check(Register d, int si16, Regi ld(d, si16, s1); } -inline void MacroAssembler::load_heap_oop_not_null(Register d, RegisterOrConstant offs, Register s1) { +inline void MacroAssembler::load_heap_oop_not_null(Register d, RegisterOrConstant offs, Register s1, Register tmp) { if (UseCompressedOops) { - lwz(d, offs, s1); + // In disjoint mode decoding can save a cycle if src != dst. + Register narrowOop = (tmp != noreg && Universe::narrow_oop_base_disjoint()) ? tmp : d; + lwz(narrowOop, offs, s1); // Attention: no null check here! - decode_heap_oop_not_null(d); + Register res = decode_heap_oop_not_null(d, narrowOop); + assert(res == d, "caller will not consume loaded value"); } else { ld(d, offs, s1); } @@ -340,26 +343,36 @@ inline void MacroAssembler::load_heap_oop(Register d, RegisterOrConstant offs, R } inline Register MacroAssembler::encode_heap_oop_not_null(Register d, Register src) { - Register current = (src!=noreg) ? src : d; // Compressed oop is in d if no src provided. - if (Universe::narrow_oop_base() != NULL) { + Register current = (src != noreg) ? src : d; // Oop to be compressed is in d if no src provided. + if (Universe::narrow_oop_base_overlaps()) { sub(d, current, R30); current = d; } if (Universe::narrow_oop_shift() != 0) { - srdi(d, current, LogMinObjAlignmentInBytes); + rldicl(d, current, 64-Universe::narrow_oop_shift(), 32); // Clears the upper bits. current = d; } return current; // Encoded oop is in this register. } -inline void MacroAssembler::decode_heap_oop_not_null(Register d) { +inline Register MacroAssembler::decode_heap_oop_not_null(Register d, Register src) { + if (Universe::narrow_oop_base_disjoint() && src != noreg && src != d && + Universe::narrow_oop_shift() != 0) { + mr(d, R30); + rldimi(d, src, Universe::narrow_oop_shift(), 32-Universe::narrow_oop_shift()); + return d; + } + + Register current = (src != noreg) ? src : d; // Compressed oop is in d if no src provided. if (Universe::narrow_oop_shift() != 0) { - assert (LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong"); - sldi(d, d, LogMinObjAlignmentInBytes); + sldi(d, current, Universe::narrow_oop_shift()); + current = d; } if (Universe::narrow_oop_base() != NULL) { - add(d, d, R30); + add(d, current, R30); + current = d; } + return current; // Decoded oop is in this register. } inline void MacroAssembler::decode_heap_oop(Register d) { @@ -368,13 +381,7 @@ inline void MacroAssembler::decode_heap_oop(Register d) { cmpwi(CCR0, d, 0); beq(CCR0, isNull); } - if (Universe::narrow_oop_shift() != 0) { - assert (LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong"); - sldi(d, d, LogMinObjAlignmentInBytes); - } - if (Universe::narrow_oop_base() != NULL) { - add(d, d, R30); - } + decode_heap_oop_not_null(d); bind(isNull); } diff --git a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp index 89c0344a5fe..88e0dec0709 100644 --- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp @@ -172,15 +172,15 @@ void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm, // Load the invoker, as MH -> MH.form -> LF.vmentry __ verify_oop(recv); - __ load_heap_oop_not_null(method_temp, NONZERO(java_lang_invoke_MethodHandle::form_offset_in_bytes()), recv); + __ load_heap_oop_not_null(method_temp, NONZERO(java_lang_invoke_MethodHandle::form_offset_in_bytes()), recv, temp2); __ verify_oop(method_temp); - __ load_heap_oop_not_null(method_temp, NONZERO(java_lang_invoke_LambdaForm::vmentry_offset_in_bytes()), method_temp); + __ load_heap_oop_not_null(method_temp, NONZERO(java_lang_invoke_LambdaForm::vmentry_offset_in_bytes()), method_temp, temp2); __ verify_oop(method_temp); - // the following assumes that a Method* is normally compressed in the vmtarget field: + // The following assumes that a Method* is normally compressed in the vmtarget field: __ ld(method_temp, NONZERO(java_lang_invoke_MemberName::vmtarget_offset_in_bytes()), method_temp); if (VerifyMethodHandles && !for_compiler_entry) { - // make sure recv is already on stack + // Make sure recv is already on stack. __ ld(temp2, in_bytes(Method::const_offset()), method_temp); __ load_sized_value(temp2, in_bytes(ConstMethod::size_of_parameters_offset()), temp2, sizeof(u2), /*is_signed*/ false); @@ -259,8 +259,9 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler* } if (TraceMethodHandles) { - if (tmp_mh != noreg) + if (tmp_mh != noreg) { __ mr(R23_method_handle, tmp_mh); // make stub happy + } trace_method_handle_interpreter_entry(_masm, iid); } @@ -332,7 +333,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm, if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) { Label L_ok; Register temp2_defc = temp2; - __ load_heap_oop_not_null(temp2_defc, NONZERO(java_lang_invoke_MemberName::clazz_offset_in_bytes()), member_reg); + __ load_heap_oop_not_null(temp2_defc, NONZERO(java_lang_invoke_MemberName::clazz_offset_in_bytes()), member_reg, temp3); load_klass_from_Class(_masm, temp2_defc, temp3, temp4); __ verify_klass_ptr(temp2_defc); __ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, temp4, L_ok); @@ -407,7 +408,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm, } Register temp2_intf = temp2; - __ load_heap_oop_not_null(temp2_intf, NONZERO(java_lang_invoke_MemberName::clazz_offset_in_bytes()), member_reg); + __ load_heap_oop_not_null(temp2_intf, NONZERO(java_lang_invoke_MemberName::clazz_offset_in_bytes()), member_reg, temp3); load_klass_from_Class(_masm, temp2_intf, temp3, temp4); __ verify_klass_ptr(temp2_intf); @@ -464,7 +465,7 @@ void trace_method_handle_stub(const char* adaptername, strstr(adaptername, "linkTo") == NULL); // static linkers don't have MH const char* mh_reg_name = has_mh ? "R23_method_handle" : "G23"; tty->print_cr("MH %s %s="INTPTR_FORMAT " sp=" INTPTR_FORMAT, - adaptername, mh_reg_name, (intptr_t) mh, (intptr_t) entry_sp); + adaptername, mh_reg_name, (intptr_t) mh, entry_sp); if (Verbose) { tty->print_cr("Registers:"); @@ -535,23 +536,22 @@ void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adapt BLOCK_COMMENT("trace_method_handle {"); - int nbytes_save = 10 * 8; // 10 volatile gprs - __ save_LR_CR(R0); - __ mr(R0, R1_SP); // saved_sp - assert(Assembler::is_simm(-nbytes_save, 16), "Overwriting R0"); - // Push_frame_reg_args only uses R0 if nbytes_save is wider than 16 bit. - __ push_frame_reg_args(nbytes_save, R0); - __ save_volatile_gprs(R1_SP, frame::abi_reg_args_size); // Except R0. + const Register tmp = R11; // Will be preserved. + const int nbytes_save = 11*8; // volatile gprs except R0 + __ save_volatile_gprs(R1_SP, -nbytes_save); // except R0 + __ save_LR_CR(tmp); // save in old frame - __ load_const(R3_ARG1, (address)adaptername); + __ mr(R5_ARG3, R1_SP); // saved_sp + __ push_frame_reg_args(nbytes_save, tmp); + + __ load_const_optimized(R3_ARG1, (address)adaptername, tmp); __ mr(R4_ARG2, R23_method_handle); - __ mr(R5_ARG3, R0); // saved_sp __ mr(R6_ARG4, R1_SP); __ call_VM_leaf(CAST_FROM_FN_PTR(address, trace_method_handle_stub)); - __ restore_volatile_gprs(R1_SP, 112); // Except R0. __ pop_frame(); - __ restore_LR_CR(R0); + __ restore_LR_CR(tmp); + __ restore_volatile_gprs(R1_SP, -nbytes_save); // except R0 BLOCK_COMMENT("} trace_method_handle"); } diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index 51a9762e983..3808eabd27e 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -1,6 +1,6 @@ // -// Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. -// Copyright 2012, 2014 SAP AG. All rights reserved. +// Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +// Copyright 2012, 2015 SAP AG. 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 @@ -2698,7 +2698,7 @@ encode %{ const_toc_addr = __ address_constant((address)a.value(), RelocationHolder::none); __ relocate(a.rspec()); } else if (constant_reloc == relocInfo::metadata_type) { - AddressLiteral a = __ allocate_metadata_address((Metadata *)val); + AddressLiteral a = __ constant_metadata_address((Metadata *)val); const_toc_addr = __ address_constant((address)a.value(), RelocationHolder::none); __ relocate(a.rspec()); } else { @@ -2727,7 +2727,7 @@ encode %{ const_toc_addr = __ address_constant((address)a.value(), RelocationHolder::none); __ relocate(a.rspec()); } else if (constant_reloc == relocInfo::metadata_type) { - AddressLiteral a = __ allocate_metadata_address((Metadata *)val); + AddressLiteral a = __ constant_metadata_address((Metadata *)val); const_toc_addr = __ address_constant((address)a.value(), RelocationHolder::none); __ relocate(a.rspec()); } else { // non-oop pointers, e.g. card mark base, heap top @@ -6029,6 +6029,20 @@ instruct clearMs32b(iRegNdst dst, iRegNsrc src) %{ ins_pipe(pipe_class_default); %} +// Optimize DecodeN for disjoint base. +// Load base of compressed oops into a register +instruct loadBase(iRegLdst dst) %{ + effect(DEF dst); + + format %{ "MR $dst, r30_heapbase" %} + size(4); + ins_encode %{ + // TODO: PPC port $archOpcode(ppc64Opcode_or); + __ mr($dst$$Register, R30); + %} + ins_pipe(pipe_class_default); +%} + // Loading ConN must be postalloc expanded so that edges between // the nodes are safe. They may not interfere with a safepoint. // GL TODO: This needs three instructions: better put this into the constant pool. @@ -6351,58 +6365,6 @@ instruct loadConD_Ex(regD dst, immD src) %{ // Prefetch instructions. // Must be safe to execute with invalid address (cannot fault). -instruct prefetchr(indirectMemory mem, iRegLsrc src) %{ - match(PrefetchRead (AddP mem src)); - ins_cost(MEMORY_REF_COST); - - format %{ "PREFETCH $mem, 0, $src \t// Prefetch read-many" %} - size(4); - ins_encode %{ - // TODO: PPC port $archOpcode(ppc64Opcode_dcbt); - __ dcbt($src$$Register, $mem$$base$$Register); - %} - ins_pipe(pipe_class_memory); -%} - -instruct prefetchr_no_offset(indirectMemory mem) %{ - match(PrefetchRead mem); - ins_cost(MEMORY_REF_COST); - - format %{ "PREFETCH $mem" %} - size(4); - ins_encode %{ - // TODO: PPC port $archOpcode(ppc64Opcode_dcbt); - __ dcbt($mem$$base$$Register); - %} - ins_pipe(pipe_class_memory); -%} - -instruct prefetchw(indirectMemory mem, iRegLsrc src) %{ - match(PrefetchWrite (AddP mem src)); - ins_cost(MEMORY_REF_COST); - - format %{ "PREFETCH $mem, 2, $src \t// Prefetch write-many (and read)" %} - size(4); - ins_encode %{ - // TODO: PPC port $archOpcode(ppc64Opcode_dcbtst); - __ dcbtst($src$$Register, $mem$$base$$Register); - %} - ins_pipe(pipe_class_memory); -%} - -instruct prefetchw_no_offset(indirectMemory mem) %{ - match(PrefetchWrite mem); - ins_cost(MEMORY_REF_COST); - - format %{ "PREFETCH $mem" %} - size(4); - ins_encode %{ - // TODO: PPC port $archOpcode(ppc64Opcode_dcbtst); - __ dcbtst($mem$$base$$Register); - %} - ins_pipe(pipe_class_memory); -%} - // Special prefetch versions which use the dcbz instruction. instruct prefetch_alloc_zero(indirectMemory mem, iRegLsrc src) %{ match(PrefetchAllocation (AddP mem src)); @@ -6724,13 +6686,12 @@ instruct cond_set_0_oop(iRegNdst dst, flagsReg crx, iRegPsrc src1) %{ ins_pipe(pipe_class_default); %} -// base != 0 -// 32G aligned narrow oop base. -instruct encodeP_32GAligned(iRegNdst dst, iRegPsrc src) %{ +// Disjoint narrow oop base. +instruct encodeP_Disjoint(iRegNdst dst, iRegPsrc src) %{ match(Set dst (EncodeP src)); - predicate(false /* TODO: PPC port Universe::narrow_oop_base_disjoint()*/); + predicate(Universe::narrow_oop_base_disjoint()); - format %{ "EXTRDI $dst, $src, #32, #3 \t// encode with 32G aligned base" %} + format %{ "EXTRDI $dst, $src, #32, #3 \t// encode with disjoint base" %} size(4); ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_rldicl); @@ -6745,7 +6706,7 @@ instruct encodeP_Ex(iRegNdst dst, flagsReg crx, iRegPsrc src) %{ effect(TEMP crx); predicate(n->bottom_type()->make_ptr()->ptr() != TypePtr::NotNull && Universe::narrow_oop_shift() != 0 && - true /* TODO: PPC port Universe::narrow_oop_base_overlaps()*/); + Universe::narrow_oop_base_overlaps()); format %{ "EncodeP $dst, $crx, $src \t// postalloc expanded" %} postalloc_expand( postalloc_expand_encode_oop(dst, src, crx)); @@ -6756,7 +6717,7 @@ instruct encodeP_not_null_Ex(iRegNdst dst, iRegPsrc src) %{ match(Set dst (EncodeP src)); predicate(n->bottom_type()->make_ptr()->ptr() == TypePtr::NotNull && Universe::narrow_oop_shift() != 0 && - true /* TODO: PPC port Universe::narrow_oop_base_overlaps()*/); + Universe::narrow_oop_base_overlaps()); format %{ "EncodeP $dst, $src\t// $src != Null, postalloc expanded" %} postalloc_expand( postalloc_expand_encode_oop_not_null(dst, src) ); @@ -6876,6 +6837,7 @@ instruct decodeN_Ex(iRegPdst dst, iRegNsrc src, flagsReg crx) %{ n->bottom_type()->is_oopptr()->ptr() != TypePtr::Constant) && Universe::narrow_oop_shift() != 0 && Universe::narrow_oop_base() != 0); + ins_cost(4 * DEFAULT_COST); // Should be more expensive than decodeN_Disjoint_isel_Ex. effect(TEMP crx); format %{ "DecodeN $dst, $src \t// Kills $crx, postalloc expanded" %} @@ -6897,6 +6859,106 @@ instruct decodeN_nullBase(iRegPdst dst, iRegNsrc src) %{ ins_pipe(pipe_class_default); %} +// Optimize DecodeN for disjoint base. +// Shift narrow oop and or it into register that already contains the heap base. +// Base == dst must hold, and is assured by construction in postaloc_expand. +instruct decodeN_mergeDisjoint(iRegPdst dst, iRegNsrc src, iRegLsrc base) %{ + match(Set dst (DecodeN src)); + effect(TEMP base); + predicate(false); + + format %{ "RLDIMI $dst, $src, shift, 32-shift \t// DecodeN (disjoint base)" %} + size(4); + ins_encode %{ + // TODO: PPC port $archOpcode(ppc64Opcode_rldimi); + __ rldimi($dst$$Register, $src$$Register, Universe::narrow_oop_shift(), 32-Universe::narrow_oop_shift()); + %} + ins_pipe(pipe_class_default); +%} + +// Optimize DecodeN for disjoint base. +// This node requires only one cycle on the critical path. +// We must postalloc_expand as we can not express use_def effects where +// the used register is L and the def'ed register P. +instruct decodeN_Disjoint_notNull_Ex(iRegPdst dst, iRegNsrc src) %{ + match(Set dst (DecodeN src)); + effect(TEMP_DEF dst); + predicate((n->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull || + n->bottom_type()->is_oopptr()->ptr() == TypePtr::Constant) && + Universe::narrow_oop_base_disjoint()); + ins_cost(DEFAULT_COST); + + format %{ "MOV $dst, R30 \t\n" + "RLDIMI $dst, $src, shift, 32-shift \t// decode with disjoint base" %} + postalloc_expand %{ + loadBaseNode *n1 = new loadBaseNode(); + n1->add_req(NULL); + n1->_opnds[0] = op_dst; + + decodeN_mergeDisjointNode *n2 = new decodeN_mergeDisjointNode(); + n2->add_req(n_region, n_src, n1); + n2->_opnds[0] = op_dst; + n2->_opnds[1] = op_src; + n2->_opnds[2] = op_dst; + n2->_bottom_type = _bottom_type; + + ra_->set_pair(n1->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this)); + ra_->set_pair(n2->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this)); + + nodes->push(n1); + nodes->push(n2); + %} +%} + +instruct decodeN_Disjoint_isel_Ex(iRegPdst dst, iRegNsrc src, flagsReg crx) %{ + match(Set dst (DecodeN src)); + effect(TEMP_DEF dst, TEMP crx); + predicate((n->bottom_type()->is_oopptr()->ptr() != TypePtr::NotNull && + n->bottom_type()->is_oopptr()->ptr() != TypePtr::Constant) && + Universe::narrow_oop_base_disjoint() && VM_Version::has_isel()); + ins_cost(3 * DEFAULT_COST); + + format %{ "DecodeN $dst, $src \t// decode with disjoint base using isel" %} + postalloc_expand %{ + loadBaseNode *n1 = new loadBaseNode(); + n1->add_req(NULL); + n1->_opnds[0] = op_dst; + + cmpN_reg_imm0Node *n_compare = new cmpN_reg_imm0Node(); + n_compare->add_req(n_region, n_src); + n_compare->_opnds[0] = op_crx; + n_compare->_opnds[1] = op_src; + n_compare->_opnds[2] = new immN_0Oper(TypeNarrowOop::NULL_PTR); + + decodeN_mergeDisjointNode *n2 = new decodeN_mergeDisjointNode(); + n2->add_req(n_region, n_src, n1); + n2->_opnds[0] = op_dst; + n2->_opnds[1] = op_src; + n2->_opnds[2] = op_dst; + n2->_bottom_type = _bottom_type; + + cond_set_0_ptrNode *n_cond_set = new cond_set_0_ptrNode(); + n_cond_set->add_req(n_region, n_compare, n2); + n_cond_set->_opnds[0] = op_dst; + n_cond_set->_opnds[1] = op_crx; + n_cond_set->_opnds[2] = op_dst; + n_cond_set->_bottom_type = _bottom_type; + + assert(ra_->is_oop(this) == true, "A decodeN node must produce an oop!"); + ra_->set_oop(n_cond_set, true); + + ra_->set_pair(n1->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this)); + ra_->set_pair(n_compare->_idx, ra_->get_reg_second(n_crx), ra_->get_reg_first(n_crx)); + ra_->set_pair(n2->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this)); + ra_->set_pair(n_cond_set->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this)); + + nodes->push(n1); + nodes->push(n_compare); + nodes->push(n2); + nodes->push(n_cond_set); + %} +%} + // src != 0, shift != 0, base != 0 instruct decodeN_notNull_addBase_Ex(iRegPdst dst, iRegNsrc src) %{ match(Set dst (DecodeN src)); @@ -6904,6 +6966,7 @@ instruct decodeN_notNull_addBase_Ex(iRegPdst dst, iRegNsrc src) %{ n->bottom_type()->is_oopptr()->ptr() == TypePtr::Constant) && Universe::narrow_oop_shift() != 0 && Universe::narrow_oop_base() != 0); + ins_cost(2 * DEFAULT_COST); format %{ "DecodeN $dst, $src \t// $src != NULL, postalloc expanded" %} postalloc_expand( postalloc_expand_decode_oop_not_null(dst, src)); @@ -6973,13 +7036,12 @@ instruct encodePKlass_sub_base(iRegPdst dst, iRegLsrc base, iRegPdst src) %{ ins_pipe(pipe_class_default); %} -// base != 0 -// 32G aligned narrow oop base. -instruct encodePKlass_32GAligned(iRegNdst dst, iRegPsrc src) %{ +// Disjoint narrow oop base. +instruct encodePKlass_Disjoint(iRegNdst dst, iRegPsrc src) %{ match(Set dst (EncodePKlass src)); predicate(false /* TODO: PPC port Universe::narrow_klass_base_disjoint()*/); - format %{ "EXTRDI $dst, $src, #32, #3 \t// encode with 32G aligned base" %} + format %{ "EXTRDI $dst, $src, #32, #3 \t// encode with disjoint base" %} size(4); ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_rldicl); @@ -7486,7 +7548,7 @@ instruct storeLConditional_regP_regL_regL(flagsReg crx, indirect mem_ptr, iRegLs ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_compound); __ cmpxchgd($crx$$CondRegister, R0, $oldVal$$Register, $newVal$$Register, $mem_ptr$$Register, - MacroAssembler::MemBarNone, MacroAssembler::cmpxchgx_hint_atomic_update(), + MacroAssembler::MemBarAcq, MacroAssembler::cmpxchgx_hint_atomic_update(), noreg, NULL, true); %} ins_pipe(pipe_class_default); @@ -10476,7 +10538,7 @@ instruct cmpN_reg_reg(flagsReg crx, iRegNsrc src1, iRegNsrc src2) %{ match(Set crx (CmpN src1 src2)); size(4); - ins_cost(DEFAULT_COST); + ins_cost(2); format %{ "CMPLW $crx, $src1, $src2 \t// compressed ptr" %} ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_cmpl); @@ -10488,7 +10550,7 @@ instruct cmpN_reg_reg(flagsReg crx, iRegNsrc src1, iRegNsrc src2) %{ instruct cmpN_reg_imm0(flagsReg crx, iRegNsrc src1, immN_0 src2) %{ match(Set crx (CmpN src1 src2)); // Make this more expensive than zeroCheckN_iReg_imm0. - ins_cost(DEFAULT_COST); + ins_cost(2); format %{ "CMPLWI $crx, $src1, $src2 \t// compressed ptr" %} size(4); @@ -10508,6 +10570,7 @@ instruct zeroCheckP_reg_imm0(cmpOp cmp, iRegP_N2P value, immP_0 zero, label labl _kids[0]->_leaf->as_Bool()->_test._test == BoolTest::ne && _leaf->as_If()->_prob >= PROB_LIKELY_MAG(4) && Matcher::branches_to_uncommon_trap(_leaf)); + ins_cost(1); // Should not be cheaper than zeroCheckN. ins_is_TrapBasedCheckNode(true); @@ -10889,7 +10952,7 @@ instruct branchLoopEndSched(cmpOp cmp, flagsReg crx, label labl) %{ instruct partialSubtypeCheck(iRegPdst result, iRegP_N2P subklass, iRegP_N2P superklass, iRegPdst tmp_klass, iRegPdst tmp_arrayptr) %{ match(Set result (PartialSubtypeCheck subklass superklass)); - effect(TEMP result, TEMP tmp_klass, TEMP tmp_arrayptr); + effect(TEMP_DEF result, TEMP tmp_klass, TEMP tmp_arrayptr); ins_cost(DEFAULT_COST*10); format %{ "PartialSubtypeCheck $result = ($subklass instanceOf $superklass) tmp: $tmp_klass, $tmp_arrayptr" %} @@ -11000,7 +11063,7 @@ instruct string_indexOf_imm1_char(iRegIdst result, iRegPsrc haystack, iRegIsrc h predicate(SpecialStringIndexOf); // type check implicit by parameter type, See Matcher::match_rule_supported match(Set result (StrIndexOf (Binary haystack haycnt) (Binary (AddP needleImm offsetImm) needlecntImm))); - effect(TEMP result, TEMP tmp1, TEMP tmp2, KILL cr0, KILL cr1); + effect(TEMP_DEF result, TEMP tmp1, TEMP tmp2, KILL cr0, KILL cr1); ins_cost(150); format %{ "String IndexOf CSCL1 $haystack[0..$haycnt], $needleImm+$offsetImm[0..$needlecntImm]" @@ -11037,7 +11100,7 @@ instruct string_indexOf_imm1(iRegIdst result, iRegPsrc haystack, iRegIsrc haycnt iRegIdst tmp1, iRegIdst tmp2, flagsRegCR0 cr0, flagsRegCR1 cr1) %{ match(Set result (StrIndexOf (Binary haystack haycnt) (Binary needle needlecntImm))); - effect(USE_KILL needle, /* TDEF needle, */ TEMP result, + effect(USE_KILL needle, /* TDEF needle, */ TEMP_DEF result, TEMP tmp1, TEMP tmp2); // Required for EA: check if it is still a type_array. predicate(SpecialStringIndexOf && n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() && @@ -11084,7 +11147,7 @@ instruct string_indexOf_imm(iRegIdst result, iRegPsrc haystack, rscratch1RegI ha iRegIdst tmp1, iRegIdst tmp2, iRegIdst tmp3, iRegIdst tmp4, iRegIdst tmp5, flagsRegCR0 cr0, flagsRegCR1 cr1, flagsRegCR6 cr6) %{ match(Set result (StrIndexOf (Binary haystack haycnt) (Binary needle needlecntImm))); - effect(USE_KILL haycnt, /* better: TDEF haycnt, */ TEMP result, + effect(USE_KILL haycnt, /* better: TDEF haycnt, */ TEMP_DEF result, TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, KILL cr0, KILL cr1, KILL cr6); // Required for EA: check if it is still a type_array. predicate(SpecialStringIndexOf && n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() && @@ -11118,7 +11181,7 @@ instruct string_indexOf(iRegIdst result, iRegPsrc haystack, rscratch1RegI haycnt flagsRegCR0 cr0, flagsRegCR1 cr1, flagsRegCR6 cr6) %{ match(Set result (StrIndexOf (Binary haystack haycnt) (Binary needle needlecnt))); effect(USE_KILL haycnt, USE_KILL needlecnt, /*better: TDEF haycnt, TDEF needlecnt,*/ - TEMP result, + TEMP_DEF result, TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr0, KILL cr1, KILL cr6); predicate(SpecialStringIndexOf); // See Matcher::match_rule_supported. ins_cost(300); @@ -11142,7 +11205,7 @@ instruct string_equals_imm(iRegPsrc str1, iRegPsrc str2, uimmI15 cntImm, iRegIds iRegPdst tmp1, iRegPdst tmp2, flagsRegCR0 cr0, flagsRegCR6 cr6, regCTR ctr) %{ match(Set result (StrEquals (Binary str1 str2) cntImm)); - effect(TEMP result, TEMP tmp1, TEMP tmp2, + effect(TEMP_DEF result, TEMP tmp1, TEMP tmp2, KILL cr0, KILL cr6, KILL ctr); predicate(SpecialStringEquals); // See Matcher::match_rule_supported. ins_cost(250); @@ -11165,7 +11228,7 @@ instruct string_equals(iRegPsrc str1, iRegPsrc str2, iRegIsrc cnt, iRegIdst resu iRegPdst tmp1, iRegPdst tmp2, iRegPdst tmp3, iRegPdst tmp4, iRegPdst tmp5, flagsRegCR0 cr0, flagsRegCR1 cr1, flagsRegCR6 cr6, regCTR ctr) %{ match(Set result (StrEquals (Binary str1 str2) cnt)); - effect(TEMP result, TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, + effect(TEMP_DEF result, TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, KILL cr0, KILL cr1, KILL cr6, KILL ctr); predicate(SpecialStringEquals); // See Matcher::match_rule_supported. ins_cost(300); @@ -11188,7 +11251,7 @@ instruct string_equals(iRegPsrc str1, iRegPsrc str2, iRegIsrc cnt, iRegIdst resu instruct string_compare(rarg1RegP str1, rarg2RegP str2, rarg3RegI cnt1, rarg4RegI cnt2, iRegIdst result, iRegPdst tmp, flagsRegCR0 cr0, regCTR ctr) %{ match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); - effect(USE_KILL cnt1, USE_KILL cnt2, USE_KILL str1, USE_KILL str2, TEMP result, TEMP tmp, KILL cr0, KILL ctr); + effect(USE_KILL cnt1, USE_KILL cnt2, USE_KILL str1, USE_KILL str2, TEMP_DEF result, TEMP tmp, KILL cr0, KILL ctr); ins_cost(300); ins_alignment(8); // 'compute_padding()' gets called, up to this number-1 nops will get inserted. diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp index 0f8c752cacc..43258ce2a9a 100644 --- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. 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 @@ -1079,7 +1079,7 @@ class StubGenerator: public StubCodeGenerator { __ sldi(tmp2, R5_ARG3, log2_elem_size); // size in bytes __ cmpld(CCR0, R3_ARG1, R4_ARG2); // Use unsigned comparison! __ cmpld(CCR1, tmp1, tmp2); - __ crand(/*CCR0 lt*/0, /*CCR1 lt*/4+0, /*CCR0 lt*/0); + __ crand(CCR0, Assembler::less, CCR1, Assembler::less); __ blt(CCR0, l_overlap); // Src before dst and distance smaller than size. // need to copy forwards diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp index 2a58b36d420..432a96d8268 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp @@ -264,11 +264,11 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label* __ cmpdi(CCR0, Rmdo, 0); __ beq(CCR0, no_mdo); - // Increment backedge counter in the MDO. - const int mdo_bc_offs = in_bytes(MethodData::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); - __ lwz(Rscratch2, mdo_bc_offs, Rmdo); + // Increment invocation counter in the MDO. + const int mdo_ic_offs = in_bytes(MethodData::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); + __ lwz(Rscratch2, mdo_ic_offs, Rmdo); __ addi(Rscratch2, Rscratch2, increment); - __ stw(Rscratch2, mdo_bc_offs, Rmdo); + __ stw(Rscratch2, mdo_ic_offs, Rmdo); __ load_const_optimized(Rscratch1, mask, R0); __ and_(Rscratch1, Rscratch2, Rscratch1); __ bne(CCR0, done); @@ -276,12 +276,12 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label* } // Increment counter in MethodCounters*. - const int mo_bc_offs = in_bytes(MethodCounters::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); + const int mo_ic_offs = in_bytes(MethodCounters::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); __ bind(no_mdo); __ get_method_counters(R19_method, R3_counters, done); - __ lwz(Rscratch2, mo_bc_offs, R3_counters); + __ lwz(Rscratch2, mo_ic_offs, R3_counters); __ addi(Rscratch2, Rscratch2, increment); - __ stw(Rscratch2, mo_bc_offs, R3_counters); + __ stw(Rscratch2, mo_ic_offs, R3_counters); __ load_const_optimized(Rscratch1, mask, R0); __ and_(Rscratch1, Rscratch2, Rscratch1); __ beq(CCR0, *overflow); diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp index 40cd339c2c0..70d1420022d 100644 --- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013, 2014 SAP AG. All rights reserved. + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2013, 2015 SAP AG. 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 @@ -143,7 +143,6 @@ static void do_oop_store(InterpreterMacroAssembler* _masm, } break; case BarrierSet::ModRef: - case BarrierSet::Other: ShouldNotReachHere(); break; default: @@ -335,11 +334,11 @@ void TemplateTable::ldc(bool wide) { __ cmpwi(CCR0, Rscratch2, JVM_CONSTANT_UnresolvedClass); // Unresolved class? __ cmpwi(CCR1, Rscratch2, JVM_CONSTANT_UnresolvedClassInError); // Unresolved class in error state? - __ cror(/*CR0 eq*/2, /*CR1 eq*/4+2, /*CR0 eq*/2); + __ cror(CCR0, Assembler::equal, CCR1, Assembler::equal); // Resolved class - need to call vm to get java mirror of the class. __ cmpwi(CCR1, Rscratch2, JVM_CONSTANT_Class); - __ crnor(/*CR0 eq*/2, /*CR1 eq*/4+2, /*CR0 eq*/2); // Neither resolved class nor unresolved case from above? + __ crnor(CCR0, Assembler::equal, CCR1, Assembler::equal); // Neither resolved class nor unresolved case from above? __ beq(CCR0, notClass); __ li(R4, wide ? 1 : 0); @@ -2611,7 +2610,7 @@ void TemplateTable::jvmti_post_field_mod(Register Rcache, Register Rscratch, boo __ cmpwi(CCR0, Rflags, ltos); __ cmpwi(CCR1, Rflags, dtos); __ addi(base, R15_esp, Interpreter::expr_offset_in_bytes(1)); - __ crnor(/*CR0 eq*/2, /*CR1 eq*/4+2, /*CR0 eq*/2); + __ crnor(CCR0, Assembler::equal, CCR1, Assembler::equal); __ beq(CCR0, is_one_slot); __ addi(base, R15_esp, Interpreter::expr_offset_in_bytes(2)); __ bind(is_one_slot); @@ -3563,7 +3562,7 @@ void TemplateTable::_new() { // Make sure klass does not have has_finalizer, or is abstract, or interface or java/lang/Class. __ andi_(R0, Rinstance_size, Klass::_lh_instance_slow_path_bit); // slow path bit equals 0? - __ crnand(/*CR0 eq*/2, /*CR1 eq*/4+2, /*CR0 eq*/2); // slow path bit set or not fully initialized? + __ crnand(CCR0, Assembler::equal, CCR1, Assembler::equal); // slow path bit set or not fully initialized? __ beq(CCR0, Lslow_case); // -------------------------------------------------------------------------- diff --git a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp index f3709eb8d05..1187443000d 100644 --- a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -483,15 +483,6 @@ void G1PreBarrierStub::emit_code(LIR_Assembler* ce) { } -jbyte* G1PostBarrierStub::_byte_map_base = NULL; - -jbyte* G1PostBarrierStub::byte_map_base_slow() { - BarrierSet* bs = Universe::heap()->barrier_set(); - assert(bs->is_a(BarrierSet::G1SATBCTLogging), - "Must be if we're using this."); - return ((G1SATBCardTableModRefBS*)bs)->byte_map_base; -} - void G1PostBarrierStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp index 0c733a7b1b9..69d5987a40d 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -1436,26 +1436,6 @@ void LIR_Assembler::mem2reg(LIR_Opr src_opr, LIR_Opr dest, BasicType type, } -void LIR_Assembler::prefetchr(LIR_Opr src) { - LIR_Address* addr = src->as_address_ptr(); - Address from_addr = as_Address(addr); - - if (VM_Version::has_v9()) { - __ prefetch(from_addr, Assembler::severalReads); - } -} - - -void LIR_Assembler::prefetchw(LIR_Opr src) { - LIR_Address* addr = src->as_address_ptr(); - Address from_addr = as_Address(addr); - - if (VM_Version::has_v9()) { - __ prefetch(from_addr, Assembler::severalWritesAndPossiblyReads); - } -} - - void LIR_Assembler::stack2reg(LIR_Opr src, LIR_Opr dest, BasicType type) { Address addr; if (src->is_single_word()) { diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp index 51f237ba626..153bfbdda55 100644 --- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp @@ -1374,6 +1374,7 @@ void InterpreterMacroAssembler::verify_method_data_pointer() { } void InterpreterMacroAssembler::test_invocation_counter_for_mdp(Register invocation_count, + Register method_counters, Register Rtmp, Label &profile_continue) { assert(ProfileInterpreter, "must be profiling interpreter"); @@ -1386,9 +1387,8 @@ void InterpreterMacroAssembler::test_invocation_counter_for_mdp(Register invocat br_notnull_short(ImethodDataPtr, Assembler::pn, done); // Test to see if we should create a method data oop - AddressLiteral profile_limit((address) &InvocationCounter::InterpreterProfileLimit); - sethi(profile_limit, Rtmp); - ld(Rtmp, profile_limit.low10(), Rtmp); + Address profile_limit(method_counters, MethodCounters::interpreter_profile_limit_offset()); + ld(profile_limit, Rtmp); cmp(invocation_count, Rtmp); // Use long branches because call_VM() code and following code generated by // test_backedge_count_for_osr() is large in debug VM. @@ -2375,6 +2375,7 @@ void InterpreterMacroAssembler::increment_backedge_counter( Register Rcounters, #ifndef CC_INTERP void InterpreterMacroAssembler::test_backedge_count_for_osr( Register backedge_count, + Register method_counters, Register branch_bcp, Register Rtmp ) { Label did_not_overflow; @@ -2382,8 +2383,8 @@ void InterpreterMacroAssembler::test_backedge_count_for_osr( Register backedge_c assert_different_registers(backedge_count, Rtmp, branch_bcp); assert(UseOnStackReplacement,"Must UseOnStackReplacement to test_backedge_count_for_osr"); - AddressLiteral limit(&InvocationCounter::InterpreterBackwardBranchLimit); - load_contents(limit, Rtmp); + Address limit(method_counters, in_bytes(MethodCounters::interpreter_backward_branch_limit_offset())); + ld(limit, Rtmp); cmp_and_br_short(backedge_count, Rtmp, Assembler::lessUnsigned, Assembler::pt, did_not_overflow); // When ProfileInterpreter is on, the backedge_count comes from the @@ -2500,17 +2501,13 @@ void InterpreterMacroAssembler::verify_FPU(int stack_depth, TosState state) { // Jump if ((*counter_addr += increment) & mask) satisfies the condition. void InterpreterMacroAssembler::increment_mask_and_jump(Address counter_addr, - int increment, int mask, + int increment, Address mask_addr, Register scratch1, Register scratch2, Condition cond, Label *where) { ld(counter_addr, scratch1); add(scratch1, increment, scratch1); - if (is_simm13(mask)) { - andcc(scratch1, mask, G0); - } else { - set(mask, scratch2); - andcc(scratch1, scratch2, G0); - } + ld(mask_addr, scratch2); + andcc(scratch1, scratch2, G0); br(cond, false, Assembler::pn, *where); delayed()->st(scratch1, counter_addr); } diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp index 5ba547d2241..862611c4252 100644 --- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp @@ -267,7 +267,7 @@ class InterpreterMacroAssembler: public MacroAssembler { void increment_invocation_counter( Register Rcounters, Register Rtmp, Register Rtmp2 ); void increment_backedge_counter( Register Rcounters, Register Rtmp, Register Rtmp2 ); #ifndef CC_INTERP - void test_backedge_count_for_osr( Register backedge_count, Register branch_bcp, Register Rtmp ); + void test_backedge_count_for_osr(Register backedge_count, Register method_counters, Register branch_bcp, Register Rtmp ); #endif /* CC_INTERP */ // Object locking @@ -280,7 +280,7 @@ class InterpreterMacroAssembler: public MacroAssembler { void set_method_data_pointer_for_bcp(); void test_method_data_pointer(Label& zero_continue); void verify_method_data_pointer(); - void test_invocation_counter_for_mdp(Register invocation_count, Register Rtmp, Label &profile_continue); + void test_invocation_counter_for_mdp(Register invocation_count, Register method_counters, Register Rtmp, Label &profile_continue); void set_mdp_data_at(int constant, Register value); void increment_mdp_data_at(Address counter, Register bumped_count, @@ -291,7 +291,7 @@ class InterpreterMacroAssembler: public MacroAssembler { Register bumped_count, Register scratch2, bool decrement = false); void increment_mask_and_jump(Address counter_addr, - int increment, int mask, + int increment, Address mask_addr, Register scratch1, Register scratch2, Condition cond, Label *where); void set_mdp_flag_at(int flag_constant, Register scratch); diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp index 7e3804fd379..3518d0b6336 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp @@ -630,7 +630,12 @@ inline void MacroAssembler::ldf(FloatRegisterImpl::Width w, Register s1, Registe inline void MacroAssembler::ldf(FloatRegisterImpl::Width w, const Address& a, FloatRegister d, int offset) { relocate(a.rspec(offset)); - ldf(w, a.base(), a.disp() + offset, d); + if (a.has_index()) { + assert(offset == 0, ""); + ldf(w, a.base(), a.index(), d); + } else { + ldf(w, a.base(), a.disp() + offset, d); + } } // returns if membar generates anything, obviously this code should mirror diff --git a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp index 2ec40f8fd0d..c7b89b110e9 100644 --- a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp @@ -36,11 +36,6 @@ #include "c1/c1_Runtime1.hpp" #endif - -bool NativeInstruction::is_dtrace_trap() { - return !is_nop(); -} - void NativeInstruction::set_data64_sethi(address instaddr, intptr_t x) { ResourceMark rm; CodeBuffer buf(instaddr, 10 * BytesPerInstWord ); diff --git a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp index 698b448de9a..eaf543e128b 100644 --- a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp @@ -51,7 +51,6 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC { nop_instruction_size = 4 }; - bool is_dtrace_trap(); bool is_nop() { return long_at(0) == nop_instruction(); } bool is_call() { return is_op(long_at(0), Assembler::call_op); } bool is_sethi() { return (is_op2(long_at(0), Assembler::sethi_op2) diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp index bc67a72c1fd..b3dcb8b98c9 100644 --- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp @@ -2758,540 +2758,6 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, } -#ifdef HAVE_DTRACE_H -// --------------------------------------------------------------------------- -// Generate a dtrace nmethod for a given signature. The method takes arguments -// in the Java compiled code convention, marshals them to the native -// abi and then leaves nops at the position you would expect to call a native -// function. When the probe is enabled the nops are replaced with a trap -// instruction that dtrace inserts and the trace will cause a notification -// to dtrace. -// -// The probes are only able to take primitive types and java/lang/String as -// arguments. No other java types are allowed. Strings are converted to utf8 -// strings so that from dtrace point of view java strings are converted to C -// strings. There is an arbitrary fixed limit on the total space that a method -// can use for converting the strings. (256 chars per string in the signature). -// So any java string larger then this is truncated. - -static int fp_offset[ConcreteRegisterImpl::number_of_registers] = { 0 }; -static bool offsets_initialized = false; - -nmethod *SharedRuntime::generate_dtrace_nmethod( - MacroAssembler *masm, methodHandle method) { - - - // generate_dtrace_nmethod is guarded by a mutex so we are sure to - // be single threaded in this method. - assert(AdapterHandlerLibrary_lock->owned_by_self(), "must be"); - - // Fill in the signature array, for the calling-convention call. - int total_args_passed = method->size_of_parameters(); - - BasicType* in_sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_args_passed); - VMRegPair *in_regs = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed); - - // The signature we are going to use for the trap that dtrace will see - // java/lang/String is converted. We drop "this" and any other object - // is converted to NULL. (A one-slot java/lang/Long object reference - // is converted to a two-slot long, which is why we double the allocation). - BasicType* out_sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_args_passed * 2); - VMRegPair* out_regs = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed * 2); - - int i=0; - int total_strings = 0; - int first_arg_to_pass = 0; - int total_c_args = 0; - - // Skip the receiver as dtrace doesn't want to see it - if( !method->is_static() ) { - in_sig_bt[i++] = T_OBJECT; - first_arg_to_pass = 1; - } - - SignatureStream ss(method->signature()); - for ( ; !ss.at_return_type(); ss.next()) { - BasicType bt = ss.type(); - in_sig_bt[i++] = bt; // Collect remaining bits of signature - out_sig_bt[total_c_args++] = bt; - if( bt == T_OBJECT) { - Symbol* s = ss.as_symbol_or_null(); - if (s == vmSymbols::java_lang_String()) { - total_strings++; - out_sig_bt[total_c_args-1] = T_ADDRESS; - } else if (s == vmSymbols::java_lang_Boolean() || - s == vmSymbols::java_lang_Byte()) { - out_sig_bt[total_c_args-1] = T_BYTE; - } else if (s == vmSymbols::java_lang_Character() || - s == vmSymbols::java_lang_Short()) { - out_sig_bt[total_c_args-1] = T_SHORT; - } else if (s == vmSymbols::java_lang_Integer() || - s == vmSymbols::java_lang_Float()) { - out_sig_bt[total_c_args-1] = T_INT; - } else if (s == vmSymbols::java_lang_Long() || - s == vmSymbols::java_lang_Double()) { - out_sig_bt[total_c_args-1] = T_LONG; - out_sig_bt[total_c_args++] = T_VOID; - } - } else if ( bt == T_LONG || bt == T_DOUBLE ) { - in_sig_bt[i++] = T_VOID; // Longs & doubles take 2 Java slots - // We convert double to long - out_sig_bt[total_c_args-1] = T_LONG; - out_sig_bt[total_c_args++] = T_VOID; - } else if ( bt == T_FLOAT) { - // We convert float to int - out_sig_bt[total_c_args-1] = T_INT; - } - } - - assert(i==total_args_passed, "validly parsed signature"); - - // Now get the compiled-Java layout as input arguments - int comp_args_on_stack; - comp_args_on_stack = SharedRuntime::java_calling_convention( - in_sig_bt, in_regs, total_args_passed, false); - - // We have received a description of where all the java arg are located - // on entry to the wrapper. We need to convert these args to where - // the a native (non-jni) function would expect them. To figure out - // where they go we convert the java signature to a C signature and remove - // T_VOID for any long/double we might have received. - - - // Now figure out where the args must be stored and how much stack space - // they require (neglecting out_preserve_stack_slots but space for storing - // the 1st six register arguments). It's weird see int_stk_helper. - // - int out_arg_slots; - out_arg_slots = c_calling_convention(out_sig_bt, out_regs, NULL, total_c_args); - - // Calculate the total number of stack slots we will need. - - // First count the abi requirement plus all of the outgoing args - int stack_slots = SharedRuntime::out_preserve_stack_slots() + out_arg_slots; - - // Plus a temp for possible converion of float/double/long register args - - int conversion_temp = stack_slots; - stack_slots += 2; - - - // Now space for the string(s) we must convert - - int string_locs = stack_slots; - stack_slots += total_strings * - (max_dtrace_string_size / VMRegImpl::stack_slot_size); - - // Ok The space we have allocated will look like: - // - // - // FP-> | | - // |---------------------| - // | string[n] | - // |---------------------| <- string_locs[n] - // | string[n-1] | - // |---------------------| <- string_locs[n-1] - // | ... | - // | ... | - // |---------------------| <- string_locs[1] - // | string[0] | - // |---------------------| <- string_locs[0] - // | temp | - // |---------------------| <- conversion_temp - // | outbound memory | - // | based arguments | - // | | - // |---------------------| - // | | - // SP-> | out_preserved_slots | - // - // - - // Now compute actual number of stack words we need rounding to make - // stack properly aligned. - stack_slots = round_to(stack_slots, 4 * VMRegImpl::slots_per_word); - - int stack_size = stack_slots * VMRegImpl::stack_slot_size; - - intptr_t start = (intptr_t)__ pc(); - - // First thing make an ic check to see if we should even be here - - { - Label L; - const Register temp_reg = G3_scratch; - AddressLiteral ic_miss(SharedRuntime::get_ic_miss_stub()); - __ verify_oop(O0); - __ ld_ptr(O0, oopDesc::klass_offset_in_bytes(), temp_reg); - __ cmp_and_brx_short(temp_reg, G5_inline_cache_reg, Assembler::equal, Assembler::pt, L); - - __ jump_to(ic_miss, temp_reg); - __ delayed()->nop(); - __ align(CodeEntryAlignment); - __ bind(L); - } - - int vep_offset = ((intptr_t)__ pc()) - start; - - - // The instruction at the verified entry point must be 5 bytes or longer - // because it can be patched on the fly by make_non_entrant. The stack bang - // instruction fits that requirement. - - // Generate stack overflow check before creating frame - __ generate_stack_overflow_check(stack_size); - - assert(((intptr_t)__ pc() - start - vep_offset) >= 5, - "valid size for make_non_entrant"); - - // Generate a new frame for the wrapper. - __ save(SP, -stack_size, SP); - - // Frame is now completed as far a size and linkage. - - int frame_complete = ((intptr_t)__ pc()) - start; - -#ifdef ASSERT - bool reg_destroyed[RegisterImpl::number_of_registers]; - bool freg_destroyed[FloatRegisterImpl::number_of_registers]; - for ( int r = 0 ; r < RegisterImpl::number_of_registers ; r++ ) { - reg_destroyed[r] = false; - } - for ( int f = 0 ; f < FloatRegisterImpl::number_of_registers ; f++ ) { - freg_destroyed[f] = false; - } - -#endif /* ASSERT */ - - VMRegPair zero; - const Register g0 = G0; // without this we get a compiler warning (why??) - zero.set2(g0->as_VMReg()); - - int c_arg, j_arg; - - Register conversion_off = noreg; - - for (j_arg = first_arg_to_pass, c_arg = 0 ; - j_arg < total_args_passed ; j_arg++, c_arg++ ) { - - VMRegPair src = in_regs[j_arg]; - VMRegPair dst = out_regs[c_arg]; - -#ifdef ASSERT - if (src.first()->is_Register()) { - assert(!reg_destroyed[src.first()->as_Register()->encoding()], "ack!"); - } else if (src.first()->is_FloatRegister()) { - assert(!freg_destroyed[src.first()->as_FloatRegister()->encoding( - FloatRegisterImpl::S)], "ack!"); - } - if (dst.first()->is_Register()) { - reg_destroyed[dst.first()->as_Register()->encoding()] = true; - } else if (dst.first()->is_FloatRegister()) { - freg_destroyed[dst.first()->as_FloatRegister()->encoding( - FloatRegisterImpl::S)] = true; - } -#endif /* ASSERT */ - - switch (in_sig_bt[j_arg]) { - case T_ARRAY: - case T_OBJECT: - { - if (out_sig_bt[c_arg] == T_BYTE || out_sig_bt[c_arg] == T_SHORT || - out_sig_bt[c_arg] == T_INT || out_sig_bt[c_arg] == T_LONG) { - // need to unbox a one-slot value - Register in_reg = L0; - Register tmp = L2; - if ( src.first()->is_reg() ) { - in_reg = src.first()->as_Register(); - } else { - assert(Assembler::is_simm13(reg2offset(src.first()) + STACK_BIAS), - "must be"); - __ ld_ptr(FP, reg2offset(src.first()) + STACK_BIAS, in_reg); - } - // If the final destination is an acceptable register - if ( dst.first()->is_reg() ) { - if ( dst.is_single_phys_reg() || out_sig_bt[c_arg] != T_LONG ) { - tmp = dst.first()->as_Register(); - } - } - - Label skipUnbox; - if ( wordSize == 4 && out_sig_bt[c_arg] == T_LONG ) { - __ mov(G0, tmp->successor()); - } - __ br_null(in_reg, true, Assembler::pn, skipUnbox); - __ delayed()->mov(G0, tmp); - - BasicType bt = out_sig_bt[c_arg]; - int box_offset = java_lang_boxing_object::value_offset_in_bytes(bt); - switch (bt) { - case T_BYTE: - __ ldub(in_reg, box_offset, tmp); break; - case T_SHORT: - __ lduh(in_reg, box_offset, tmp); break; - case T_INT: - __ ld(in_reg, box_offset, tmp); break; - case T_LONG: - __ ld_long(in_reg, box_offset, tmp); break; - default: ShouldNotReachHere(); - } - - __ bind(skipUnbox); - // If tmp wasn't final destination copy to final destination - if (tmp == L2) { - VMRegPair tmp_as_VM = reg64_to_VMRegPair(L2); - if (out_sig_bt[c_arg] == T_LONG) { - long_move(masm, tmp_as_VM, dst); - } else { - move32_64(masm, tmp_as_VM, out_regs[c_arg]); - } - } - if (out_sig_bt[c_arg] == T_LONG) { - assert(out_sig_bt[c_arg+1] == T_VOID, "must be"); - ++c_arg; // move over the T_VOID to keep the loop indices in sync - } - } else if (out_sig_bt[c_arg] == T_ADDRESS) { - Register s = - src.first()->is_reg() ? src.first()->as_Register() : L2; - Register d = - dst.first()->is_reg() ? dst.first()->as_Register() : L2; - - // We store the oop now so that the conversion pass can reach - // while in the inner frame. This will be the only store if - // the oop is NULL. - if (s != L2) { - // src is register - if (d != L2) { - // dst is register - __ mov(s, d); - } else { - assert(Assembler::is_simm13(reg2offset(dst.first()) + - STACK_BIAS), "must be"); - __ st_ptr(s, SP, reg2offset(dst.first()) + STACK_BIAS); - } - } else { - // src not a register - assert(Assembler::is_simm13(reg2offset(src.first()) + - STACK_BIAS), "must be"); - __ ld_ptr(FP, reg2offset(src.first()) + STACK_BIAS, d); - if (d == L2) { - assert(Assembler::is_simm13(reg2offset(dst.first()) + - STACK_BIAS), "must be"); - __ st_ptr(d, SP, reg2offset(dst.first()) + STACK_BIAS); - } - } - } else if (out_sig_bt[c_arg] != T_VOID) { - // Convert the arg to NULL - if (dst.first()->is_reg()) { - __ mov(G0, dst.first()->as_Register()); - } else { - assert(Assembler::is_simm13(reg2offset(dst.first()) + - STACK_BIAS), "must be"); - __ st_ptr(G0, SP, reg2offset(dst.first()) + STACK_BIAS); - } - } - } - break; - case T_VOID: - break; - - case T_FLOAT: - if (src.first()->is_stack()) { - // Stack to stack/reg is simple - move32_64(masm, src, dst); - } else { - if (dst.first()->is_reg()) { - // freg -> reg - int off = - STACK_BIAS + conversion_temp * VMRegImpl::stack_slot_size; - Register d = dst.first()->as_Register(); - if (Assembler::is_simm13(off)) { - __ stf(FloatRegisterImpl::S, src.first()->as_FloatRegister(), - SP, off); - __ ld(SP, off, d); - } else { - if (conversion_off == noreg) { - __ set(off, L6); - conversion_off = L6; - } - __ stf(FloatRegisterImpl::S, src.first()->as_FloatRegister(), - SP, conversion_off); - __ ld(SP, conversion_off , d); - } - } else { - // freg -> mem - int off = STACK_BIAS + reg2offset(dst.first()); - if (Assembler::is_simm13(off)) { - __ stf(FloatRegisterImpl::S, src.first()->as_FloatRegister(), - SP, off); - } else { - if (conversion_off == noreg) { - __ set(off, L6); - conversion_off = L6; - } - __ stf(FloatRegisterImpl::S, src.first()->as_FloatRegister(), - SP, conversion_off); - } - } - } - break; - - case T_DOUBLE: - assert( j_arg + 1 < total_args_passed && - in_sig_bt[j_arg + 1] == T_VOID && - out_sig_bt[c_arg+1] == T_VOID, "bad arg list"); - if (src.first()->is_stack()) { - // Stack to stack/reg is simple - long_move(masm, src, dst); - } else { - Register d = dst.first()->is_reg() ? dst.first()->as_Register() : L2; - - // Destination could be an odd reg on 32bit in which case - // we can't load direct to the destination. - - if (!d->is_even() && wordSize == 4) { - d = L2; - } - int off = STACK_BIAS + conversion_temp * VMRegImpl::stack_slot_size; - if (Assembler::is_simm13(off)) { - __ stf(FloatRegisterImpl::D, src.first()->as_FloatRegister(), - SP, off); - __ ld_long(SP, off, d); - } else { - if (conversion_off == noreg) { - __ set(off, L6); - conversion_off = L6; - } - __ stf(FloatRegisterImpl::D, src.first()->as_FloatRegister(), - SP, conversion_off); - __ ld_long(SP, conversion_off, d); - } - if (d == L2) { - long_move(masm, reg64_to_VMRegPair(L2), dst); - } - } - break; - - case T_LONG : - // 32bit can't do a split move of something like g1 -> O0, O1 - // so use a memory temp - if (src.is_single_phys_reg() && wordSize == 4) { - Register tmp = L2; - if (dst.first()->is_reg() && - (wordSize == 8 || dst.first()->as_Register()->is_even())) { - tmp = dst.first()->as_Register(); - } - - int off = STACK_BIAS + conversion_temp * VMRegImpl::stack_slot_size; - if (Assembler::is_simm13(off)) { - __ stx(src.first()->as_Register(), SP, off); - __ ld_long(SP, off, tmp); - } else { - if (conversion_off == noreg) { - __ set(off, L6); - conversion_off = L6; - } - __ stx(src.first()->as_Register(), SP, conversion_off); - __ ld_long(SP, conversion_off, tmp); - } - - if (tmp == L2) { - long_move(masm, reg64_to_VMRegPair(L2), dst); - } - } else { - long_move(masm, src, dst); - } - break; - - case T_ADDRESS: assert(false, "found T_ADDRESS in java args"); - - default: - move32_64(masm, src, dst); - } - } - - - // If we have any strings we must store any register based arg to the stack - // This includes any still live xmm registers too. - - if (total_strings > 0 ) { - - // protect all the arg registers - __ save_frame(0); - __ mov(G2_thread, L7_thread_cache); - const Register L2_string_off = L2; - - // Get first string offset - __ set(string_locs * VMRegImpl::stack_slot_size, L2_string_off); - - for (c_arg = 0 ; c_arg < total_c_args ; c_arg++ ) { - if (out_sig_bt[c_arg] == T_ADDRESS) { - - VMRegPair dst = out_regs[c_arg]; - const Register d = dst.first()->is_reg() ? - dst.first()->as_Register()->after_save() : noreg; - - // It's a string the oop and it was already copied to the out arg - // position - if (d != noreg) { - __ mov(d, O0); - } else { - assert(Assembler::is_simm13(reg2offset(dst.first()) + STACK_BIAS), - "must be"); - __ ld_ptr(FP, reg2offset(dst.first()) + STACK_BIAS, O0); - } - Label skip; - - __ br_null(O0, false, Assembler::pn, skip); - __ delayed()->add(FP, L2_string_off, O1); - - if (d != noreg) { - __ mov(O1, d); - } else { - assert(Assembler::is_simm13(reg2offset(dst.first()) + STACK_BIAS), - "must be"); - __ st_ptr(O1, FP, reg2offset(dst.first()) + STACK_BIAS); - } - - __ call(CAST_FROM_FN_PTR(address, SharedRuntime::get_utf), - relocInfo::runtime_call_type); - __ delayed()->add(L2_string_off, max_dtrace_string_size, L2_string_off); - - __ bind(skip); - - } - - } - __ mov(L7_thread_cache, G2_thread); - __ restore(); - - } - - - // Ok now we are done. Need to place the nop that dtrace wants in order to - // patch in the trap - - int patch_offset = ((intptr_t)__ pc()) - start; - - __ nop(); - - - // Return - - __ ret(); - __ delayed()->restore(); - - __ flush(); - - nmethod *nm = nmethod::new_dtrace_nmethod( - method, masm->code(), vep_offset, patch_offset, frame_complete, - stack_slots / VMRegImpl::slots_per_word); - return nm; - -} - -#endif // HAVE_DTRACE_H - // this function returns the adjust size (in number of words) to a c2i adapter // activation for use during deoptimization int Deoptimization::last_frame_adjust(int callee_parameters, int callee_locals) { diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad index dfc67d5df66..c344c216b37 100644 --- a/hotspot/src/cpu/sparc/vm/sparc.ad +++ b/hotspot/src/cpu/sparc/vm/sparc.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 1998, 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 @@ -889,8 +889,6 @@ void emit_form3_mem_reg(CodeBuffer &cbuf, PhaseRegAlloc* ra, const MachNode* n, !(n->ideal_Opcode()==Op_LoadD_unaligned && ld_op==Op_LoadF) && !(n->ideal_Opcode()==Op_ConvI2F && ld_op==Op_LoadF) && !(n->ideal_Opcode()==Op_ConvI2D && ld_op==Op_LoadF) && - !(n->ideal_Opcode()==Op_PrefetchRead && ld_op==Op_LoadI) && - !(n->ideal_Opcode()==Op_PrefetchWrite && ld_op==Op_LoadI) && !(n->ideal_Opcode()==Op_PrefetchAllocation && ld_op==Op_LoadI) && !(n->ideal_Opcode()==Op_LoadVector && ld_op==Op_LoadD) && !(n->rule() == loadUB_rule)) { @@ -2996,7 +2994,7 @@ enc_class Fast_Unlock(iRegP oop, iRegP box, o7RegP scratch, iRegP scratch2) %{ %} enc_class enc_String_Equals(o0RegP str1, o1RegP str2, g3RegI cnt, notemp_iRegI result) %{ - Label Lword_loop, Lpost_word, Lchar, Lchar_loop, Ldone; + Label Lchar, Lchar_loop, Ldone; MacroAssembler _masm(&cbuf); Register str1_reg = reg_to_register_object($str1$$reg); @@ -6316,32 +6314,8 @@ instruct loadConD(regD dst, immD con, o7RegI tmp) %{ ins_pipe(loadConFD); %} -// Prefetch instructions. -// Must be safe to execute with invalid address (cannot fault). - -instruct prefetchr( memory mem ) %{ - match( PrefetchRead mem ); - ins_cost(MEMORY_REF_COST); - size(4); - - format %{ "PREFETCH $mem,0\t! Prefetch read-many" %} - opcode(Assembler::prefetch_op3); - ins_encode( form3_mem_prefetch_read( mem ) ); - ins_pipe(iload_mem); -%} - -instruct prefetchw( memory mem ) %{ - match( PrefetchWrite mem ); - ins_cost(MEMORY_REF_COST); - size(4); - - format %{ "PREFETCH $mem,2\t! Prefetch write-many (and read)" %} - opcode(Assembler::prefetch_op3); - ins_encode( form3_mem_prefetch_write( mem ) ); - ins_pipe(iload_mem); -%} - // Prefetch instructions for allocation. +// Must be safe to execute with invalid address (cannot fault). instruct prefetchAlloc( memory mem ) %{ predicate(AllocatePrefetchInstr == 0); diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp index 93f87807482..c3039d51337 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp @@ -282,12 +282,11 @@ address TemplateInterpreterGenerator::generate_continuation_for(TosState state) void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue) { // Note: In tiered we increment either counters in MethodCounters* or in // MDO depending if we're profiling or not. - const Register Rcounters = G3_scratch; + const Register G3_method_counters = G3_scratch; Label done; if (TieredCompilation) { const int increment = InvocationCounter::count_increment; - const int mask = ((1 << Tier0InvokeNotifyFreqLog) - 1) << InvocationCounter::count_shift; Label no_mdo; if (ProfileInterpreter) { // If no method data exists, go to profile_continue. @@ -297,6 +296,7 @@ void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile Address mdo_invocation_counter(G4_scratch, in_bytes(MethodData::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset())); + Address mask(G4_scratch, in_bytes(MethodData::invoke_mask_offset())); __ increment_mask_and_jump(mdo_invocation_counter, increment, mask, G3_scratch, Lscratch, Assembler::zero, overflow); @@ -305,20 +305,21 @@ void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile // Increment counter in MethodCounters* __ bind(no_mdo); - Address invocation_counter(Rcounters, + Address invocation_counter(G3_method_counters, in_bytes(MethodCounters::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset())); - __ get_method_counters(Lmethod, Rcounters, done); + __ get_method_counters(Lmethod, G3_method_counters, done); + Address mask(G3_method_counters, in_bytes(MethodCounters::invoke_mask_offset())); __ increment_mask_and_jump(invocation_counter, increment, mask, G4_scratch, Lscratch, Assembler::zero, overflow); __ bind(done); - } else { + } else { // not TieredCompilation // Update standard invocation counters - __ get_method_counters(Lmethod, Rcounters, done); - __ increment_invocation_counter(Rcounters, O0, G4_scratch); + __ get_method_counters(Lmethod, G3_method_counters, done); + __ increment_invocation_counter(G3_method_counters, O0, G4_scratch); if (ProfileInterpreter) { - Address interpreter_invocation_counter(Rcounters, + Address interpreter_invocation_counter(G3_method_counters, in_bytes(MethodCounters::interpreter_invocation_counter_offset())); __ ld(interpreter_invocation_counter, G4_scratch); __ inc(G4_scratch); @@ -327,16 +328,16 @@ void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile if (ProfileInterpreter && profile_method != NULL) { // Test to see if we should create a method data oop - AddressLiteral profile_limit((address)&InvocationCounter::InterpreterProfileLimit); - __ load_contents(profile_limit, G3_scratch); - __ cmp_and_br_short(O0, G3_scratch, Assembler::lessUnsigned, Assembler::pn, *profile_method_continue); + Address profile_limit(G3_method_counters, in_bytes(MethodCounters::interpreter_profile_limit_offset())); + __ ld(profile_limit, G1_scratch); + __ cmp_and_br_short(O0, G1_scratch, Assembler::lessUnsigned, Assembler::pn, *profile_method_continue); // if no method data exists, go to profile_method __ test_method_data_pointer(*profile_method); } - AddressLiteral invocation_limit((address)&InvocationCounter::InterpreterInvocationLimit); - __ load_contents(invocation_limit, G3_scratch); + Address invocation_limit(G3_method_counters, in_bytes(MethodCounters::interpreter_invocation_limit_offset())); + __ ld(invocation_limit, G3_scratch); __ cmp(O0, G3_scratch); __ br(Assembler::greaterEqualUnsigned, false, Assembler::pn, *overflow); // Far distance __ delayed()->nop(); diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp index 9424b1be1f6..fe58233ced1 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp @@ -115,7 +115,6 @@ static void do_oop_store(InterpreterMacroAssembler* _masm, } break; case BarrierSet::ModRef: - case BarrierSet::Other: ShouldNotReachHere(); break; default : @@ -1599,13 +1598,12 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { // Bump bytecode pointer by displacement (take the branch) __ delayed()->add( O1_disp, Lbcp, Lbcp ); // add to bc addr - const Register Rcounters = G3_scratch; - __ get_method_counters(Lmethod, Rcounters, Lforward); + const Register G3_method_counters = G3_scratch; + __ get_method_counters(Lmethod, G3_method_counters, Lforward); if (TieredCompilation) { Label Lno_mdo, Loverflow; int increment = InvocationCounter::count_increment; - int mask = ((1 << Tier0BackedgeNotifyFreqLog) - 1) << InvocationCounter::count_shift; if (ProfileInterpreter) { // If no method data exists, go to profile_continue. __ ld_ptr(Lmethod, Method::method_data_offset(), G4_scratch); @@ -1614,6 +1612,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { // Increment backedge counter in the MDO Address mdo_backedge_counter(G4_scratch, in_bytes(MethodData::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset())); + Address mask(G4_scratch, in_bytes(MethodData::backedge_mask_offset())); __ increment_mask_and_jump(mdo_backedge_counter, increment, mask, G3_scratch, O0, Assembler::notZero, &Lforward); __ ba_short(Loverflow); @@ -1621,9 +1620,10 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { // If there's no MDO, increment counter in MethodCounters* __ bind(Lno_mdo); - Address backedge_counter(Rcounters, + Address backedge_counter(G3_method_counters, in_bytes(MethodCounters::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset())); + Address mask(G3_method_counters, in_bytes(MethodCounters::backedge_mask_offset())); __ increment_mask_and_jump(backedge_counter, increment, mask, G4_scratch, O0, Assembler::notZero, &Lforward); __ bind(Loverflow); @@ -1663,18 +1663,19 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { __ jmp(O2, G0); __ delayed()->nop(); - } else { + } else { // not TieredCompilation // Update Backedge branch separately from invocations const Register G4_invoke_ctr = G4; - __ increment_backedge_counter(Rcounters, G4_invoke_ctr, G1_scratch); + __ increment_backedge_counter(G3_method_counters, G4_invoke_ctr, G1_scratch); if (ProfileInterpreter) { - __ test_invocation_counter_for_mdp(G4_invoke_ctr, G3_scratch, Lforward); + __ test_invocation_counter_for_mdp(G4_invoke_ctr, G3_method_counters, G1_scratch, Lforward); if (UseOnStackReplacement) { - __ test_backedge_count_for_osr(O2_bumped_count, l_cur_bcp, G3_scratch); + + __ test_backedge_count_for_osr(O2_bumped_count, G3_method_counters, l_cur_bcp, G1_scratch); } } else { if (UseOnStackReplacement) { - __ test_backedge_count_for_osr(G4_invoke_ctr, l_cur_bcp, G3_scratch); + __ test_backedge_count_for_osr(G4_invoke_ctr, G3_method_counters, l_cur_bcp, G1_scratch); } } } diff --git a/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp b/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp index 718c82904f0..919c2a6df9c 100644 --- a/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -541,15 +541,6 @@ void G1PreBarrierStub::emit_code(LIR_Assembler* ce) { } -jbyte* G1PostBarrierStub::_byte_map_base = NULL; - -jbyte* G1PostBarrierStub::byte_map_base_slow() { - BarrierSet* bs = Universe::heap()->barrier_set(); - assert(bs->is_a(BarrierSet::G1SATBCTLogging), - "Must be if we're using this."); - return ((G1SATBCardTableModRefBS*)bs)->byte_map_base; -} - void G1PostBarrierStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); assert(addr()->is_register(), "Precondition."); diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp index 6235c90df13..7c90c1decda 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -1398,50 +1398,6 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch } -void LIR_Assembler::prefetchr(LIR_Opr src) { - LIR_Address* addr = src->as_address_ptr(); - Address from_addr = as_Address(addr); - - if (VM_Version::supports_sse()) { - switch (ReadPrefetchInstr) { - case 0: - __ prefetchnta(from_addr); break; - case 1: - __ prefetcht0(from_addr); break; - case 2: - __ prefetcht2(from_addr); break; - default: - ShouldNotReachHere(); break; - } - } else if (VM_Version::supports_3dnow_prefetch()) { - __ prefetchr(from_addr); - } -} - - -void LIR_Assembler::prefetchw(LIR_Opr src) { - LIR_Address* addr = src->as_address_ptr(); - Address from_addr = as_Address(addr); - - if (VM_Version::supports_sse()) { - switch (AllocatePrefetchInstr) { - case 0: - __ prefetchnta(from_addr); break; - case 1: - __ prefetcht0(from_addr); break; - case 2: - __ prefetcht2(from_addr); break; - case 3: - __ prefetchw(from_addr); break; - default: - ShouldNotReachHere(); break; - } - } else if (VM_Version::supports_3dnow_prefetch()) { - __ prefetchw(from_addr); - } -} - - NEEDS_CLEANUP; // This could be static? Address::ScaleFactor LIR_Assembler::array_element_size(BasicType type) const { int elem_size = type2aelembytes(type); diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp index 71d89bb82f5..654f0689ec2 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.cpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -123,7 +123,9 @@ bool frame::safe_for_sender(JavaThread *thread) { } intptr_t* sender_sp = NULL; + intptr_t* sender_unextended_sp = NULL; address sender_pc = NULL; + intptr_t* saved_fp = NULL; if (is_interpreted_frame()) { // fp must be safe @@ -132,7 +134,12 @@ bool frame::safe_for_sender(JavaThread *thread) { } sender_pc = (address) this->fp()[return_addr_offset]; + // for interpreted frames, the value below is the sender "raw" sp, + // which can be different from the sender unextended sp (the sp seen + // by the sender) because of current frame local variables sender_sp = (intptr_t*) addr_at(sender_sp_offset); + sender_unextended_sp = (intptr_t*) this->fp()[interpreter_frame_sender_sp_offset]; + saved_fp = (intptr_t*) this->fp()[link_offset]; } else { // must be some sort of compiled/runtime frame @@ -144,8 +151,11 @@ bool frame::safe_for_sender(JavaThread *thread) { } sender_sp = _unextended_sp + _cb->frame_size(); + sender_unextended_sp = sender_sp; // On Intel the return_address is always the word on the stack sender_pc = (address) *(sender_sp-1); + // Note: frame::sender_sp_offset is only valid for compiled frame + saved_fp = (intptr_t*) *(sender_sp - frame::sender_sp_offset); } @@ -156,7 +166,6 @@ bool frame::safe_for_sender(JavaThread *thread) { // only if the sender is interpreted/call_stub (c1 too?) are we certain that the saved ebp // is really a frame pointer. - intptr_t *saved_fp = (intptr_t*)*(sender_sp - frame::sender_sp_offset); bool saved_fp_safe = ((address)saved_fp < thread->stack_base()) && (saved_fp > sender_sp); if (!saved_fp_safe) { @@ -165,7 +174,7 @@ bool frame::safe_for_sender(JavaThread *thread) { // construct the potential sender - frame sender(sender_sp, saved_fp, sender_pc); + frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc); return sender.is_interpreted_frame_valid(thread); @@ -194,7 +203,6 @@ bool frame::safe_for_sender(JavaThread *thread) { // Could be the call_stub if (StubRoutines::returns_to_call_stub(sender_pc)) { - intptr_t *saved_fp = (intptr_t*)*(sender_sp - frame::sender_sp_offset); bool saved_fp_safe = ((address)saved_fp < thread->stack_base()) && (saved_fp > sender_sp); if (!saved_fp_safe) { @@ -203,7 +211,7 @@ bool frame::safe_for_sender(JavaThread *thread) { // construct the potential sender - frame sender(sender_sp, saved_fp, sender_pc); + frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc); // Validate the JavaCallWrapper an entry frame must have address jcw = (address)sender.entry_frame_call_wrapper(); @@ -568,8 +576,11 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { if (!m->is_valid_method()) return false; // stack frames shouldn't be much larger than max_stack elements - - if (fp() - sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) { + // this test requires the use the unextended_sp which is the sp as seen by + // the current frame, and not sp which is the "raw" pc which could point + // further because of local variables of the callee method inserted after + // method arguments + if (fp() - unextended_sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) { return false; } diff --git a/hotspot/src/cpu/x86/vm/globals_x86.hpp b/hotspot/src/cpu/x86/vm/globals_x86.hpp index 1401997b3a1..81b3b81a36c 100644 --- a/hotspot/src/cpu/x86/vm/globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -90,9 +90,6 @@ define_pd_global(uintx, TypeProfileLevel, 111); product(intx, FenceInstruction, 0, \ "(Unsafe,Unstable) Experimental") \ \ - product(intx, ReadPrefetchInstr, 0, \ - "Prefetch instruction to prefetch ahead") \ - \ product(bool, UseStoreImmI16, true, \ "Use store immediate 16-bits value instruction on x86") \ \ diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp index 181ee15251b..9aa4587f793 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp @@ -1360,7 +1360,7 @@ void InterpreterMacroAssembler::verify_FPU(int stack_depth, TosState state) { // Jump if ((*counter_addr += increment) & mask) satisfies the condition. void InterpreterMacroAssembler::increment_mask_and_jump(Address counter_addr, - int increment, int mask, + int increment, Address mask, Register scratch, bool preloaded, Condition cond, Label* where) { if (!preloaded) { diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp index e4d61364de4..2cd8e162fde 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp @@ -182,7 +182,7 @@ void increment_mdp_data_at(Register mdp_in, Register reg, int constant, bool decrement = false); void increment_mask_and_jump(Address counter_addr, - int increment, int mask, + int increment, Address mask, Register scratch, bool preloaded, Condition cond, Label* where); void set_mdp_flag_at(Register mdp_in, int flag_constant); diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp index 23e3b973041..76335ca9fcc 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp @@ -1426,7 +1426,7 @@ void InterpreterMacroAssembler::verify_FPU(int stack_depth, TosState state) { // Jump if ((*counter_addr += increment) & mask) satisfies the condition. void InterpreterMacroAssembler::increment_mask_and_jump(Address counter_addr, - int increment, int mask, + int increment, Address mask, Register scratch, bool preloaded, Condition cond, Label* where) { if (!preloaded) { diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp index a1cd4466bb9..c4ed238bc20 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp @@ -191,7 +191,7 @@ void increment_mdp_data_at(Register mdp_in, Register reg, int constant, bool decrement = false); void increment_mask_and_jump(Address counter_addr, - int increment, int mask, + int increment, Address mask, Register scratch, bool preloaded, Condition cond, Label* where); void set_mdp_flag_at(Register mdp_in, int flag_constant); diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index a6a5b43c07b..2cb6bd820d0 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -3184,7 +3184,24 @@ void MacroAssembler::pow_or_exp(bool is_exp, int num_fpu_regs_in_use) { jmp(done); } else { // Stack: X Y - Label x_negative, y_odd; + Label x_negative, y_not_2; + + static double two = 2.0; + ExternalAddress two_addr((address)&two); + + // constant maybe too far on 64 bit + lea(tmp2, two_addr); + fld_d(Address(tmp2, 0)); // Stack: 2 X Y + fcmp(tmp, 2, true, false); // Stack: X Y + jcc(Assembler::parity, y_not_2); + jcc(Assembler::notEqual, y_not_2); + + fxch(); fpop(); // Stack: X + fmul(0); // Stack: X*X + + jmp(done); + + bind(y_not_2); fldz(); // Stack: 0 X Y fcmp(tmp, 1, true, false); // Stack: X Y @@ -6177,7 +6194,7 @@ void MacroAssembler::string_indexofC8(Register str1, Register str2, ShortBranchVerifier sbv(this); assert(UseSSE42Intrinsics, "SSE4.2 is required"); - // This method uses pcmpestri inxtruction with bound registers + // This method uses pcmpestri instruction with bound registers // inputs: // xmm - substring // rax - substring length (elements count) @@ -6338,7 +6355,7 @@ void MacroAssembler::string_indexof(Register str1, Register str2, // assert(int_cnt2 == -1 || (0 < int_cnt2 && int_cnt2 < 8), "should be != 0"); - // This method uses pcmpestri inxtruction with bound registers + // This method uses pcmpestri instruction with bound registers // inputs: // xmm - substring // rax - substring length (elements count) @@ -6627,7 +6644,6 @@ void MacroAssembler::string_compare(Register str1, Register str2, // start from first character again because it has aligned address. int stride2 = 16; int adr_stride = stride << scale; - int adr_stride2 = stride2 << scale; assert(result == rax && cnt2 == rdx && cnt1 == rcx, "pcmpestri"); // rax and rdx are used by pcmpestri as elements counters @@ -6726,7 +6742,7 @@ void MacroAssembler::string_compare(Register str1, Register str2, // inputs: // vec1- substring // rax - negative string length (elements count) - // mem - scaned string + // mem - scanned string // rdx - string length (elements count) // pcmpmask - cmp mode: 11000 (string compare with negated result) // + 00 (unsigned bytes) or + 01 (unsigned shorts) diff --git a/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp b/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp index cc1573e720a..c38455f1fca 100644 --- a/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp +++ b/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp @@ -602,7 +602,3 @@ address NativeGeneralJump::jump_destination() const { else return addr_at(0) + length + sbyte_at(offset); } - -bool NativeInstruction::is_dtrace_trap() { - return (*(int32_t*)this & 0xff) == 0xcc; -} diff --git a/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp b/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp index 4a4de7116bd..529512731cf 100644 --- a/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp +++ b/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp @@ -59,7 +59,6 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC { }; bool is_nop() { return ubyte_at(0) == nop_instruction_code; } - bool is_dtrace_trap(); inline bool is_call(); inline bool is_illegal(); inline bool is_return(); diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp index c97b4309782..a4b8fbc8cfd 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp @@ -2415,381 +2415,6 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, } -#ifdef HAVE_DTRACE_H -// --------------------------------------------------------------------------- -// Generate a dtrace nmethod for a given signature. The method takes arguments -// in the Java compiled code convention, marshals them to the native -// abi and then leaves nops at the position you would expect to call a native -// function. When the probe is enabled the nops are replaced with a trap -// instruction that dtrace inserts and the trace will cause a notification -// to dtrace. -// -// The probes are only able to take primitive types and java/lang/String as -// arguments. No other java types are allowed. Strings are converted to utf8 -// strings so that from dtrace point of view java strings are converted to C -// strings. There is an arbitrary fixed limit on the total space that a method -// can use for converting the strings. (256 chars per string in the signature). -// So any java string larger then this is truncated. - -nmethod *SharedRuntime::generate_dtrace_nmethod( - MacroAssembler *masm, methodHandle method) { - - // generate_dtrace_nmethod is guarded by a mutex so we are sure to - // be single threaded in this method. - assert(AdapterHandlerLibrary_lock->owned_by_self(), "must be"); - - // Fill in the signature array, for the calling-convention call. - int total_args_passed = method->size_of_parameters(); - - BasicType* in_sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_args_passed); - VMRegPair *in_regs = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed); - - // The signature we are going to use for the trap that dtrace will see - // java/lang/String is converted. We drop "this" and any other object - // is converted to NULL. (A one-slot java/lang/Long object reference - // is converted to a two-slot long, which is why we double the allocation). - BasicType* out_sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_args_passed * 2); - VMRegPair* out_regs = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed * 2); - - int i=0; - int total_strings = 0; - int first_arg_to_pass = 0; - int total_c_args = 0; - - if( !method->is_static() ) { // Pass in receiver first - in_sig_bt[i++] = T_OBJECT; - first_arg_to_pass = 1; - } - - // We need to convert the java args to where a native (non-jni) function - // would expect them. To figure out where they go we convert the java - // signature to a C signature. - - SignatureStream ss(method->signature()); - for ( ; !ss.at_return_type(); ss.next()) { - BasicType bt = ss.type(); - in_sig_bt[i++] = bt; // Collect remaining bits of signature - out_sig_bt[total_c_args++] = bt; - if( bt == T_OBJECT) { - Symbol* s = ss.as_symbol_or_null(); // symbol is created - if (s == vmSymbols::java_lang_String()) { - total_strings++; - out_sig_bt[total_c_args-1] = T_ADDRESS; - } else if (s == vmSymbols::java_lang_Boolean() || - s == vmSymbols::java_lang_Character() || - s == vmSymbols::java_lang_Byte() || - s == vmSymbols::java_lang_Short() || - s == vmSymbols::java_lang_Integer() || - s == vmSymbols::java_lang_Float()) { - out_sig_bt[total_c_args-1] = T_INT; - } else if (s == vmSymbols::java_lang_Long() || - s == vmSymbols::java_lang_Double()) { - out_sig_bt[total_c_args-1] = T_LONG; - out_sig_bt[total_c_args++] = T_VOID; - } - } else if ( bt == T_LONG || bt == T_DOUBLE ) { - in_sig_bt[i++] = T_VOID; // Longs & doubles take 2 Java slots - out_sig_bt[total_c_args++] = T_VOID; - } - } - - assert(i==total_args_passed, "validly parsed signature"); - - // Now get the compiled-Java layout as input arguments - int comp_args_on_stack; - comp_args_on_stack = SharedRuntime::java_calling_convention( - in_sig_bt, in_regs, total_args_passed, false); - - // Now figure out where the args must be stored and how much stack space - // they require (neglecting out_preserve_stack_slots). - - int out_arg_slots; - out_arg_slots = c_calling_convention(out_sig_bt, out_regs, NULL, total_c_args); - - // Calculate the total number of stack slots we will need. - - // First count the abi requirement plus all of the outgoing args - int stack_slots = SharedRuntime::out_preserve_stack_slots() + out_arg_slots; - - // Now space for the string(s) we must convert - - int* string_locs = NEW_RESOURCE_ARRAY(int, total_strings + 1); - for (i = 0; i < total_strings ; i++) { - string_locs[i] = stack_slots; - stack_slots += max_dtrace_string_size / VMRegImpl::stack_slot_size; - } - - // + 2 for return address (which we own) and saved rbp, - - stack_slots += 2; - - // Ok The space we have allocated will look like: - // - // - // FP-> | | - // |---------------------| - // | string[n] | - // |---------------------| <- string_locs[n] - // | string[n-1] | - // |---------------------| <- string_locs[n-1] - // | ... | - // | ... | - // |---------------------| <- string_locs[1] - // | string[0] | - // |---------------------| <- string_locs[0] - // | outbound memory | - // | based arguments | - // | | - // |---------------------| - // | | - // SP-> | out_preserved_slots | - // - // - - // Now compute actual number of stack words we need rounding to make - // stack properly aligned. - stack_slots = round_to(stack_slots, 2 * VMRegImpl::slots_per_word); - - int stack_size = stack_slots * VMRegImpl::stack_slot_size; - - intptr_t start = (intptr_t)__ pc(); - - // First thing make an ic check to see if we should even be here - - // We are free to use all registers as temps without saving them and - // restoring them except rbp. rbp, is the only callee save register - // as far as the interpreter and the compiler(s) are concerned. - - const Register ic_reg = rax; - const Register receiver = rcx; - Label hit; - Label exception_pending; - - - __ verify_oop(receiver); - __ cmpl(ic_reg, Address(receiver, oopDesc::klass_offset_in_bytes())); - __ jcc(Assembler::equal, hit); - - __ jump(RuntimeAddress(SharedRuntime::get_ic_miss_stub())); - - // verified entry must be aligned for code patching. - // and the first 5 bytes must be in the same cache line - // if we align at 8 then we will be sure 5 bytes are in the same line - __ align(8); - - __ bind(hit); - - int vep_offset = ((intptr_t)__ pc()) - start; - - - // The instruction at the verified entry point must be 5 bytes or longer - // because it can be patched on the fly by make_non_entrant. The stack bang - // instruction fits that requirement. - - // Generate stack overflow check - - - if (UseStackBanging) { - if (stack_size <= StackShadowPages*os::vm_page_size()) { - __ bang_stack_with_offset(StackShadowPages*os::vm_page_size()); - } else { - __ movl(rax, stack_size); - __ bang_stack_size(rax, rbx); - } - } else { - // need a 5 byte instruction to allow MT safe patching to non-entrant - __ fat_nop(); - } - - assert(((int)__ pc() - start - vep_offset) >= 5, - "valid size for make_non_entrant"); - - // Generate a new frame for the wrapper. - __ enter(); - - // -2 because return address is already present and so is saved rbp, - if (stack_size - 2*wordSize != 0) { - __ subl(rsp, stack_size - 2*wordSize); - } - - // Frame is now completed as far a size and linkage. - - int frame_complete = ((intptr_t)__ pc()) - start; - - // First thing we do store all the args as if we are doing the call. - // Since the C calling convention is stack based that ensures that - // all the Java register args are stored before we need to convert any - // string we might have. - - int sid = 0; - int c_arg, j_arg; - int string_reg = 0; - - for (j_arg = first_arg_to_pass, c_arg = 0 ; - j_arg < total_args_passed ; j_arg++, c_arg++ ) { - - VMRegPair src = in_regs[j_arg]; - VMRegPair dst = out_regs[c_arg]; - assert(dst.first()->is_stack() || in_sig_bt[j_arg] == T_VOID, - "stack based abi assumed"); - - switch (in_sig_bt[j_arg]) { - - case T_ARRAY: - case T_OBJECT: - if (out_sig_bt[c_arg] == T_ADDRESS) { - // Any register based arg for a java string after the first - // will be destroyed by the call to get_utf so we store - // the original value in the location the utf string address - // will eventually be stored. - if (src.first()->is_reg()) { - if (string_reg++ != 0) { - simple_move32(masm, src, dst); - } - } - } else if (out_sig_bt[c_arg] == T_INT || out_sig_bt[c_arg] == T_LONG) { - // need to unbox a one-word value - Register in_reg = rax; - if ( src.first()->is_reg() ) { - in_reg = src.first()->as_Register(); - } else { - simple_move32(masm, src, in_reg->as_VMReg()); - } - Label skipUnbox; - __ movl(Address(rsp, reg2offset_out(dst.first())), NULL_WORD); - if ( out_sig_bt[c_arg] == T_LONG ) { - __ movl(Address(rsp, reg2offset_out(dst.second())), NULL_WORD); - } - __ testl(in_reg, in_reg); - __ jcc(Assembler::zero, skipUnbox); - assert(dst.first()->is_stack() && - (!dst.second()->is_valid() || dst.second()->is_stack()), - "value(s) must go into stack slots"); - - BasicType bt = out_sig_bt[c_arg]; - int box_offset = java_lang_boxing_object::value_offset_in_bytes(bt); - if ( bt == T_LONG ) { - __ movl(rbx, Address(in_reg, - box_offset + VMRegImpl::stack_slot_size)); - __ movl(Address(rsp, reg2offset_out(dst.second())), rbx); - } - __ movl(in_reg, Address(in_reg, box_offset)); - __ movl(Address(rsp, reg2offset_out(dst.first())), in_reg); - __ bind(skipUnbox); - } else { - // Convert the arg to NULL - __ movl(Address(rsp, reg2offset_out(dst.first())), NULL_WORD); - } - if (out_sig_bt[c_arg] == T_LONG) { - assert(out_sig_bt[c_arg+1] == T_VOID, "must be"); - ++c_arg; // Move over the T_VOID To keep the loop indices in sync - } - break; - - case T_VOID: - break; - - case T_FLOAT: - float_move(masm, src, dst); - break; - - case T_DOUBLE: - assert( j_arg + 1 < total_args_passed && - in_sig_bt[j_arg + 1] == T_VOID, "bad arg list"); - double_move(masm, src, dst); - break; - - case T_LONG : - long_move(masm, src, dst); - break; - - case T_ADDRESS: assert(false, "found T_ADDRESS in java args"); - - default: - simple_move32(masm, src, dst); - } - } - - // Now we must convert any string we have to utf8 - // - - for (sid = 0, j_arg = first_arg_to_pass, c_arg = 0 ; - sid < total_strings ; j_arg++, c_arg++ ) { - - if (out_sig_bt[c_arg] == T_ADDRESS) { - - Address utf8_addr = Address( - rsp, string_locs[sid++] * VMRegImpl::stack_slot_size); - __ leal(rax, utf8_addr); - - // The first string we find might still be in the original java arg - // register - VMReg orig_loc = in_regs[j_arg].first(); - Register string_oop; - - // This is where the argument will eventually reside - Address dest = Address(rsp, reg2offset_out(out_regs[c_arg].first())); - - if (sid == 1 && orig_loc->is_reg()) { - string_oop = orig_loc->as_Register(); - assert(string_oop != rax, "smashed arg"); - } else { - - if (orig_loc->is_reg()) { - // Get the copy of the jls object - __ movl(rcx, dest); - } else { - // arg is still in the original location - __ movl(rcx, Address(rbp, reg2offset_in(orig_loc))); - } - string_oop = rcx; - - } - Label nullString; - __ movl(dest, NULL_WORD); - __ testl(string_oop, string_oop); - __ jcc(Assembler::zero, nullString); - - // Now we can store the address of the utf string as the argument - __ movl(dest, rax); - - // And do the conversion - __ call_VM_leaf(CAST_FROM_FN_PTR( - address, SharedRuntime::get_utf), string_oop, rax); - __ bind(nullString); - } - - if (in_sig_bt[j_arg] == T_OBJECT && out_sig_bt[c_arg] == T_LONG) { - assert(out_sig_bt[c_arg+1] == T_VOID, "must be"); - ++c_arg; // Move over the T_VOID To keep the loop indices in sync - } - } - - - // Ok now we are done. Need to place the nop that dtrace wants in order to - // patch in the trap - - int patch_offset = ((intptr_t)__ pc()) - start; - - __ nop(); - - - // Return - - __ leave(); - __ ret(0); - - __ flush(); - - nmethod *nm = nmethod::new_dtrace_nmethod( - method, masm->code(), vep_offset, patch_offset, frame_complete, - stack_slots / VMRegImpl::slots_per_word); - return nm; - -} - -#endif // HAVE_DTRACE_H - // this function returns the adjust size (in number of words) to a c2i adapter // activation for use during deoptimization int Deoptimization::last_frame_adjust(int callee_parameters, int callee_locals ) { diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index be2bfcfa02d..afc137b69c2 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -2650,630 +2650,6 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, } -#ifdef HAVE_DTRACE_H -// --------------------------------------------------------------------------- -// Generate a dtrace nmethod for a given signature. The method takes arguments -// in the Java compiled code convention, marshals them to the native -// abi and then leaves nops at the position you would expect to call a native -// function. When the probe is enabled the nops are replaced with a trap -// instruction that dtrace inserts and the trace will cause a notification -// to dtrace. -// -// The probes are only able to take primitive types and java/lang/String as -// arguments. No other java types are allowed. Strings are converted to utf8 -// strings so that from dtrace point of view java strings are converted to C -// strings. There is an arbitrary fixed limit on the total space that a method -// can use for converting the strings. (256 chars per string in the signature). -// So any java string larger then this is truncated. - -static int fp_offset[ConcreteRegisterImpl::number_of_registers] = { 0 }; -static bool offsets_initialized = false; - - -nmethod *SharedRuntime::generate_dtrace_nmethod(MacroAssembler *masm, - methodHandle method) { - - - // generate_dtrace_nmethod is guarded by a mutex so we are sure to - // be single threaded in this method. - assert(AdapterHandlerLibrary_lock->owned_by_self(), "must be"); - - if (!offsets_initialized) { - fp_offset[c_rarg0->as_VMReg()->value()] = -1 * wordSize; - fp_offset[c_rarg1->as_VMReg()->value()] = -2 * wordSize; - fp_offset[c_rarg2->as_VMReg()->value()] = -3 * wordSize; - fp_offset[c_rarg3->as_VMReg()->value()] = -4 * wordSize; - fp_offset[c_rarg4->as_VMReg()->value()] = -5 * wordSize; - fp_offset[c_rarg5->as_VMReg()->value()] = -6 * wordSize; - - fp_offset[c_farg0->as_VMReg()->value()] = -7 * wordSize; - fp_offset[c_farg1->as_VMReg()->value()] = -8 * wordSize; - fp_offset[c_farg2->as_VMReg()->value()] = -9 * wordSize; - fp_offset[c_farg3->as_VMReg()->value()] = -10 * wordSize; - fp_offset[c_farg4->as_VMReg()->value()] = -11 * wordSize; - fp_offset[c_farg5->as_VMReg()->value()] = -12 * wordSize; - fp_offset[c_farg6->as_VMReg()->value()] = -13 * wordSize; - fp_offset[c_farg7->as_VMReg()->value()] = -14 * wordSize; - - offsets_initialized = true; - } - // Fill in the signature array, for the calling-convention call. - int total_args_passed = method->size_of_parameters(); - - BasicType* in_sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_args_passed); - VMRegPair *in_regs = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed); - - // The signature we are going to use for the trap that dtrace will see - // java/lang/String is converted. We drop "this" and any other object - // is converted to NULL. (A one-slot java/lang/Long object reference - // is converted to a two-slot long, which is why we double the allocation). - BasicType* out_sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_args_passed * 2); - VMRegPair* out_regs = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed * 2); - - int i=0; - int total_strings = 0; - int first_arg_to_pass = 0; - int total_c_args = 0; - - // Skip the receiver as dtrace doesn't want to see it - if( !method->is_static() ) { - in_sig_bt[i++] = T_OBJECT; - first_arg_to_pass = 1; - } - - // We need to convert the java args to where a native (non-jni) function - // would expect them. To figure out where they go we convert the java - // signature to a C signature. - - SignatureStream ss(method->signature()); - for ( ; !ss.at_return_type(); ss.next()) { - BasicType bt = ss.type(); - in_sig_bt[i++] = bt; // Collect remaining bits of signature - out_sig_bt[total_c_args++] = bt; - if( bt == T_OBJECT) { - Symbol* s = ss.as_symbol_or_null(); // symbol is created - if (s == vmSymbols::java_lang_String()) { - total_strings++; - out_sig_bt[total_c_args-1] = T_ADDRESS; - } else if (s == vmSymbols::java_lang_Boolean() || - s == vmSymbols::java_lang_Character() || - s == vmSymbols::java_lang_Byte() || - s == vmSymbols::java_lang_Short() || - s == vmSymbols::java_lang_Integer() || - s == vmSymbols::java_lang_Float()) { - out_sig_bt[total_c_args-1] = T_INT; - } else if (s == vmSymbols::java_lang_Long() || - s == vmSymbols::java_lang_Double()) { - out_sig_bt[total_c_args-1] = T_LONG; - out_sig_bt[total_c_args++] = T_VOID; - } - } else if ( bt == T_LONG || bt == T_DOUBLE ) { - in_sig_bt[i++] = T_VOID; // Longs & doubles take 2 Java slots - // We convert double to long - out_sig_bt[total_c_args-1] = T_LONG; - out_sig_bt[total_c_args++] = T_VOID; - } else if ( bt == T_FLOAT) { - // We convert float to int - out_sig_bt[total_c_args-1] = T_INT; - } - } - - assert(i==total_args_passed, "validly parsed signature"); - - // Now get the compiled-Java layout as input arguments - int comp_args_on_stack; - comp_args_on_stack = SharedRuntime::java_calling_convention( - in_sig_bt, in_regs, total_args_passed, false); - - // Now figure out where the args must be stored and how much stack space - // they require (neglecting out_preserve_stack_slots but space for storing - // the 1st six register arguments). It's weird see int_stk_helper. - - int out_arg_slots; - out_arg_slots = c_calling_convention(out_sig_bt, out_regs, NULL, total_c_args); - - // Calculate the total number of stack slots we will need. - - // First count the abi requirement plus all of the outgoing args - int stack_slots = SharedRuntime::out_preserve_stack_slots() + out_arg_slots; - - // Now space for the string(s) we must convert - int* string_locs = NEW_RESOURCE_ARRAY(int, total_strings + 1); - for (i = 0; i < total_strings ; i++) { - string_locs[i] = stack_slots; - stack_slots += max_dtrace_string_size / VMRegImpl::stack_slot_size; - } - - // Plus the temps we might need to juggle register args - // regs take two slots each - stack_slots += (Argument::n_int_register_parameters_c + - Argument::n_float_register_parameters_c) * 2; - - - // + 4 for return address (which we own) and saved rbp, - - stack_slots += 4; - - // Ok The space we have allocated will look like: - // - // - // FP-> | | - // |---------------------| - // | string[n] | - // |---------------------| <- string_locs[n] - // | string[n-1] | - // |---------------------| <- string_locs[n-1] - // | ... | - // | ... | - // |---------------------| <- string_locs[1] - // | string[0] | - // |---------------------| <- string_locs[0] - // | outbound memory | - // | based arguments | - // | | - // |---------------------| - // | | - // SP-> | out_preserved_slots | - // - // - - // Now compute actual number of stack words we need rounding to make - // stack properly aligned. - stack_slots = round_to(stack_slots, 4 * VMRegImpl::slots_per_word); - - int stack_size = stack_slots * VMRegImpl::stack_slot_size; - - intptr_t start = (intptr_t)__ pc(); - - // First thing make an ic check to see if we should even be here - - // We are free to use all registers as temps without saving them and - // restoring them except rbp. rbp, is the only callee save register - // as far as the interpreter and the compiler(s) are concerned. - - const Register ic_reg = rax; - const Register receiver = rcx; - Label hit; - Label exception_pending; - - - __ verify_oop(receiver); - __ cmpl(ic_reg, Address(receiver, oopDesc::klass_offset_in_bytes())); - __ jcc(Assembler::equal, hit); - - __ jump(RuntimeAddress(SharedRuntime::get_ic_miss_stub())); - - // verified entry must be aligned for code patching. - // and the first 5 bytes must be in the same cache line - // if we align at 8 then we will be sure 5 bytes are in the same line - __ align(8); - - __ bind(hit); - - int vep_offset = ((intptr_t)__ pc()) - start; - - - // The instruction at the verified entry point must be 5 bytes or longer - // because it can be patched on the fly by make_non_entrant. The stack bang - // instruction fits that requirement. - - // Generate stack overflow check - - if (UseStackBanging) { - if (stack_size <= StackShadowPages*os::vm_page_size()) { - __ bang_stack_with_offset(StackShadowPages*os::vm_page_size()); - } else { - __ movl(rax, stack_size); - __ bang_stack_size(rax, rbx); - } - } else { - // need a 5 byte instruction to allow MT safe patching to non-entrant - __ fat_nop(); - } - - assert(((uintptr_t)__ pc() - start - vep_offset) >= 5, - "valid size for make_non_entrant"); - - // Generate a new frame for the wrapper. - __ enter(); - - // -4 because return address is already present and so is saved rbp, - if (stack_size - 2*wordSize != 0) { - __ subq(rsp, stack_size - 2*wordSize); - } - - // Frame is now completed as far a size and linkage. - - int frame_complete = ((intptr_t)__ pc()) - start; - - int c_arg, j_arg; - - // State of input register args - - bool live[ConcreteRegisterImpl::number_of_registers]; - - live[j_rarg0->as_VMReg()->value()] = false; - live[j_rarg1->as_VMReg()->value()] = false; - live[j_rarg2->as_VMReg()->value()] = false; - live[j_rarg3->as_VMReg()->value()] = false; - live[j_rarg4->as_VMReg()->value()] = false; - live[j_rarg5->as_VMReg()->value()] = false; - - live[j_farg0->as_VMReg()->value()] = false; - live[j_farg1->as_VMReg()->value()] = false; - live[j_farg2->as_VMReg()->value()] = false; - live[j_farg3->as_VMReg()->value()] = false; - live[j_farg4->as_VMReg()->value()] = false; - live[j_farg5->as_VMReg()->value()] = false; - live[j_farg6->as_VMReg()->value()] = false; - live[j_farg7->as_VMReg()->value()] = false; - - - bool rax_is_zero = false; - - // All args (except strings) destined for the stack are moved first - for (j_arg = first_arg_to_pass, c_arg = 0 ; - j_arg < total_args_passed ; j_arg++, c_arg++ ) { - VMRegPair src = in_regs[j_arg]; - VMRegPair dst = out_regs[c_arg]; - - // Get the real reg value or a dummy (rsp) - - int src_reg = src.first()->is_reg() ? - src.first()->value() : - rsp->as_VMReg()->value(); - - bool useless = in_sig_bt[j_arg] == T_ARRAY || - (in_sig_bt[j_arg] == T_OBJECT && - out_sig_bt[c_arg] != T_INT && - out_sig_bt[c_arg] != T_ADDRESS && - out_sig_bt[c_arg] != T_LONG); - - live[src_reg] = !useless; - - if (dst.first()->is_stack()) { - - // Even though a string arg in a register is still live after this loop - // after the string conversion loop (next) it will be dead so we take - // advantage of that now for simpler code to manage live. - - live[src_reg] = false; - switch (in_sig_bt[j_arg]) { - - case T_ARRAY: - case T_OBJECT: - { - Address stack_dst(rsp, reg2offset_out(dst.first())); - - if (out_sig_bt[c_arg] == T_INT || out_sig_bt[c_arg] == T_LONG) { - // need to unbox a one-word value - Register in_reg = rax; - if ( src.first()->is_reg() ) { - in_reg = src.first()->as_Register(); - } else { - __ movq(rax, Address(rbp, reg2offset_in(src.first()))); - rax_is_zero = false; - } - Label skipUnbox; - __ movptr(Address(rsp, reg2offset_out(dst.first())), - (int32_t)NULL_WORD); - __ testq(in_reg, in_reg); - __ jcc(Assembler::zero, skipUnbox); - - BasicType bt = out_sig_bt[c_arg]; - int box_offset = java_lang_boxing_object::value_offset_in_bytes(bt); - Address src1(in_reg, box_offset); - if ( bt == T_LONG ) { - __ movq(in_reg, src1); - __ movq(stack_dst, in_reg); - assert(out_sig_bt[c_arg+1] == T_VOID, "must be"); - ++c_arg; // skip over T_VOID to keep the loop indices in sync - } else { - __ movl(in_reg, src1); - __ movl(stack_dst, in_reg); - } - - __ bind(skipUnbox); - } else if (out_sig_bt[c_arg] != T_ADDRESS) { - // Convert the arg to NULL - if (!rax_is_zero) { - __ xorq(rax, rax); - rax_is_zero = true; - } - __ movq(stack_dst, rax); - } - } - break; - - case T_VOID: - break; - - case T_FLOAT: - // This does the right thing since we know it is destined for the - // stack - float_move(masm, src, dst); - break; - - case T_DOUBLE: - // This does the right thing since we know it is destined for the - // stack - double_move(masm, src, dst); - break; - - case T_LONG : - long_move(masm, src, dst); - break; - - case T_ADDRESS: assert(false, "found T_ADDRESS in java args"); - - default: - move32_64(masm, src, dst); - } - } - - } - - // If we have any strings we must store any register based arg to the stack - // This includes any still live xmm registers too. - - int sid = 0; - - if (total_strings > 0 ) { - for (j_arg = first_arg_to_pass, c_arg = 0 ; - j_arg < total_args_passed ; j_arg++, c_arg++ ) { - VMRegPair src = in_regs[j_arg]; - VMRegPair dst = out_regs[c_arg]; - - if (src.first()->is_reg()) { - Address src_tmp(rbp, fp_offset[src.first()->value()]); - - // string oops were left untouched by the previous loop even if the - // eventual (converted) arg is destined for the stack so park them - // away now (except for first) - - if (out_sig_bt[c_arg] == T_ADDRESS) { - Address utf8_addr = Address( - rsp, string_locs[sid++] * VMRegImpl::stack_slot_size); - if (sid != 1) { - // The first string arg won't be killed until after the utf8 - // conversion - __ movq(utf8_addr, src.first()->as_Register()); - } - } else if (dst.first()->is_reg()) { - if (in_sig_bt[j_arg] == T_FLOAT || in_sig_bt[j_arg] == T_DOUBLE) { - - // Convert the xmm register to an int and store it in the reserved - // location for the eventual c register arg - XMMRegister f = src.first()->as_XMMRegister(); - if (in_sig_bt[j_arg] == T_FLOAT) { - __ movflt(src_tmp, f); - } else { - __ movdbl(src_tmp, f); - } - } else { - // If the arg is an oop type we don't support don't bother to store - // it remember string was handled above. - bool useless = in_sig_bt[j_arg] == T_ARRAY || - (in_sig_bt[j_arg] == T_OBJECT && - out_sig_bt[c_arg] != T_INT && - out_sig_bt[c_arg] != T_LONG); - - if (!useless) { - __ movq(src_tmp, src.first()->as_Register()); - } - } - } - } - if (in_sig_bt[j_arg] == T_OBJECT && out_sig_bt[c_arg] == T_LONG) { - assert(out_sig_bt[c_arg+1] == T_VOID, "must be"); - ++c_arg; // skip over T_VOID to keep the loop indices in sync - } - } - - // Now that the volatile registers are safe, convert all the strings - sid = 0; - - for (j_arg = first_arg_to_pass, c_arg = 0 ; - j_arg < total_args_passed ; j_arg++, c_arg++ ) { - if (out_sig_bt[c_arg] == T_ADDRESS) { - // It's a string - Address utf8_addr = Address( - rsp, string_locs[sid++] * VMRegImpl::stack_slot_size); - // The first string we find might still be in the original java arg - // register - - VMReg src = in_regs[j_arg].first(); - - // We will need to eventually save the final argument to the trap - // in the von-volatile location dedicated to src. This is the offset - // from fp we will use. - int src_off = src->is_reg() ? - fp_offset[src->value()] : reg2offset_in(src); - - // This is where the argument will eventually reside - VMRegPair dst = out_regs[c_arg]; - - if (src->is_reg()) { - if (sid == 1) { - __ movq(c_rarg0, src->as_Register()); - } else { - __ movq(c_rarg0, utf8_addr); - } - } else { - // arg is still in the original location - __ movq(c_rarg0, Address(rbp, reg2offset_in(src))); - } - Label done, convert; - - // see if the oop is NULL - __ testq(c_rarg0, c_rarg0); - __ jcc(Assembler::notEqual, convert); - - if (dst.first()->is_reg()) { - // Save the ptr to utf string in the origina src loc or the tmp - // dedicated to it - __ movq(Address(rbp, src_off), c_rarg0); - } else { - __ movq(Address(rsp, reg2offset_out(dst.first())), c_rarg0); - } - __ jmp(done); - - __ bind(convert); - - __ lea(c_rarg1, utf8_addr); - if (dst.first()->is_reg()) { - __ movq(Address(rbp, src_off), c_rarg1); - } else { - __ movq(Address(rsp, reg2offset_out(dst.first())), c_rarg1); - } - // And do the conversion - __ call(RuntimeAddress( - CAST_FROM_FN_PTR(address, SharedRuntime::get_utf))); - - __ bind(done); - } - if (in_sig_bt[j_arg] == T_OBJECT && out_sig_bt[c_arg] == T_LONG) { - assert(out_sig_bt[c_arg+1] == T_VOID, "must be"); - ++c_arg; // skip over T_VOID to keep the loop indices in sync - } - } - // The get_utf call killed all the c_arg registers - live[c_rarg0->as_VMReg()->value()] = false; - live[c_rarg1->as_VMReg()->value()] = false; - live[c_rarg2->as_VMReg()->value()] = false; - live[c_rarg3->as_VMReg()->value()] = false; - live[c_rarg4->as_VMReg()->value()] = false; - live[c_rarg5->as_VMReg()->value()] = false; - - live[c_farg0->as_VMReg()->value()] = false; - live[c_farg1->as_VMReg()->value()] = false; - live[c_farg2->as_VMReg()->value()] = false; - live[c_farg3->as_VMReg()->value()] = false; - live[c_farg4->as_VMReg()->value()] = false; - live[c_farg5->as_VMReg()->value()] = false; - live[c_farg6->as_VMReg()->value()] = false; - live[c_farg7->as_VMReg()->value()] = false; - } - - // Now we can finally move the register args to their desired locations - - rax_is_zero = false; - - for (j_arg = first_arg_to_pass, c_arg = 0 ; - j_arg < total_args_passed ; j_arg++, c_arg++ ) { - - VMRegPair src = in_regs[j_arg]; - VMRegPair dst = out_regs[c_arg]; - - // Only need to look for args destined for the interger registers (since we - // convert float/double args to look like int/long outbound) - if (dst.first()->is_reg()) { - Register r = dst.first()->as_Register(); - - // Check if the java arg is unsupported and thereofre useless - bool useless = in_sig_bt[j_arg] == T_ARRAY || - (in_sig_bt[j_arg] == T_OBJECT && - out_sig_bt[c_arg] != T_INT && - out_sig_bt[c_arg] != T_ADDRESS && - out_sig_bt[c_arg] != T_LONG); - - - // If we're going to kill an existing arg save it first - if (live[dst.first()->value()]) { - // you can't kill yourself - if (src.first() != dst.first()) { - __ movq(Address(rbp, fp_offset[dst.first()->value()]), r); - } - } - if (src.first()->is_reg()) { - if (live[src.first()->value()] ) { - if (in_sig_bt[j_arg] == T_FLOAT) { - __ movdl(r, src.first()->as_XMMRegister()); - } else if (in_sig_bt[j_arg] == T_DOUBLE) { - __ movdq(r, src.first()->as_XMMRegister()); - } else if (r != src.first()->as_Register()) { - if (!useless) { - __ movq(r, src.first()->as_Register()); - } - } - } else { - // If the arg is an oop type we don't support don't bother to store - // it - if (!useless) { - if (in_sig_bt[j_arg] == T_DOUBLE || - in_sig_bt[j_arg] == T_LONG || - in_sig_bt[j_arg] == T_OBJECT ) { - __ movq(r, Address(rbp, fp_offset[src.first()->value()])); - } else { - __ movl(r, Address(rbp, fp_offset[src.first()->value()])); - } - } - } - live[src.first()->value()] = false; - } else if (!useless) { - // full sized move even for int should be ok - __ movq(r, Address(rbp, reg2offset_in(src.first()))); - } - - // At this point r has the original java arg in the final location - // (assuming it wasn't useless). If the java arg was an oop - // we have a bit more to do - - if (in_sig_bt[j_arg] == T_ARRAY || in_sig_bt[j_arg] == T_OBJECT ) { - if (out_sig_bt[c_arg] == T_INT || out_sig_bt[c_arg] == T_LONG) { - // need to unbox a one-word value - Label skip; - __ testq(r, r); - __ jcc(Assembler::equal, skip); - BasicType bt = out_sig_bt[c_arg]; - int box_offset = java_lang_boxing_object::value_offset_in_bytes(bt); - Address src1(r, box_offset); - if ( bt == T_LONG ) { - __ movq(r, src1); - } else { - __ movl(r, src1); - } - __ bind(skip); - - } else if (out_sig_bt[c_arg] != T_ADDRESS) { - // Convert the arg to NULL - __ xorq(r, r); - } - } - - // dst can longer be holding an input value - live[dst.first()->value()] = false; - } - if (in_sig_bt[j_arg] == T_OBJECT && out_sig_bt[c_arg] == T_LONG) { - assert(out_sig_bt[c_arg+1] == T_VOID, "must be"); - ++c_arg; // skip over T_VOID to keep the loop indices in sync - } - } - - - // Ok now we are done. Need to place the nop that dtrace wants in order to - // patch in the trap - int patch_offset = ((intptr_t)__ pc()) - start; - - __ nop(); - - - // Return - - __ leave(); - __ ret(0); - - __ flush(); - - nmethod *nm = nmethod::new_dtrace_nmethod( - method, masm->code(), vep_offset, patch_offset, frame_complete, - stack_slots / VMRegImpl::slots_per_word); - return nm; - -} - -#endif // HAVE_DTRACE_H - // this function returns the adjust size (in number of words) to a c2i adapter // activation for use during deoptimization int Deoptimization::last_frame_adjust(int callee_parameters, int callee_locals ) { diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp index 93772f3df4c..69c8533d12e 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp @@ -346,7 +346,6 @@ void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile // depending if we're profiling or not. if (TieredCompilation) { int increment = InvocationCounter::count_increment; - int mask = ((1 << Tier0InvokeNotifyFreqLog) - 1) << InvocationCounter::count_shift; Label no_mdo; if (ProfileInterpreter) { // Are we profiling? @@ -356,6 +355,7 @@ void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile // Increment counter in the MDO const Address mdo_invocation_counter(rax, in_bytes(MethodData::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset())); + const Address mask(rax, in_bytes(MethodData::invoke_mask_offset())); __ increment_mask_and_jump(mdo_invocation_counter, increment, mask, rcx, false, Assembler::zero, overflow); __ jmp(done); } @@ -366,11 +366,12 @@ void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile InvocationCounter::counter_offset()); __ get_method_counters(rbx, rax, done); + const Address mask(rax, in_bytes(MethodCounters::invoke_mask_offset())); __ increment_mask_and_jump(invocation_counter, increment, mask, rcx, false, Assembler::zero, overflow); __ bind(done); - } else { - const Address backedge_counter (rax, + } else { // not TieredCompilation + const Address backedge_counter(rax, MethodCounters::backedge_counter_offset() + InvocationCounter::counter_offset()); const Address invocation_counter(rax, @@ -400,16 +401,16 @@ void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile if (ProfileInterpreter && profile_method != NULL) { // Test to see if we should create a method data oop - __ cmp32(rcx, - ExternalAddress((address)&InvocationCounter::InterpreterProfileLimit)); + __ movptr(rax, Address(rbx, Method::method_counters_offset())); + __ cmp32(rcx, Address(rax, in_bytes(MethodCounters::interpreter_profile_limit_offset()))); __ jcc(Assembler::less, *profile_method_continue); // if no method data exists, go to profile_method __ test_method_data_pointer(rax, *profile_method); } - __ cmp32(rcx, - ExternalAddress((address)&InvocationCounter::InterpreterInvocationLimit)); + __ movptr(rax, Address(rbx, Method::method_counters_offset())); + __ cmp32(rcx, Address(rax, in_bytes(MethodCounters::interpreter_invocation_limit_offset()))); __ jcc(Assembler::aboveEqual, *overflow); __ bind(done); } diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp index f3390c94ca9..6318a958517 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp @@ -299,7 +299,6 @@ void InterpreterGenerator::generate_counter_incr( // Note: In tiered we increment either counters in Method* or in MDO depending if we're profiling or not. if (TieredCompilation) { int increment = InvocationCounter::count_increment; - int mask = ((1 << Tier0InvokeNotifyFreqLog) - 1) << InvocationCounter::count_shift; Label no_mdo; if (ProfileInterpreter) { // Are we profiling? @@ -309,6 +308,7 @@ void InterpreterGenerator::generate_counter_incr( // Increment counter in the MDO const Address mdo_invocation_counter(rax, in_bytes(MethodData::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset())); + const Address mask(rax, in_bytes(MethodData::invoke_mask_offset())); __ increment_mask_and_jump(mdo_invocation_counter, increment, mask, rcx, false, Assembler::zero, overflow); __ jmp(done); } @@ -318,10 +318,11 @@ void InterpreterGenerator::generate_counter_incr( MethodCounters::invocation_counter_offset() + InvocationCounter::counter_offset()); __ get_method_counters(rbx, rax, done); + const Address mask(rax, in_bytes(MethodCounters::invoke_mask_offset())); __ increment_mask_and_jump(invocation_counter, increment, mask, rcx, false, Assembler::zero, overflow); __ bind(done); - } else { + } else { // not TieredCompilation const Address backedge_counter(rax, MethodCounters::backedge_counter_offset() + InvocationCounter::counter_offset()); @@ -350,14 +351,16 @@ void InterpreterGenerator::generate_counter_incr( if (ProfileInterpreter && profile_method != NULL) { // Test to see if we should create a method data oop - __ cmp32(rcx, ExternalAddress((address)&InvocationCounter::InterpreterProfileLimit)); + __ movptr(rax, Address(rbx, Method::method_counters_offset())); + __ cmp32(rcx, Address(rax, in_bytes(MethodCounters::interpreter_profile_limit_offset()))); __ jcc(Assembler::less, *profile_method_continue); // if no method data exists, go to profile_method __ test_method_data_pointer(rax, *profile_method); } - __ cmp32(rcx, ExternalAddress((address)&InvocationCounter::InterpreterInvocationLimit)); + __ movptr(rax, Address(rbx, Method::method_counters_offset())); + __ cmp32(rcx, Address(rax, in_bytes(MethodCounters::interpreter_invocation_limit_offset()))); __ jcc(Assembler::aboveEqual, *overflow); __ bind(done); } diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp index 2187056a384..1a8d8870c2a 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp @@ -185,7 +185,6 @@ static void do_oop_store(InterpreterMacroAssembler* _masm, } break; case BarrierSet::ModRef: - case BarrierSet::Other: if (val == noreg) { __ movptr(obj, NULL_WORD); } else { @@ -1621,7 +1620,6 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { if (TieredCompilation) { Label no_mdo; int increment = InvocationCounter::count_increment; - int mask = ((1 << Tier0BackedgeNotifyFreqLog) - 1) << InvocationCounter::count_shift; if (ProfileInterpreter) { // Are we profiling? __ movptr(rbx, Address(rcx, in_bytes(Method::method_data_offset()))); @@ -1630,6 +1628,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { // Increment the MDO backedge counter const Address mdo_backedge_counter(rbx, in_bytes(MethodData::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset())); + const Address mask(rbx, in_bytes(MethodData::backedge_mask_offset())); __ increment_mask_and_jump(mdo_backedge_counter, increment, mask, rax, false, Assembler::zero, &backedge_counter_overflow); __ jmp(dispatch); @@ -1637,9 +1636,10 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { __ bind(no_mdo); // Increment backedge counter in MethodCounters* __ movptr(rcx, Address(rcx, Method::method_counters_offset())); + const Address mask(rcx, in_bytes(MethodCounters::backedge_mask_offset())); __ increment_mask_and_jump(Address(rcx, be_offset), increment, mask, rax, false, Assembler::zero, &backedge_counter_overflow); - } else { + } else { // not TieredCompilation // increment counter __ movptr(rcx, Address(rcx, Method::method_counters_offset())); __ movl(rax, Address(rcx, be_offset)); // load backedge counter @@ -1653,8 +1653,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { if (ProfileInterpreter) { // Test to see if we should create a method data oop - __ cmp32(rax, - ExternalAddress((address) &InvocationCounter::InterpreterProfileLimit)); + __ cmp32(rax, Address(rcx, in_bytes(MethodCounters::interpreter_profile_limit_offset()))); __ jcc(Assembler::less, dispatch); // if no method data exists, go to profile method @@ -1662,8 +1661,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { if (UseOnStackReplacement) { // check for overflow against rbx, which is the MDO taken count - __ cmp32(rbx, - ExternalAddress((address) &InvocationCounter::InterpreterBackwardBranchLimit)); + __ cmp32(rbx, Address(rcx, in_bytes(MethodCounters::interpreter_backward_branch_limit_offset()))); __ jcc(Assembler::below, dispatch); // When ProfileInterpreter is on, the backedge_count comes from the @@ -1678,8 +1676,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { } else { if (UseOnStackReplacement) { // check for overflow against rax, which is the sum of the counters - __ cmp32(rax, - ExternalAddress((address) &InvocationCounter::InterpreterBackwardBranchLimit)); + __ cmp32(rax, Address(rcx, in_bytes(MethodCounters::interpreter_backward_branch_limit_offset()))); __ jcc(Assembler::aboveEqual, backedge_counter_overflow); } diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp index b1b1b00a615..acb4e146415 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp @@ -189,7 +189,6 @@ static void do_oop_store(InterpreterMacroAssembler* _masm, } break; case BarrierSet::ModRef: - case BarrierSet::Other: if (val == noreg) { __ store_heap_oop_null(obj); } else { @@ -1642,7 +1641,6 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { if (TieredCompilation) { Label no_mdo; int increment = InvocationCounter::count_increment; - int mask = ((1 << Tier0BackedgeNotifyFreqLog) - 1) << InvocationCounter::count_shift; if (ProfileInterpreter) { // Are we profiling? __ movptr(rbx, Address(rcx, in_bytes(Method::method_data_offset()))); @@ -1651,6 +1649,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { // Increment the MDO backedge counter const Address mdo_backedge_counter(rbx, in_bytes(MethodData::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset())); + const Address mask(rbx, in_bytes(MethodData::backedge_mask_offset())); __ increment_mask_and_jump(mdo_backedge_counter, increment, mask, rax, false, Assembler::zero, &backedge_counter_overflow); __ jmp(dispatch); @@ -1658,9 +1657,10 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { __ bind(no_mdo); // Increment backedge counter in MethodCounters* __ movptr(rcx, Address(rcx, Method::method_counters_offset())); + const Address mask(rcx, in_bytes(MethodCounters::backedge_mask_offset())); __ increment_mask_and_jump(Address(rcx, be_offset), increment, mask, rax, false, Assembler::zero, &backedge_counter_overflow); - } else { + } else { // not TieredCompilation // increment counter __ movptr(rcx, Address(rcx, Method::method_counters_offset())); __ movl(rax, Address(rcx, be_offset)); // load backedge counter @@ -1674,8 +1674,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { if (ProfileInterpreter) { // Test to see if we should create a method data oop - __ cmp32(rax, - ExternalAddress((address) &InvocationCounter::InterpreterProfileLimit)); + __ cmp32(rax, Address(rcx, in_bytes(MethodCounters::interpreter_profile_limit_offset()))); __ jcc(Assembler::less, dispatch); // if no method data exists, go to profile method @@ -1683,8 +1682,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { if (UseOnStackReplacement) { // check for overflow against ebx which is the MDO taken count - __ cmp32(rbx, - ExternalAddress((address) &InvocationCounter::InterpreterBackwardBranchLimit)); + __ cmp32(rbx, Address(rcx, in_bytes(MethodCounters::interpreter_backward_branch_limit_offset()))); __ jcc(Assembler::below, dispatch); // When ProfileInterpreter is on, the backedge_count comes @@ -1702,8 +1700,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { if (UseOnStackReplacement) { // check for overflow against eax, which is the sum of the // counters - __ cmp32(rax, - ExternalAddress((address) &InvocationCounter::InterpreterBackwardBranchLimit)); + __ cmp32(rax, Address(rcx, in_bytes(MethodCounters::interpreter_backward_branch_limit_offset()))); __ jcc(Assembler::aboveEqual, backedge_counter_overflow); } diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index 8d575c2d4bd..e702cf8dd02 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -924,15 +924,9 @@ void VM_Version::get_processor_features() { } #endif // COMPILER2 - assert(0 <= ReadPrefetchInstr && ReadPrefetchInstr <= 3, "invalid value"); assert(0 <= AllocatePrefetchInstr && AllocatePrefetchInstr <= 3, "invalid value"); // set valid Prefetch instruction - if( ReadPrefetchInstr < 0 ) ReadPrefetchInstr = 0; - if( ReadPrefetchInstr > 3 ) ReadPrefetchInstr = 3; - if( ReadPrefetchInstr == 3 && !supports_3dnow_prefetch() ) ReadPrefetchInstr = 0; - if( !supports_sse() && supports_3dnow_prefetch() ) ReadPrefetchInstr = 3; - if( AllocatePrefetchInstr < 0 ) AllocatePrefetchInstr = 0; if( AllocatePrefetchInstr > 3 ) AllocatePrefetchInstr = 3; if( AllocatePrefetchInstr == 3 && !supports_3dnow_prefetch() ) AllocatePrefetchInstr=0; diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad index 940541b6c30..e8b54389258 100644 --- a/hotspot/src/cpu/x86/vm/x86_32.ad +++ b/hotspot/src/cpu/x86/vm/x86_32.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 1997, 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 @@ -6061,102 +6061,8 @@ instruct loadSSD(regDPR dst, stackSlotD src) %{ ins_pipe( fpu_reg_mem ); %} -// Prefetch instructions. -// Must be safe to execute with invalid address (cannot fault). - -instruct prefetchr0( memory mem ) %{ - predicate(UseSSE==0 && !VM_Version::supports_3dnow_prefetch()); - match(PrefetchRead mem); - ins_cost(0); - size(0); - format %{ "PREFETCHR (non-SSE is empty encoding)" %} - ins_encode(); - ins_pipe(empty); -%} - -instruct prefetchr( memory mem ) %{ - predicate(UseSSE==0 && VM_Version::supports_3dnow_prefetch() || ReadPrefetchInstr==3); - match(PrefetchRead mem); - ins_cost(100); - - format %{ "PREFETCHR $mem\t! Prefetch into level 1 cache for read" %} - ins_encode %{ - __ prefetchr($mem$$Address); - %} - ins_pipe(ialu_mem); -%} - -instruct prefetchrNTA( memory mem ) %{ - predicate(UseSSE>=1 && ReadPrefetchInstr==0); - match(PrefetchRead mem); - ins_cost(100); - - format %{ "PREFETCHNTA $mem\t! Prefetch into non-temporal cache for read" %} - ins_encode %{ - __ prefetchnta($mem$$Address); - %} - ins_pipe(ialu_mem); -%} - -instruct prefetchrT0( memory mem ) %{ - predicate(UseSSE>=1 && ReadPrefetchInstr==1); - match(PrefetchRead mem); - ins_cost(100); - - format %{ "PREFETCHT0 $mem\t! Prefetch into L1 and L2 caches for read" %} - ins_encode %{ - __ prefetcht0($mem$$Address); - %} - ins_pipe(ialu_mem); -%} - -instruct prefetchrT2( memory mem ) %{ - predicate(UseSSE>=1 && ReadPrefetchInstr==2); - match(PrefetchRead mem); - ins_cost(100); - - format %{ "PREFETCHT2 $mem\t! Prefetch into L2 cache for read" %} - ins_encode %{ - __ prefetcht2($mem$$Address); - %} - ins_pipe(ialu_mem); -%} - -instruct prefetchw0( memory mem ) %{ - predicate(UseSSE==0 && !VM_Version::supports_3dnow_prefetch()); - match(PrefetchWrite mem); - ins_cost(0); - size(0); - format %{ "Prefetch (non-SSE is empty encoding)" %} - ins_encode(); - ins_pipe(empty); -%} - -instruct prefetchw( memory mem ) %{ - predicate(UseSSE==0 && VM_Version::supports_3dnow_prefetch()); - match( PrefetchWrite mem ); - ins_cost(100); - - format %{ "PREFETCHW $mem\t! Prefetch into L1 cache and mark modified" %} - ins_encode %{ - __ prefetchw($mem$$Address); - %} - ins_pipe(ialu_mem); -%} - -instruct prefetchwNTA( memory mem ) %{ - predicate(UseSSE>=1); - match(PrefetchWrite mem); - ins_cost(100); - - format %{ "PREFETCHNTA $mem\t! Prefetch into non-temporal cache for write" %} - ins_encode %{ - __ prefetchnta($mem$$Address); - %} - ins_pipe(ialu_mem); -%} - // Prefetch instructions for allocation. +// Must be safe to execute with invalid address (cannot fault). instruct prefetchAlloc0( memory mem ) %{ predicate(UseSSE==0 && AllocatePrefetchInstr!=3); diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad index 1233dbf775c..20569256102 100644 --- a/hotspot/src/cpu/x86/vm/x86_64.ad +++ b/hotspot/src/cpu/x86/vm/x86_64.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2003, 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 @@ -5319,69 +5319,8 @@ instruct loadSSD(regD dst, stackSlotD src) ins_pipe(pipe_slow); // XXX %} -// Prefetch instructions. -// Must be safe to execute with invalid address (cannot fault). - -instruct prefetchr( memory mem ) %{ - predicate(ReadPrefetchInstr==3); - match(PrefetchRead mem); - ins_cost(125); - - format %{ "PREFETCHR $mem\t# Prefetch into level 1 cache" %} - ins_encode %{ - __ prefetchr($mem$$Address); - %} - ins_pipe(ialu_mem); -%} - -instruct prefetchrNTA( memory mem ) %{ - predicate(ReadPrefetchInstr==0); - match(PrefetchRead mem); - ins_cost(125); - - format %{ "PREFETCHNTA $mem\t# Prefetch into non-temporal cache for read" %} - ins_encode %{ - __ prefetchnta($mem$$Address); - %} - ins_pipe(ialu_mem); -%} - -instruct prefetchrT0( memory mem ) %{ - predicate(ReadPrefetchInstr==1); - match(PrefetchRead mem); - ins_cost(125); - - format %{ "PREFETCHT0 $mem\t# prefetch into L1 and L2 caches for read" %} - ins_encode %{ - __ prefetcht0($mem$$Address); - %} - ins_pipe(ialu_mem); -%} - -instruct prefetchrT2( memory mem ) %{ - predicate(ReadPrefetchInstr==2); - match(PrefetchRead mem); - ins_cost(125); - - format %{ "PREFETCHT2 $mem\t# prefetch into L2 caches for read" %} - ins_encode %{ - __ prefetcht2($mem$$Address); - %} - ins_pipe(ialu_mem); -%} - -instruct prefetchwNTA( memory mem ) %{ - match(PrefetchWrite mem); - ins_cost(125); - - format %{ "PREFETCHNTA $mem\t# Prefetch to non-temporal cache for write" %} - ins_encode %{ - __ prefetchnta($mem$$Address); - %} - ins_pipe(ialu_mem); -%} - // Prefetch instructions for allocation. +// Must be safe to execute with invalid address (cannot fault). instruct prefetchAlloc( memory mem ) %{ predicate(AllocatePrefetchInstr==3); diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index e3322ca0364..d77a26ffa66 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -1115,6 +1115,15 @@ jlong os::javaTimeMillis() { return jlong(time.tv_sec) * 1000 + jlong(time.tv_usec / 1000); } +void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) { + timeval time; + int status = gettimeofday(&time, NULL); + assert(status != -1, "aix error at gettimeofday()"); + seconds = jlong(time.tv_sec); + nanos = jlong(time.tv_usec) * 1000; +} + + // We need to manually declare mread_real_time, // because IBM didn't provide a prototype in time.h. // (they probably only ever tested in C, not C++) diff --git a/hotspot/src/os/aix/vm/perfMemory_aix.cpp b/hotspot/src/os/aix/vm/perfMemory_aix.cpp index b509cf94110..c9dd76b7881 100644 --- a/hotspot/src/os/aix/vm/perfMemory_aix.cpp +++ b/hotspot/src/os/aix/vm/perfMemory_aix.cpp @@ -31,6 +31,7 @@ #include "os_aix.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/perfMemory.hpp" +#include "services/memTracker.hpp" #include "utilities/exceptions.hpp" // put OS-includes here @@ -196,12 +197,37 @@ static pid_t filename_to_pid(const char* filename) { return pid; } +// Check if the given statbuf is considered a secure directory for +// the backing store files. Returns true if the directory is considered +// a secure location. Returns false if the statbuf is a symbolic link or +// if an error occurred. +static bool is_statbuf_secure(struct stat *statp) { + if (S_ISLNK(statp->st_mode) || !S_ISDIR(statp->st_mode)) { + // The path represents a link or some non-directory file type, + // which is not what we expected. Declare it insecure. + // + return false; + } + // We have an existing directory, check if the permissions are safe. + if ((statp->st_mode & (S_IWGRP|S_IWOTH)) != 0) { + // The directory is open for writing and could be subjected + // to a symlink or a hard link attack. Declare it insecure. + return false; + } + // See if the uid of the directory matches the effective uid of the process. + // + if (statp->st_uid != geteuid()) { + // The directory was not created by this user, declare it insecure. + return false; + } + return true; +} -// check if the given path is considered a secure directory for + +// Check if the given path is considered a secure directory for // the backing store files. Returns true if the directory exists // and is considered a secure location. Returns false if the path // is a symbolic link or if an error occurred. -// static bool is_directory_secure(const char* path) { struct stat statbuf; int result = 0; @@ -211,38 +237,276 @@ static bool is_directory_secure(const char* path) { return false; } - // the path exists, now check it's mode - if (S_ISLNK(statbuf.st_mode) || !S_ISDIR(statbuf.st_mode)) { - // the path represents a link or some non-directory file type, - // which is not what we expected. declare it insecure. - // + // The path exists, see if it is secure. + return is_statbuf_secure(&statbuf); +} + +// (Taken over from Solaris to support the O_NOFOLLOW case on AIX.) +// Check if the given directory file descriptor is considered a secure +// directory for the backing store files. Returns true if the directory +// exists and is considered a secure location. Returns false if the path +// is a symbolic link or if an error occurred. +static bool is_dirfd_secure(int dir_fd) { + struct stat statbuf; + int result = 0; + + RESTARTABLE(::fstat(dir_fd, &statbuf), result); + if (result == OS_ERR) { return false; } - else { - // we have an existing directory, check if the permissions are safe. - // - if ((statbuf.st_mode & (S_IWGRP|S_IWOTH)) != 0) { - // the directory is open for writing and could be subjected - // to a symlnk attack. declare it insecure. - // - return false; + + // The path exists, now check its mode. + return is_statbuf_secure(&statbuf); +} + + +// Check to make sure fd1 and fd2 are referencing the same file system object. +static bool is_same_fsobject(int fd1, int fd2) { + struct stat statbuf1; + struct stat statbuf2; + int result = 0; + + RESTARTABLE(::fstat(fd1, &statbuf1), result); + if (result == OS_ERR) { + return false; + } + RESTARTABLE(::fstat(fd2, &statbuf2), result); + if (result == OS_ERR) { + return false; + } + + if ((statbuf1.st_ino == statbuf2.st_ino) && + (statbuf1.st_dev == statbuf2.st_dev)) { + return true; + } else { + return false; + } +} + +// Helper functions for open without O_NOFOLLOW which is not present on AIX 5.3/6.1. +// We use the jdk6 implementation here. +#ifndef O_NOFOLLOW +// The O_NOFOLLOW oflag doesn't exist before solaris 5.10, this is to simulate that behaviour +// was done in jdk 5/6 hotspot by Oracle this way +static int open_o_nofollow_impl(const char* path, int oflag, mode_t mode, bool use_mode) { + struct stat orig_st; + struct stat new_st; + bool create; + int error; + int fd; + + create = false; + + if (lstat(path, &orig_st) != 0) { + if (errno == ENOENT && (oflag & O_CREAT) != 0) { + // File doesn't exist, but_we want to create it, add O_EXCL flag + // to make sure no-one creates it (or a symlink) before us + // This works as we expect with symlinks, from posix man page: + // 'If O_EXCL and O_CREAT are set, and path names a symbolic + // link, open() shall fail and set errno to [EEXIST]'. + oflag |= O_EXCL; + create = true; + } else { + // File doesn't exist, and we are not creating it. + return OS_ERR; } + } else { + // Lstat success, check if existing file is a link. + if ((orig_st.st_mode & S_IFMT) == S_IFLNK) { + // File is a symlink. + errno = ELOOP; + return OS_ERR; + } + } + + if (use_mode == true) { + fd = open(path, oflag, mode); + } else { + fd = open(path, oflag); + } + + if (fd == OS_ERR) { + return fd; + } + + // Can't do inode checks on before/after if we created the file. + if (create == false) { + if (fstat(fd, &new_st) != 0) { + // Keep errno from fstat, in case close also fails. + error = errno; + ::close(fd); + errno = error; + return OS_ERR; + } + + if (orig_st.st_dev != new_st.st_dev || orig_st.st_ino != new_st.st_ino) { + // File was tampered with during race window. + ::close(fd); + errno = EEXIST; + if (PrintMiscellaneous && Verbose) { + warning("possible file tampering attempt detected when opening %s", path); + } + return OS_ERR; + } + } + + return fd; +} + +static int open_o_nofollow(const char* path, int oflag, mode_t mode) { + return open_o_nofollow_impl(path, oflag, mode, true); +} + +static int open_o_nofollow(const char* path, int oflag) { + return open_o_nofollow_impl(path, oflag, 0, false); +} +#endif + +// Open the directory of the given path and validate it. +// Return a DIR * of the open directory. +static DIR *open_directory_secure(const char* dirname) { + // Open the directory using open() so that it can be verified + // to be secure by calling is_dirfd_secure(), opendir() and then check + // to see if they are the same file system object. This method does not + // introduce a window of opportunity for the directory to be attacked that + // calling opendir() and is_directory_secure() does. + int result; + DIR *dirp = NULL; + + // No O_NOFOLLOW defined at buildtime, and it is not documented for open; + // so provide a workaround in this case. +#ifdef O_NOFOLLOW + RESTARTABLE(::open(dirname, O_RDONLY|O_NOFOLLOW), result); +#else + // workaround (jdk6 coding) + RESTARTABLE(::open_o_nofollow(dirname, O_RDONLY), result); +#endif + + if (result == OS_ERR) { + // Directory doesn't exist or is a symlink, so there is nothing to cleanup. + if (PrintMiscellaneous && Verbose) { + if (errno == ELOOP) { + warning("directory %s is a symlink and is not secure\n", dirname); + } else { + warning("could not open directory %s: %s\n", dirname, strerror(errno)); + } + } + return dirp; + } + int fd = result; + + // Determine if the open directory is secure. + if (!is_dirfd_secure(fd)) { + // The directory is not a secure directory. + os::close(fd); + return dirp; + } + + // Open the directory. + dirp = ::opendir(dirname); + if (dirp == NULL) { + // The directory doesn't exist, close fd and return. + os::close(fd); + return dirp; + } + + // Check to make sure fd and dirp are referencing the same file system object. + if (!is_same_fsobject(fd, dirp->dd_fd)) { + // The directory is not secure. + os::close(fd); + os::closedir(dirp); + dirp = NULL; + return dirp; + } + + // Close initial open now that we know directory is secure + os::close(fd); + + return dirp; +} + +// NOTE: The code below uses fchdir(), open() and unlink() because +// fdopendir(), openat() and unlinkat() are not supported on all +// versions. Once the support for fdopendir(), openat() and unlinkat() +// is available on all supported versions the code can be changed +// to use these functions. + +// Open the directory of the given path, validate it and set the +// current working directory to it. +// Return a DIR * of the open directory and the saved cwd fd. +// +static DIR *open_directory_secure_cwd(const char* dirname, int *saved_cwd_fd) { + + // Open the directory. + DIR* dirp = open_directory_secure(dirname); + if (dirp == NULL) { + // Directory doesn't exist or is insecure, so there is nothing to cleanup. + return dirp; + } + int fd = dirp->dd_fd; + + // Open a fd to the cwd and save it off. + int result; + RESTARTABLE(::open(".", O_RDONLY), result); + if (result == OS_ERR) { + *saved_cwd_fd = -1; + } else { + *saved_cwd_fd = result; + } + + // Set the current directory to dirname by using the fd of the directory. + result = fchdir(fd); + + return dirp; +} + +// Close the directory and restore the current working directory. +static void close_directory_secure_cwd(DIR* dirp, int saved_cwd_fd) { + + int result; + // If we have a saved cwd change back to it and close the fd. + if (saved_cwd_fd != -1) { + result = fchdir(saved_cwd_fd); + ::close(saved_cwd_fd); + } + + // Close the directory. + os::closedir(dirp); +} + +// Check if the given file descriptor is considered a secure. +static bool is_file_secure(int fd, const char *filename) { + + int result; + struct stat statbuf; + + // Determine if the file is secure. + RESTARTABLE(::fstat(fd, &statbuf), result); + if (result == OS_ERR) { + if (PrintMiscellaneous && Verbose) { + warning("fstat failed on %s: %s\n", filename, strerror(errno)); + } + return false; + } + if (statbuf.st_nlink > 1) { + // A file with multiple links is not expected. + if (PrintMiscellaneous && Verbose) { + warning("file %s has multiple links\n", filename); + } + return false; } return true; } - -// return the user name for the given user id -// -// the caller is expected to free the allocated memory. +// Return the user name for the given user id. // +// The caller is expected to free the allocated memory. static char* get_user_name(uid_t uid) { struct passwd pwent; - // determine the max pwbuf size from sysconf, and hardcode + // Determine the max pwbuf size from sysconf, and hardcode // a default if this not available through sysconf. - // long bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); if (bufsize == -1) bufsize = 1024; @@ -344,7 +608,8 @@ static char* get_user_name_slow(int vmid, TRAPS) { strcat(usrdir_name, "/"); strcat(usrdir_name, dentry->d_name); - DIR* subdirp = os::opendir(usrdir_name); + // Open the user directory. + DIR* subdirp = open_directory_secure(usrdir_name); if (subdirp == NULL) { FREE_C_HEAP_ARRAY(char, usrdir_name); @@ -464,28 +729,7 @@ static void remove_file(const char* path) { } } - -// remove file -// -// this method removes the file with the given file name in the -// named directory. -// -static void remove_file(const char* dirname, const char* filename) { - - size_t nbytes = strlen(dirname) + strlen(filename) + 2; - char* path = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal); - - strcpy(path, dirname); - strcat(path, "/"); - strcat(path, filename); - - remove_file(path); - - FREE_C_HEAP_ARRAY(char, path); -} - - -// cleanup stale shared memory resources +// Cleanup stale shared memory resources // // This method attempts to remove all stale shared memory files in // the named user temporary directory. It scans the named directory @@ -493,33 +737,26 @@ static void remove_file(const char* dirname, const char* filename) { // process id is extracted from the file name and a test is run to // determine if the process is alive. If the process is not alive, // any stale file resources are removed. -// static void cleanup_sharedmem_resources(const char* dirname) { - // open the user temp directory - DIR* dirp = os::opendir(dirname); - + int saved_cwd_fd; + // Open the directory. + DIR* dirp = open_directory_secure_cwd(dirname, &saved_cwd_fd); if (dirp == NULL) { - // directory doesn't exist, so there is nothing to cleanup + // Directory doesn't exist or is insecure, so there is nothing to cleanup. return; } - if (!is_directory_secure(dirname)) { - // the directory is not a secure directory - os::closedir(dirp); - return; - } - - // for each entry in the directory that matches the expected file + // For each entry in the directory that matches the expected file // name pattern, determine if the file resources are stale and if // so, remove the file resources. Note, instrumented HotSpot processes // for this user may start and/or terminate during this search and // remove or create new files in this directory. The behavior of this // loop under these conditions is dependent upon the implementation of // opendir/readdir. - // struct dirent* entry; char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal); + errno = 0; while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) { @@ -529,56 +766,55 @@ static void cleanup_sharedmem_resources(const char* dirname) { if (strcmp(entry->d_name, ".") != 0 && strcmp(entry->d_name, "..") != 0) { - // attempt to remove all unexpected files, except "." and ".." - remove_file(dirname, entry->d_name); + // Attempt to remove all unexpected files, except "." and "..". + unlink(entry->d_name); } errno = 0; continue; } - // we now have a file name that converts to a valid integer + // We now have a file name that converts to a valid integer // that could represent a process id . if this process id // matches the current process id or the process is not running, // then remove the stale file resources. // - // process liveness is detected by sending signal number 0 to + // Process liveness is detected by sending signal number 0 to // the process id (see kill(2)). if kill determines that the // process does not exist, then the file resources are removed. // if kill determines that that we don't have permission to // signal the process, then the file resources are assumed to // be stale and are removed because the resources for such a // process should be in a different user specific directory. - // if ((pid == os::current_process_id()) || (kill(pid, 0) == OS_ERR && (errno == ESRCH || errno == EPERM))) { - remove_file(dirname, entry->d_name); + unlink(entry->d_name); } errno = 0; } - os::closedir(dirp); - FREE_C_HEAP_ARRAY(char, dbuf); + + // Close the directory and reset the current working directory. + close_directory_secure_cwd(dirp, saved_cwd_fd); + + FREE_C_HEAP_ARRAY(char, dbuf, mtInternal); } -// make the user specific temporary directory. Returns true if +// Make the user specific temporary directory. Returns true if // the directory exists and is secure upon return. Returns false // if the directory exists but is either a symlink, is otherwise // insecure, or if an error occurred. -// static bool make_user_tmp_dir(const char* dirname) { - // create the directory with 0755 permissions. note that the directory + // Create the directory with 0755 permissions. note that the directory // will be owned by euid::egid, which may not be the same as uid::gid. - // if (mkdir(dirname, S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) == OS_ERR) { if (errno == EEXIST) { // The directory already exists and was probably created by another // JVM instance. However, this could also be the result of a // deliberate symlink. Verify that the existing directory is safe. - // if (!is_directory_secure(dirname)) { - // directory is not secure + // Directory is not secure. if (PrintMiscellaneous && Verbose) { warning("%s directory is insecure\n", dirname); } @@ -614,19 +850,63 @@ static int create_sharedmem_resources(const char* dirname, const char* filename, return -1; } - int result; - - RESTARTABLE(::open(filename, O_RDWR|O_CREAT|O_TRUNC, S_IREAD|S_IWRITE), result); - if (result == OS_ERR) { - if (PrintMiscellaneous && Verbose) { - warning("could not create file %s: %s\n", filename, strerror(errno)); - } + int saved_cwd_fd; + // Open the directory and set the current working directory to it. + DIR* dirp = open_directory_secure_cwd(dirname, &saved_cwd_fd); + if (dirp == NULL) { + // Directory doesn't exist or is insecure, so cannot create shared + // memory file. return -1; } + // Open the filename in the current directory. + // Cannot use O_TRUNC here; truncation of an existing file has to happen + // after the is_file_secure() check below. + int result; + + // No O_NOFOLLOW defined at buildtime, and it is not documented for open; + // so provide a workaround in this case. +#ifdef O_NOFOLLOW + RESTARTABLE(::open(filename, O_RDWR|O_CREAT|O_NOFOLLOW, S_IREAD|S_IWRITE), result); +#else + // workaround function (jdk6 code) + RESTARTABLE(::open_o_nofollow(filename, O_RDWR|O_CREAT, S_IREAD|S_IWRITE), result); +#endif + + if (result == OS_ERR) { + if (PrintMiscellaneous && Verbose) { + if (errno == ELOOP) { + warning("file %s is a symlink and is not secure\n", filename); + } else { + warning("could not create file %s: %s\n", filename, strerror(errno)); + } + } + // Close the directory and reset the current working directory. + close_directory_secure_cwd(dirp, saved_cwd_fd); + + return -1; + } + // Close the directory and reset the current working directory. + close_directory_secure_cwd(dirp, saved_cwd_fd); + // save the file descriptor int fd = result; + // Check to see if the file is secure. + if (!is_file_secure(fd, filename)) { + ::close(fd); + return -1; + } + + // Truncate the file to get rid of any existing data. + RESTARTABLE(::ftruncate(fd, (off_t)0), result); + if (result == OS_ERR) { + if (PrintMiscellaneous && Verbose) { + warning("could not truncate shared memory file: %s\n", strerror(errno)); + } + ::close(fd); + return -1; + } // set the file size RESTARTABLE(::ftruncate(fd, (off_t)size), result); if (result == OS_ERR) { @@ -648,7 +928,14 @@ static int open_sharedmem_file(const char* filename, int oflags, TRAPS) { // open the file int result; + // No O_NOFOLLOW defined at buildtime, and it is not documented for open; + // so provide a workaround in this case +#ifdef O_NOFOLLOW RESTARTABLE(::open(filename, oflags), result); +#else + RESTARTABLE(::open_o_nofollow(filename, oflags), result); +#endif + if (result == OS_ERR) { if (errno == ENOENT) { THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), @@ -662,8 +949,15 @@ static int open_sharedmem_file(const char* filename, int oflags, TRAPS) { THROW_MSG_0(vmSymbols::java_io_IOException(), strerror(errno)); } } + int fd = result; - return result; + // Check to see if the file is secure. + if (!is_file_secure(fd, filename)) { + ::close(fd); + return -1; + } + + return fd; } // create a named shared memory region. returns the address of the @@ -695,13 +989,21 @@ static char* mmap_create_shared(size_t size) { char* dirname = get_user_tmp_dir(user_name); char* filename = get_sharedmem_filename(dirname, vmid); + // Get the short filename. + char* short_filename = strrchr(filename, '/'); + if (short_filename == NULL) { + short_filename = filename; + } else { + short_filename++; + } + // cleanup any stale shared memory files cleanup_sharedmem_resources(dirname); assert(((size > 0) && (size % os::vm_page_size() == 0)), "unexpected PerfMemory region size"); - fd = create_sharedmem_resources(dirname, filename, size); + fd = create_sharedmem_resources(dirname, short_filename, size); FREE_C_HEAP_ARRAY(char, user_name); FREE_C_HEAP_ARRAY(char, dirname); @@ -733,6 +1035,9 @@ static char* mmap_create_shared(size_t size) { // clear the shared memory region (void)::memset((void*) mapAddress, 0, size); + // It does not go through os api, the operation has to record from here. + MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC, mtInternal); + return mapAddress; } @@ -807,7 +1112,7 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor char* mapAddress; int result; int fd; - size_t size; + size_t size = 0; const char* luser = NULL; int mmap_prot; @@ -819,12 +1124,18 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor // constructs for the file and the shared memory mapping. if (mode == PerfMemory::PERF_MODE_RO) { mmap_prot = PROT_READ; + + // No O_NOFOLLOW defined at buildtime, and it is not documented for open. +#ifdef O_NOFOLLOW + file_flags = O_RDONLY | O_NOFOLLOW; +#else file_flags = O_RDONLY; +#endif } else if (mode == PerfMemory::PERF_MODE_RW) { #ifdef LATER mmap_prot = PROT_READ | PROT_WRITE; - file_flags = O_RDWR; + file_flags = O_RDWR | O_NOFOLLOW; #else THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "Unsupported access mode"); @@ -853,9 +1164,9 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor // store file, we don't follow them when attaching either. // if (!is_directory_secure(dirname)) { - FREE_C_HEAP_ARRAY(char, dirname); + FREE_C_HEAP_ARRAY(char, dirname, mtInternal); if (luser != user) { - FREE_C_HEAP_ARRAY(char, luser); + FREE_C_HEAP_ARRAY(char, luser, mtInternal); } THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "Process not found"); @@ -901,6 +1212,9 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor "Could not map PerfMemory"); } + // It does not go through os api, the operation has to record from here. + MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC, mtInternal); + *addr = mapAddress; *sizep = size; diff --git a/hotspot/src/os/aix/vm/vmError_aix.cpp b/hotspot/src/os/aix/vm/vmError_aix.cpp index d99436ebc1c..34709134a56 100644 --- a/hotspot/src/os/aix/vm/vmError_aix.cpp +++ b/hotspot/src/os/aix/vm/vmError_aix.cpp @@ -80,7 +80,6 @@ static void save_signal(int idx, int sig) { } int VMError::get_resetted_sigflags(int sig) { - // Handle all program errors. for (int i = 0; i < NUM_SIGNALS; i++) { if (SIGNALS[i] == sig) { return resettedSigflags[i]; @@ -90,7 +89,6 @@ int VMError::get_resetted_sigflags(int sig) { } address VMError::get_resetted_sighandler(int sig) { - // Handle all program errors. for (int i = 0; i < NUM_SIGNALS; i++) { if (SIGNALS[i] == sig) { return resettedSighandler[i]; @@ -100,12 +98,19 @@ address VMError::get_resetted_sighandler(int sig) { } static void crash_handler(int sig, siginfo_t* info, void* ucVoid) { + // Unmask current signal. sigset_t newset; sigemptyset(&newset); sigaddset(&newset, sig); + // and all other synchronous signals too. + for (int i = 0; i < NUM_SIGNALS; i++) { + sigaddset(&newset, SIGNALS[i]); + } + sigthreadmask(SIG_UNBLOCK, &newset, NULL); - Unimplemented(); + VMError err(NULL, sig, NULL, info, ucVoid); + err.report_and_die(); } void VMError::reset_signal_handlers() { diff --git a/hotspot/src/os/bsd/vm/dtraceJSDT_bsd.cpp b/hotspot/src/os/bsd/vm/dtraceJSDT_bsd.cpp deleted file mode 100644 index d6c091b126b..00000000000 --- a/hotspot/src/os/bsd/vm/dtraceJSDT_bsd.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 1997, 2010, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "classfile/javaClasses.hpp" -#include "code/codeBlob.hpp" -#include "memory/allocation.hpp" -#include "prims/jvm.h" -#include "runtime/dtraceJSDT.hpp" -#include "runtime/jniHandles.hpp" -#include "runtime/os.hpp" -#include "runtime/signature.hpp" -#include "utilities/globalDefinitions.hpp" - -/* - * JSDT java dtrace probes have never been implemented in macosx. It is unknown if the solaris implementation - * is close or if significant implementation work is necessary. The future of the solaris implementation also - * appears to be unclear since compiling code with JSDT probes produces the following warning: - * "warning: ProviderFactory is internal proprietary API and may be removed in a future release" - */ - -int DTraceJSDT::pd_activate( - void* baseAddress, jstring module, - jint providers_count, JVM_DTraceProvider* providers) { - return -1; -} - -void DTraceJSDT::pd_dispose(int handle) { -} - -jboolean DTraceJSDT::pd_is_supported() { - return false; -} diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index cddb9449712..445ff225f8e 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -984,6 +984,14 @@ jlong os::javaTimeMillis() { return jlong(time.tv_sec) * 1000 + jlong(time.tv_usec / 1000); } +void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) { + timeval time; + int status = gettimeofday(&time, NULL); + assert(status != -1, "bsd error"); + seconds = jlong(time.tv_sec); + nanos = jlong(time.tv_usec) * 1000; +} + #ifndef __APPLE__ #ifndef CLOCK_MONOTONIC #define CLOCK_MONOTONIC (1) diff --git a/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp b/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp index 513494cf6bf..7f7468a5de3 100644 --- a/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp +++ b/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp @@ -197,7 +197,38 @@ static pid_t filename_to_pid(const char* filename) { } -// check if the given path is considered a secure directory for +// Check if the given statbuf is considered a secure directory for +// the backing store files. Returns true if the directory is considered +// a secure location. Returns false if the statbuf is a symbolic link or +// if an error occurred. +// +static bool is_statbuf_secure(struct stat *statp) { + if (S_ISLNK(statp->st_mode) || !S_ISDIR(statp->st_mode)) { + // The path represents a link or some non-directory file type, + // which is not what we expected. Declare it insecure. + // + return false; + } + // We have an existing directory, check if the permissions are safe. + // + if ((statp->st_mode & (S_IWGRP|S_IWOTH)) != 0) { + // The directory is open for writing and could be subjected + // to a symlink or a hard link attack. Declare it insecure. + // + return false; + } + // See if the uid of the directory matches the effective uid of the process. + // + if (statp->st_uid != geteuid()) { + // The directory was not created by this user, declare it insecure. + // + return false; + } + return true; +} + + +// Check if the given path is considered a secure directory for // the backing store files. Returns true if the directory exists // and is considered a secure location. Returns false if the path // is a symbolic link or if an error occurred. @@ -211,27 +242,185 @@ static bool is_directory_secure(const char* path) { return false; } - // the path exists, now check it's mode - if (S_ISLNK(statbuf.st_mode) || !S_ISDIR(statbuf.st_mode)) { - // the path represents a link or some non-directory file type, - // which is not what we expected. declare it insecure. - // + // The path exists, see if it is secure. + return is_statbuf_secure(&statbuf); +} + + +// Check if the given directory file descriptor is considered a secure +// directory for the backing store files. Returns true if the directory +// exists and is considered a secure location. Returns false if the path +// is a symbolic link or if an error occurred. +// +static bool is_dirfd_secure(int dir_fd) { + struct stat statbuf; + int result = 0; + + RESTARTABLE(::fstat(dir_fd, &statbuf), result); + if (result == OS_ERR) { return false; } - else { - // we have an existing directory, check if the permissions are safe. - // - if ((statbuf.st_mode & (S_IWGRP|S_IWOTH)) != 0) { - // the directory is open for writing and could be subjected - // to a symlnk attack. declare it insecure. - // - return false; + + // The path exists, now check its mode. + return is_statbuf_secure(&statbuf); +} + + +// Check to make sure fd1 and fd2 are referencing the same file system object. +// +static bool is_same_fsobject(int fd1, int fd2) { + struct stat statbuf1; + struct stat statbuf2; + int result = 0; + + RESTARTABLE(::fstat(fd1, &statbuf1), result); + if (result == OS_ERR) { + return false; + } + RESTARTABLE(::fstat(fd2, &statbuf2), result); + if (result == OS_ERR) { + return false; + } + + if ((statbuf1.st_ino == statbuf2.st_ino) && + (statbuf1.st_dev == statbuf2.st_dev)) { + return true; + } else { + return false; + } +} + + +// Open the directory of the given path and validate it. +// Return a DIR * of the open directory. +// +static DIR *open_directory_secure(const char* dirname) { + // Open the directory using open() so that it can be verified + // to be secure by calling is_dirfd_secure(), opendir() and then check + // to see if they are the same file system object. This method does not + // introduce a window of opportunity for the directory to be attacked that + // calling opendir() and is_directory_secure() does. + int result; + DIR *dirp = NULL; + RESTARTABLE(::open(dirname, O_RDONLY|O_NOFOLLOW), result); + if (result == OS_ERR) { + // Directory doesn't exist or is a symlink, so there is nothing to cleanup. + if (PrintMiscellaneous && Verbose) { + if (errno == ELOOP) { + warning("directory %s is a symlink and is not secure\n", dirname); + } else { + warning("could not open directory %s: %s\n", dirname, strerror(errno)); + } } + return dirp; + } + int fd = result; + + // Determine if the open directory is secure. + if (!is_dirfd_secure(fd)) { + // The directory is not a secure directory. + os::close(fd); + return dirp; + } + + // Open the directory. + dirp = ::opendir(dirname); + if (dirp == NULL) { + // The directory doesn't exist, close fd and return. + os::close(fd); + return dirp; + } + + // Check to make sure fd and dirp are referencing the same file system object. + if (!is_same_fsobject(fd, dirfd(dirp))) { + // The directory is not secure. + os::close(fd); + os::closedir(dirp); + dirp = NULL; + return dirp; + } + + // Close initial open now that we know directory is secure + os::close(fd); + + return dirp; +} + +// NOTE: The code below uses fchdir(), open() and unlink() because +// fdopendir(), openat() and unlinkat() are not supported on all +// versions. Once the support for fdopendir(), openat() and unlinkat() +// is available on all supported versions the code can be changed +// to use these functions. + +// Open the directory of the given path, validate it and set the +// current working directory to it. +// Return a DIR * of the open directory and the saved cwd fd. +// +static DIR *open_directory_secure_cwd(const char* dirname, int *saved_cwd_fd) { + + // Open the directory. + DIR* dirp = open_directory_secure(dirname); + if (dirp == NULL) { + // Directory doesn't exist or is insecure, so there is nothing to cleanup. + return dirp; + } + int fd = dirfd(dirp); + + // Open a fd to the cwd and save it off. + int result; + RESTARTABLE(::open(".", O_RDONLY), result); + if (result == OS_ERR) { + *saved_cwd_fd = -1; + } else { + *saved_cwd_fd = result; + } + + // Set the current directory to dirname by using the fd of the directory. + result = fchdir(fd); + + return dirp; +} + +// Close the directory and restore the current working directory. +// +static void close_directory_secure_cwd(DIR* dirp, int saved_cwd_fd) { + + int result; + // If we have a saved cwd change back to it and close the fd. + if (saved_cwd_fd != -1) { + result = fchdir(saved_cwd_fd); + ::close(saved_cwd_fd); + } + + // Close the directory. + os::closedir(dirp); +} + +// Check if the given file descriptor is considered a secure. +// +static bool is_file_secure(int fd, const char *filename) { + + int result; + struct stat statbuf; + + // Determine if the file is secure. + RESTARTABLE(::fstat(fd, &statbuf), result); + if (result == OS_ERR) { + if (PrintMiscellaneous && Verbose) { + warning("fstat failed on %s: %s\n", filename, strerror(errno)); + } + return false; + } + if (statbuf.st_nlink > 1) { + // A file with multiple links is not expected. + if (PrintMiscellaneous && Verbose) { + warning("file %s has multiple links\n", filename); + } + return false; } return true; } - // return the user name for the given user id // // the caller is expected to free the allocated memory. @@ -317,9 +506,11 @@ static char* get_user_name_slow(int vmid, TRAPS) { const char* tmpdirname = os::get_temp_directory(); + // open the temp directory DIR* tmpdirp = os::opendir(tmpdirname); if (tmpdirp == NULL) { + // Cannot open the directory to get the user name, return. return NULL; } @@ -344,25 +535,14 @@ static char* get_user_name_slow(int vmid, TRAPS) { strcat(usrdir_name, "/"); strcat(usrdir_name, dentry->d_name); - DIR* subdirp = os::opendir(usrdir_name); + // open the user directory + DIR* subdirp = open_directory_secure(usrdir_name); if (subdirp == NULL) { FREE_C_HEAP_ARRAY(char, usrdir_name); continue; } - // Since we don't create the backing store files in directories - // pointed to by symbolic links, we also don't follow them when - // looking for the files. We check for a symbolic link after the - // call to opendir in order to eliminate a small window where the - // symlink can be exploited. - // - if (!is_directory_secure(usrdir_name)) { - FREE_C_HEAP_ARRAY(char, usrdir_name); - os::closedir(subdirp); - continue; - } - struct dirent* udentry; char* udbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(usrdir_name), mtInternal); errno = 0; @@ -465,26 +645,6 @@ static void remove_file(const char* path) { } -// remove file -// -// this method removes the file with the given file name in the -// named directory. -// -static void remove_file(const char* dirname, const char* filename) { - - size_t nbytes = strlen(dirname) + strlen(filename) + 2; - char* path = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal); - - strcpy(path, dirname); - strcat(path, "/"); - strcat(path, filename); - - remove_file(path); - - FREE_C_HEAP_ARRAY(char, path); -} - - // cleanup stale shared memory resources // // This method attempts to remove all stale shared memory files in @@ -496,17 +656,11 @@ static void remove_file(const char* dirname, const char* filename) { // static void cleanup_sharedmem_resources(const char* dirname) { - // open the user temp directory - DIR* dirp = os::opendir(dirname); - + int saved_cwd_fd; + // open the directory and set the current working directory to it + DIR* dirp = open_directory_secure_cwd(dirname, &saved_cwd_fd); if (dirp == NULL) { - // directory doesn't exist, so there is nothing to cleanup - return; - } - - if (!is_directory_secure(dirname)) { - // the directory is not a secure directory - os::closedir(dirp); + // directory doesn't exist or is insecure, so there is nothing to cleanup return; } @@ -520,6 +674,7 @@ static void cleanup_sharedmem_resources(const char* dirname) { // struct dirent* entry; char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal); + errno = 0; while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) { @@ -530,7 +685,7 @@ static void cleanup_sharedmem_resources(const char* dirname) { if (strcmp(entry->d_name, ".") != 0 && strcmp(entry->d_name, "..") != 0) { // attempt to remove all unexpected files, except "." and ".." - remove_file(dirname, entry->d_name); + unlink(entry->d_name); } errno = 0; @@ -553,11 +708,14 @@ static void cleanup_sharedmem_resources(const char* dirname) { if ((pid == os::current_process_id()) || (kill(pid, 0) == OS_ERR && (errno == ESRCH || errno == EPERM))) { - remove_file(dirname, entry->d_name); + unlink(entry->d_name); } errno = 0; } - os::closedir(dirp); + + // close the directory and reset the current working directory + close_directory_secure_cwd(dirp, saved_cwd_fd); + FREE_C_HEAP_ARRAY(char, dbuf); } @@ -614,19 +772,54 @@ static int create_sharedmem_resources(const char* dirname, const char* filename, return -1; } - int result; - - RESTARTABLE(::open(filename, O_RDWR|O_CREAT|O_TRUNC, S_IREAD|S_IWRITE), result); - if (result == OS_ERR) { - if (PrintMiscellaneous && Verbose) { - warning("could not create file %s: %s\n", filename, strerror(errno)); - } + int saved_cwd_fd; + // open the directory and set the current working directory to it + DIR* dirp = open_directory_secure_cwd(dirname, &saved_cwd_fd); + if (dirp == NULL) { + // Directory doesn't exist or is insecure, so cannot create shared + // memory file. return -1; } + // Open the filename in the current directory. + // Cannot use O_TRUNC here; truncation of an existing file has to happen + // after the is_file_secure() check below. + int result; + RESTARTABLE(::open(filename, O_RDWR|O_CREAT|O_NOFOLLOW, S_IREAD|S_IWRITE), result); + if (result == OS_ERR) { + if (PrintMiscellaneous && Verbose) { + if (errno == ELOOP) { + warning("file %s is a symlink and is not secure\n", filename); + } else { + warning("could not create file %s: %s\n", filename, strerror(errno)); + } + } + // close the directory and reset the current working directory + close_directory_secure_cwd(dirp, saved_cwd_fd); + + return -1; + } + // close the directory and reset the current working directory + close_directory_secure_cwd(dirp, saved_cwd_fd); + // save the file descriptor int fd = result; + // check to see if the file is secure + if (!is_file_secure(fd, filename)) { + ::close(fd); + return -1; + } + + // truncate the file to get rid of any existing data + RESTARTABLE(::ftruncate(fd, (off_t)0), result); + if (result == OS_ERR) { + if (PrintMiscellaneous && Verbose) { + warning("could not truncate shared memory file: %s\n", strerror(errno)); + } + ::close(fd); + return -1; + } // set the file size RESTARTABLE(::ftruncate(fd, (off_t)size), result); if (result == OS_ERR) { @@ -684,8 +877,15 @@ static int open_sharedmem_file(const char* filename, int oflags, TRAPS) { THROW_MSG_(vmSymbols::java_io_IOException(), strerror(errno), OS_ERR); } } + int fd = result; - return result; + // check to see if the file is secure + if (!is_file_secure(fd, filename)) { + ::close(fd); + return -1; + } + + return fd; } // create a named shared memory region. returns the address of the @@ -717,13 +917,21 @@ static char* mmap_create_shared(size_t size) { char* dirname = get_user_tmp_dir(user_name); char* filename = get_sharedmem_filename(dirname, vmid); + // get the short filename + char* short_filename = strrchr(filename, '/'); + if (short_filename == NULL) { + short_filename = filename; + } else { + short_filename++; + } + // cleanup any stale shared memory files cleanup_sharedmem_resources(dirname); assert(((size > 0) && (size % os::vm_page_size() == 0)), "unexpected PerfMemory region size"); - fd = create_sharedmem_resources(dirname, filename, size); + fd = create_sharedmem_resources(dirname, short_filename, size); FREE_C_HEAP_ARRAY(char, user_name); FREE_C_HEAP_ARRAY(char, dirname); @@ -838,12 +1046,12 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor // constructs for the file and the shared memory mapping. if (mode == PerfMemory::PERF_MODE_RO) { mmap_prot = PROT_READ; - file_flags = O_RDONLY; + file_flags = O_RDONLY | O_NOFOLLOW; } else if (mode == PerfMemory::PERF_MODE_RW) { #ifdef LATER mmap_prot = PROT_READ | PROT_WRITE; - file_flags = O_RDWR; + file_flags = O_RDWR | O_NOFOLLOW; #else THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "Unsupported access mode"); diff --git a/hotspot/src/os/bsd/vm/vmError_bsd.cpp b/hotspot/src/os/bsd/vm/vmError_bsd.cpp index 8ec6ca04c25..f09e1163f6b 100644 --- a/hotspot/src/os/bsd/vm/vmError_bsd.cpp +++ b/hotspot/src/os/bsd/vm/vmError_bsd.cpp @@ -63,9 +63,15 @@ void VMError::show_message_box(char *buf, int buflen) { } while (yes); } +// handle all synchronous program error signals which may happen during error +// reporting. They must be unblocked, caught, handled. + +static const int SIGNALS[] = { SIGSEGV, SIGBUS, SIGILL, SIGFPE, SIGTRAP }; // add more if needed +static const int NUM_SIGNALS = sizeof(SIGNALS) / sizeof(int); + // Space for our "saved" signal flags and handlers -static int resettedSigflags[2]; -static address resettedSighandler[2]; +static int resettedSigflags[NUM_SIGNALS]; +static address resettedSighandler[NUM_SIGNALS]; static void save_signal(int idx, int sig) { @@ -78,19 +84,19 @@ static void save_signal(int idx, int sig) } int VMError::get_resetted_sigflags(int sig) { - if(SIGSEGV == sig) { - return resettedSigflags[0]; - } else if(SIGBUS == sig) { - return resettedSigflags[1]; + for (int i = 0; i < NUM_SIGNALS; i++) { + if (SIGNALS[i] == sig) { + return resettedSigflags[i]; + } } return -1; } address VMError::get_resetted_sighandler(int sig) { - if(SIGSEGV == sig) { - return resettedSighandler[0]; - } else if(SIGBUS == sig) { - return resettedSighandler[1]; + for (int i = 0; i < NUM_SIGNALS; i++) { + if (SIGNALS[i] == sig) { + return resettedSighandler[i]; + } } return NULL; } @@ -100,16 +106,25 @@ static void crash_handler(int sig, siginfo_t* info, void* ucVoid) { sigset_t newset; sigemptyset(&newset); sigaddset(&newset, sig); - sigprocmask(SIG_UNBLOCK, &newset, NULL); + // also unmask other synchronous signals + for (int i = 0; i < NUM_SIGNALS; i++) { + sigaddset(&newset, SIGNALS[i]); + } + pthread_sigmask(SIG_UNBLOCK, &newset, NULL); VMError err(NULL, sig, NULL, info, ucVoid); err.report_and_die(); } void VMError::reset_signal_handlers() { - // Save sigflags for resetted signals - save_signal(0, SIGSEGV); - save_signal(1, SIGBUS); - os::signal(SIGSEGV, CAST_FROM_FN_PTR(void *, crash_handler)); - os::signal(SIGBUS, CAST_FROM_FN_PTR(void *, crash_handler)); + // install signal handlers for all synchronous program error signals + sigset_t newset; + sigemptyset(&newset); + + for (int i = 0; i < NUM_SIGNALS; i++) { + save_signal(i, SIGNALS[i]); + os::signal(SIGNALS[i], CAST_FROM_FN_PTR(void *, crash_handler)); + sigaddset(&newset, SIGNALS[i]); + } + pthread_sigmask(SIG_UNBLOCK, &newset, NULL); } diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index 4ad556ad388..323f8219ebe 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -1322,6 +1322,15 @@ jlong os::javaTimeMillis() { return jlong(time.tv_sec) * 1000 + jlong(time.tv_usec / 1000); } +void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) { + timeval time; + int status = gettimeofday(&time, NULL); + assert(status != -1, "linux error"); + seconds = jlong(time.tv_sec); + nanos = jlong(time.tv_usec) * 1000; +} + + #ifndef CLOCK_MONOTONIC #define CLOCK_MONOTONIC (1) #endif diff --git a/hotspot/src/os/linux/vm/perfMemory_linux.cpp b/hotspot/src/os/linux/vm/perfMemory_linux.cpp index 4497cc997dc..a6fd68ed3db 100644 --- a/hotspot/src/os/linux/vm/perfMemory_linux.cpp +++ b/hotspot/src/os/linux/vm/perfMemory_linux.cpp @@ -197,7 +197,38 @@ static pid_t filename_to_pid(const char* filename) { } -// check if the given path is considered a secure directory for +// Check if the given statbuf is considered a secure directory for +// the backing store files. Returns true if the directory is considered +// a secure location. Returns false if the statbuf is a symbolic link or +// if an error occurred. +// +static bool is_statbuf_secure(struct stat *statp) { + if (S_ISLNK(statp->st_mode) || !S_ISDIR(statp->st_mode)) { + // The path represents a link or some non-directory file type, + // which is not what we expected. Declare it insecure. + // + return false; + } + // We have an existing directory, check if the permissions are safe. + // + if ((statp->st_mode & (S_IWGRP|S_IWOTH)) != 0) { + // The directory is open for writing and could be subjected + // to a symlink or a hard link attack. Declare it insecure. + // + return false; + } + // See if the uid of the directory matches the effective uid of the process. + // + if (statp->st_uid != geteuid()) { + // The directory was not created by this user, declare it insecure. + // + return false; + } + return true; +} + + +// Check if the given path is considered a secure directory for // the backing store files. Returns true if the directory exists // and is considered a secure location. Returns false if the path // is a symbolic link or if an error occurred. @@ -211,22 +242,180 @@ static bool is_directory_secure(const char* path) { return false; } - // the path exists, now check it's mode - if (S_ISLNK(statbuf.st_mode) || !S_ISDIR(statbuf.st_mode)) { - // the path represents a link or some non-directory file type, - // which is not what we expected. declare it insecure. - // + // The path exists, see if it is secure. + return is_statbuf_secure(&statbuf); +} + + +// Check if the given directory file descriptor is considered a secure +// directory for the backing store files. Returns true if the directory +// exists and is considered a secure location. Returns false if the path +// is a symbolic link or if an error occurred. +// +static bool is_dirfd_secure(int dir_fd) { + struct stat statbuf; + int result = 0; + + RESTARTABLE(::fstat(dir_fd, &statbuf), result); + if (result == OS_ERR) { return false; } - else { - // we have an existing directory, check if the permissions are safe. - // - if ((statbuf.st_mode & (S_IWGRP|S_IWOTH)) != 0) { - // the directory is open for writing and could be subjected - // to a symlnk attack. declare it insecure. - // - return false; + + // The path exists, now check its mode. + return is_statbuf_secure(&statbuf); +} + + +// Check to make sure fd1 and fd2 are referencing the same file system object. +// +static bool is_same_fsobject(int fd1, int fd2) { + struct stat statbuf1; + struct stat statbuf2; + int result = 0; + + RESTARTABLE(::fstat(fd1, &statbuf1), result); + if (result == OS_ERR) { + return false; + } + RESTARTABLE(::fstat(fd2, &statbuf2), result); + if (result == OS_ERR) { + return false; + } + + if ((statbuf1.st_ino == statbuf2.st_ino) && + (statbuf1.st_dev == statbuf2.st_dev)) { + return true; + } else { + return false; + } +} + + +// Open the directory of the given path and validate it. +// Return a DIR * of the open directory. +// +static DIR *open_directory_secure(const char* dirname) { + // Open the directory using open() so that it can be verified + // to be secure by calling is_dirfd_secure(), opendir() and then check + // to see if they are the same file system object. This method does not + // introduce a window of opportunity for the directory to be attacked that + // calling opendir() and is_directory_secure() does. + int result; + DIR *dirp = NULL; + RESTARTABLE(::open(dirname, O_RDONLY|O_NOFOLLOW), result); + if (result == OS_ERR) { + if (PrintMiscellaneous && Verbose) { + if (errno == ELOOP) { + warning("directory %s is a symlink and is not secure\n", dirname); + } else { + warning("could not open directory %s: %s\n", dirname, strerror(errno)); + } } + return dirp; + } + int fd = result; + + // Determine if the open directory is secure. + if (!is_dirfd_secure(fd)) { + // The directory is not a secure directory. + os::close(fd); + return dirp; + } + + // Open the directory. + dirp = ::opendir(dirname); + if (dirp == NULL) { + // The directory doesn't exist, close fd and return. + os::close(fd); + return dirp; + } + + // Check to make sure fd and dirp are referencing the same file system object. + if (!is_same_fsobject(fd, dirfd(dirp))) { + // The directory is not secure. + os::close(fd); + os::closedir(dirp); + dirp = NULL; + return dirp; + } + + // Close initial open now that we know directory is secure + os::close(fd); + + return dirp; +} + +// NOTE: The code below uses fchdir(), open() and unlink() because +// fdopendir(), openat() and unlinkat() are not supported on all +// versions. Once the support for fdopendir(), openat() and unlinkat() +// is available on all supported versions the code can be changed +// to use these functions. + +// Open the directory of the given path, validate it and set the +// current working directory to it. +// Return a DIR * of the open directory and the saved cwd fd. +// +static DIR *open_directory_secure_cwd(const char* dirname, int *saved_cwd_fd) { + + // Open the directory. + DIR* dirp = open_directory_secure(dirname); + if (dirp == NULL) { + // Directory doesn't exist or is insecure, so there is nothing to cleanup. + return dirp; + } + int fd = dirfd(dirp); + + // Open a fd to the cwd and save it off. + int result; + RESTARTABLE(::open(".", O_RDONLY), result); + if (result == OS_ERR) { + *saved_cwd_fd = -1; + } else { + *saved_cwd_fd = result; + } + + // Set the current directory to dirname by using the fd of the directory. + result = fchdir(fd); + + return dirp; +} + +// Close the directory and restore the current working directory. +// +static void close_directory_secure_cwd(DIR* dirp, int saved_cwd_fd) { + + int result; + // If we have a saved cwd change back to it and close the fd. + if (saved_cwd_fd != -1) { + result = fchdir(saved_cwd_fd); + ::close(saved_cwd_fd); + } + + // Close the directory. + os::closedir(dirp); +} + +// Check if the given file descriptor is considered a secure. +// +static bool is_file_secure(int fd, const char *filename) { + + int result; + struct stat statbuf; + + // Determine if the file is secure. + RESTARTABLE(::fstat(fd, &statbuf), result); + if (result == OS_ERR) { + if (PrintMiscellaneous && Verbose) { + warning("fstat failed on %s: %s\n", filename, strerror(errno)); + } + return false; + } + if (statbuf.st_nlink > 1) { + // A file with multiple links is not expected. + if (PrintMiscellaneous && Verbose) { + warning("file %s has multiple links\n", filename); + } + return false; } return true; } @@ -317,9 +506,11 @@ static char* get_user_name_slow(int vmid, TRAPS) { const char* tmpdirname = os::get_temp_directory(); + // open the temp directory DIR* tmpdirp = os::opendir(tmpdirname); if (tmpdirp == NULL) { + // Cannot open the directory to get the user name, return. return NULL; } @@ -344,7 +535,8 @@ static char* get_user_name_slow(int vmid, TRAPS) { strcat(usrdir_name, "/"); strcat(usrdir_name, dentry->d_name); - DIR* subdirp = os::opendir(usrdir_name); + // open the user directory + DIR* subdirp = open_directory_secure(usrdir_name); if (subdirp == NULL) { FREE_C_HEAP_ARRAY(char, usrdir_name); @@ -465,26 +657,6 @@ static void remove_file(const char* path) { } -// remove file -// -// this method removes the file with the given file name in the -// named directory. -// -static void remove_file(const char* dirname, const char* filename) { - - size_t nbytes = strlen(dirname) + strlen(filename) + 2; - char* path = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal); - - strcpy(path, dirname); - strcat(path, "/"); - strcat(path, filename); - - remove_file(path); - - FREE_C_HEAP_ARRAY(char, path); -} - - // cleanup stale shared memory resources // // This method attempts to remove all stale shared memory files in @@ -496,17 +668,11 @@ static void remove_file(const char* dirname, const char* filename) { // static void cleanup_sharedmem_resources(const char* dirname) { - // open the user temp directory - DIR* dirp = os::opendir(dirname); - + int saved_cwd_fd; + // open the directory + DIR* dirp = open_directory_secure_cwd(dirname, &saved_cwd_fd); if (dirp == NULL) { - // directory doesn't exist, so there is nothing to cleanup - return; - } - - if (!is_directory_secure(dirname)) { - // the directory is not a secure directory - os::closedir(dirp); + // directory doesn't exist or is insecure, so there is nothing to cleanup return; } @@ -520,6 +686,7 @@ static void cleanup_sharedmem_resources(const char* dirname) { // struct dirent* entry; char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal); + errno = 0; while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) { @@ -528,9 +695,8 @@ static void cleanup_sharedmem_resources(const char* dirname) { if (pid == 0) { if (strcmp(entry->d_name, ".") != 0 && strcmp(entry->d_name, "..") != 0) { - // attempt to remove all unexpected files, except "." and ".." - remove_file(dirname, entry->d_name); + unlink(entry->d_name); } errno = 0; @@ -552,12 +718,14 @@ static void cleanup_sharedmem_resources(const char* dirname) { // if ((pid == os::current_process_id()) || (kill(pid, 0) == OS_ERR && (errno == ESRCH || errno == EPERM))) { - - remove_file(dirname, entry->d_name); + unlink(entry->d_name); } errno = 0; } - os::closedir(dirp); + + // close the directory and reset the current working directory + close_directory_secure_cwd(dirp, saved_cwd_fd); + FREE_C_HEAP_ARRAY(char, dbuf); } @@ -614,19 +782,54 @@ static int create_sharedmem_resources(const char* dirname, const char* filename, return -1; } - int result; - - RESTARTABLE(::open(filename, O_RDWR|O_CREAT|O_TRUNC, S_IREAD|S_IWRITE), result); - if (result == OS_ERR) { - if (PrintMiscellaneous && Verbose) { - warning("could not create file %s: %s\n", filename, strerror(errno)); - } + int saved_cwd_fd; + // open the directory and set the current working directory to it + DIR* dirp = open_directory_secure_cwd(dirname, &saved_cwd_fd); + if (dirp == NULL) { + // Directory doesn't exist or is insecure, so cannot create shared + // memory file. return -1; } + // Open the filename in the current directory. + // Cannot use O_TRUNC here; truncation of an existing file has to happen + // after the is_file_secure() check below. + int result; + RESTARTABLE(::open(filename, O_RDWR|O_CREAT|O_NOFOLLOW, S_IREAD|S_IWRITE), result); + if (result == OS_ERR) { + if (PrintMiscellaneous && Verbose) { + if (errno == ELOOP) { + warning("file %s is a symlink and is not secure\n", filename); + } else { + warning("could not create file %s: %s\n", filename, strerror(errno)); + } + } + // close the directory and reset the current working directory + close_directory_secure_cwd(dirp, saved_cwd_fd); + + return -1; + } + // close the directory and reset the current working directory + close_directory_secure_cwd(dirp, saved_cwd_fd); + // save the file descriptor int fd = result; + // check to see if the file is secure + if (!is_file_secure(fd, filename)) { + ::close(fd); + return -1; + } + + // truncate the file to get rid of any existing data + RESTARTABLE(::ftruncate(fd, (off_t)0), result); + if (result == OS_ERR) { + if (PrintMiscellaneous && Verbose) { + warning("could not truncate shared memory file: %s\n", strerror(errno)); + } + ::close(fd); + return -1; + } // set the file size RESTARTABLE(::ftruncate(fd, (off_t)size), result); if (result == OS_ERR) { @@ -684,8 +887,15 @@ static int open_sharedmem_file(const char* filename, int oflags, TRAPS) { THROW_MSG_(vmSymbols::java_io_IOException(), strerror(errno), OS_ERR); } } + int fd = result; - return result; + // check to see if the file is secure + if (!is_file_secure(fd, filename)) { + ::close(fd); + return -1; + } + + return fd; } // create a named shared memory region. returns the address of the @@ -716,6 +926,13 @@ static char* mmap_create_shared(size_t size) { char* dirname = get_user_tmp_dir(user_name); char* filename = get_sharedmem_filename(dirname, vmid); + // get the short filename + char* short_filename = strrchr(filename, '/'); + if (short_filename == NULL) { + short_filename = filename; + } else { + short_filename++; + } // cleanup any stale shared memory files cleanup_sharedmem_resources(dirname); @@ -723,7 +940,7 @@ static char* mmap_create_shared(size_t size) { assert(((size > 0) && (size % os::vm_page_size() == 0)), "unexpected PerfMemory region size"); - fd = create_sharedmem_resources(dirname, filename, size); + fd = create_sharedmem_resources(dirname, short_filename, size); FREE_C_HEAP_ARRAY(char, user_name); FREE_C_HEAP_ARRAY(char, dirname); @@ -838,12 +1055,12 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor // constructs for the file and the shared memory mapping. if (mode == PerfMemory::PERF_MODE_RO) { mmap_prot = PROT_READ; - file_flags = O_RDONLY; + file_flags = O_RDONLY | O_NOFOLLOW; } else if (mode == PerfMemory::PERF_MODE_RW) { #ifdef LATER mmap_prot = PROT_READ | PROT_WRITE; - file_flags = O_RDWR; + file_flags = O_RDWR | O_NOFOLLOW; #else THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "Unsupported access mode"); diff --git a/hotspot/src/os/linux/vm/vmError_linux.cpp b/hotspot/src/os/linux/vm/vmError_linux.cpp index 378c9a6ab6a..fca239c7e9f 100644 --- a/hotspot/src/os/linux/vm/vmError_linux.cpp +++ b/hotspot/src/os/linux/vm/vmError_linux.cpp @@ -63,9 +63,15 @@ void VMError::show_message_box(char *buf, int buflen) { } while (yes); } +// handle all synchronous program error signals which may happen during error +// reporting. They must be unblocked, caught, handled. + +static const int SIGNALS[] = { SIGSEGV, SIGBUS, SIGILL, SIGFPE, SIGTRAP }; // add more if needed +static const int NUM_SIGNALS = sizeof(SIGNALS) / sizeof(int); + // Space for our "saved" signal flags and handlers -static int resettedSigflags[2]; -static address resettedSighandler[2]; +static int resettedSigflags[NUM_SIGNALS]; +static address resettedSighandler[NUM_SIGNALS]; static void save_signal(int idx, int sig) { @@ -78,19 +84,19 @@ static void save_signal(int idx, int sig) } int VMError::get_resetted_sigflags(int sig) { - if(SIGSEGV == sig) { - return resettedSigflags[0]; - } else if(SIGBUS == sig) { - return resettedSigflags[1]; + for (int i = 0; i < NUM_SIGNALS; i++) { + if (SIGNALS[i] == sig) { + return resettedSigflags[i]; + } } return -1; } address VMError::get_resetted_sighandler(int sig) { - if(SIGSEGV == sig) { - return resettedSighandler[0]; - } else if(SIGBUS == sig) { - return resettedSighandler[1]; + for (int i = 0; i < NUM_SIGNALS; i++) { + if (SIGNALS[i] == sig) { + return resettedSighandler[i]; + } } return NULL; } @@ -100,16 +106,26 @@ static void crash_handler(int sig, siginfo_t* info, void* ucVoid) { sigset_t newset; sigemptyset(&newset); sigaddset(&newset, sig); - sigprocmask(SIG_UNBLOCK, &newset, NULL); + // also unmask other synchronous signals + for (int i = 0; i < NUM_SIGNALS; i++) { + sigaddset(&newset, SIGNALS[i]); + } + pthread_sigmask(SIG_UNBLOCK, &newset, NULL); VMError err(NULL, sig, NULL, info, ucVoid); err.report_and_die(); } void VMError::reset_signal_handlers() { - // Save sigflags for resetted signals - save_signal(0, SIGSEGV); - save_signal(1, SIGBUS); - os::signal(SIGSEGV, CAST_FROM_FN_PTR(void *, crash_handler)); - os::signal(SIGBUS, CAST_FROM_FN_PTR(void *, crash_handler)); + // install signal handlers for all synchronous program error signals + sigset_t newset; + sigemptyset(&newset); + + for (int i = 0; i < NUM_SIGNALS; i++) { + save_signal(i, SIGNALS[i]); + os::signal(SIGNALS[i], CAST_FROM_FN_PTR(void *, crash_handler)); + sigaddset(&newset, SIGNALS[i]); + } + pthread_sigmask(SIG_UNBLOCK, &newset, NULL); + } diff --git a/hotspot/src/os/solaris/vm/dtraceJSDT_solaris.cpp b/hotspot/src/os/solaris/vm/dtraceJSDT_solaris.cpp deleted file mode 100644 index 5d4fc9b2580..00000000000 --- a/hotspot/src/os/solaris/vm/dtraceJSDT_solaris.cpp +++ /dev/null @@ -1,655 +0,0 @@ -/* - * Copyright (c) 2005, 2012, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "classfile/javaClasses.hpp" -#include "code/codeBlob.hpp" -#include "memory/allocation.hpp" -#include "prims/jvm.h" -#include "runtime/dtraceJSDT.hpp" -#include "runtime/jniHandles.hpp" -#include "runtime/os.hpp" -#include "runtime/signature.hpp" -#include "utilities/globalDefinitions.hpp" - -#ifdef HAVE_DTRACE_H - -#include -#include -#include -#include -#include - -static const char* devname = "/dev/dtrace/helper"; -static const char* olddevname = "/devices/pseudo/dtrace@0:helper"; - -static const char* string_sig = "uintptr_t"; -static const char* int_sig = "long"; -static const char* long_sig = "long long"; - -static void printDOFHelper(dof_helper_t* helper); - -static int dofhelper_open() { - int fd; - if ((fd = open64(devname, O_RDWR)) < 0) { - // Optimize next calls - devname = olddevname; - if ((fd = open64(devname, O_RDWR)) < 0) { - return -1; - } - } - return fd; -} - -static jint dof_register(jstring module, uint8_t* dof, void* modaddr) { - int probe; - dof_helper_t dh; - int fd; - - memset(&dh, 0, sizeof(dh)); - - char* module_name = java_lang_String::as_utf8_string( - JNIHandles::resolve_non_null(module)); - jio_snprintf(dh.dofhp_mod, sizeof(dh.dofhp_mod), "%s", module_name); - dh.dofhp_dof = (uint64_t)dof; - dh.dofhp_addr = (uint64_t)modaddr; - - fd = dofhelper_open(); - if (fd < 0) - return -1; - probe = ioctl(fd, DTRACEHIOC_ADDDOF, &dh); - close(fd); - if (PrintDTraceDOF) { - printDOFHelper(&dh); - tty->print_cr("DOF helper id = %d", probe); - } - return probe; -} - -int DTraceJSDT::pd_activate( - void* moduleBaseAddress, jstring module, - jint providers_count, JVM_DTraceProvider* providers) { - - // We need sections: - // (1) STRTAB - // ( - // (2) PROVIDER - // (3) PROBES - // (4) PROBOFFS - // (5) PROBARGS - // ) * Number of Providers - - // Type of sections we create - enum { - STRTAB = 0, - PROVIDERS = 1, - PROBES = 2, - PROBE_OFFSETS = 3, - ARG_OFFSETS = 4, - NUM_SECTIONS = 5 - }; - - static int alignment_for[NUM_SECTIONS] = { 1, 4, 8, 4, 1 }; - - ResourceMark rm; - - uint32_t num_sections = 1 + 4 * providers_count; - uint32_t offset = sizeof(dof_hdr_t) + (num_sections * sizeof(dof_sec_t)); - uint32_t* secoffs = NEW_RESOURCE_ARRAY(uint32_t, num_sections); - uint32_t* secsize = NEW_RESOURCE_ARRAY(uint32_t, num_sections); - - // Store offsets of all strings here in such order: - // zero-string (always 0) - // provider1-name - // probe1-function - // probe1-name - // arg-1 - // arg-2 - // ... - // probe2-function - // probe2-name - // arg-1 - // arg-2 - // provider2-name - // ... - - uint32_t strcount = 0; - // Count the number of strings we'll need - for(int prvc = 0; prvc < providers_count; ++prvc) { - JVM_DTraceProvider* provider = &providers[prvc]; - // Provider name - ++strcount; - for(int prbc = 0; prbc < provider->probe_count; ++prbc) { - JVM_DTraceProbe* p = &(provider->probes[prbc]); - Symbol* sig = Method::resolve_jmethod_id(p->method)->signature(); - // function + name + one per argument - strcount += 2 + ArgumentCount(sig).size(); - } - } - - // Create place for string offsets - uint32_t* stroffs = NEW_RESOURCE_ARRAY(uint32_t, strcount + 1); - uint32_t string_index = 0; - uint32_t curstr = 0; - - // First we need an empty string: "" - stroffs[curstr++] = string_index; - string_index += strlen("") + 1; - - for(int prvc = 0; prvc < providers_count; ++prvc) { - JVM_DTraceProvider* provider = &providers[prvc]; - char* provider_name = java_lang_String::as_utf8_string( - JNIHandles::resolve_non_null(provider->name)); - stroffs[curstr++] = string_index; - string_index += strlen(provider_name) + 1; - - // All probes - for(int prbc = 0; prbc < provider->probe_count; ++prbc) { - JVM_DTraceProbe* p = &(provider->probes[prbc]); - - char* function = java_lang_String::as_utf8_string( - JNIHandles::resolve_non_null(p->function)); - stroffs[curstr++] = string_index; - string_index += strlen(function) + 1; - - char* name = java_lang_String::as_utf8_string( - JNIHandles::resolve_non_null(p->name)); - stroffs[curstr++] = string_index; - string_index += strlen(name) + 1; - - Symbol* sig = Method::resolve_jmethod_id(p->method)->signature(); - SignatureStream ss(sig); - for ( ; !ss.at_return_type(); ss.next()) { - BasicType bt = ss.type(); - const char* t = NULL; - if (bt == T_OBJECT && - ss.as_symbol_or_null() == vmSymbols::java_lang_String()) { - t = string_sig; - } else if (bt == T_LONG) { - t = long_sig; - } else { - t = int_sig; - } - stroffs[curstr++] = string_index; - string_index += strlen(t) + 1; - } - } - } - secoffs[STRTAB] = offset; - secsize[STRTAB] = string_index; - offset += string_index; - - // Calculate the size of the rest - for(int prvc = 0; prvc < providers_count; ++prvc) { - JVM_DTraceProvider* provider = &providers[prvc]; - size_t provider_sec = PROVIDERS + prvc * 4; - size_t probe_sec = PROBES + prvc * 4; - size_t probeoffs_sec = PROBE_OFFSETS + prvc * 4; - size_t argoffs_sec = ARG_OFFSETS + prvc * 4; - - // Allocate space for the provider data struction - secoffs[provider_sec] = align_size_up(offset, alignment_for[PROVIDERS]); - secsize[provider_sec] = sizeof(dof_provider_t); - offset = secoffs[provider_sec] + secsize[provider_sec]; - - // Allocate space for all the probes - secoffs[probe_sec] = align_size_up(offset, alignment_for[PROBES]); - secsize[probe_sec] = sizeof(dof_probe_t) * provider->probe_count; - offset = secoffs[probe_sec] + secsize[probe_sec]; - - // Allocate space for the probe offsets - secoffs[probeoffs_sec] = align_size_up(offset, alignment_for[PROBE_OFFSETS]); - secsize[probeoffs_sec] = sizeof(uint32_t) * provider->probe_count; - offset = secoffs[probeoffs_sec] + secsize[probeoffs_sec]; - - // We need number of arguments argoffs - uint32_t argscount = 0; - for(int prbc = 0; prbc < provider->probe_count; ++prbc) { - JVM_DTraceProbe* p = &(provider->probes[prbc]); - Symbol* sig = Method::resolve_jmethod_id(p->method)->signature(); - argscount += ArgumentCount(sig).size(); - } - secoffs[argoffs_sec] = align_size_up(offset, alignment_for[ARG_OFFSETS]); - secsize[argoffs_sec] = sizeof(uint8_t) * argscount; - offset = secoffs[argoffs_sec] + secsize[argoffs_sec]; - } - - uint32_t size = offset; - - uint8_t* dof = NEW_RESOURCE_ARRAY(uint8_t, size); - if (!dof) { - return -1; - } - memset((void*)dof, 0, size); - - // Fill memory with proper values - dof_hdr_t* hdr = (dof_hdr_t*)dof; - hdr->dofh_ident[DOF_ID_MAG0] = DOF_MAG_MAG0; - hdr->dofh_ident[DOF_ID_MAG1] = DOF_MAG_MAG1; - hdr->dofh_ident[DOF_ID_MAG2] = DOF_MAG_MAG2; - hdr->dofh_ident[DOF_ID_MAG3] = DOF_MAG_MAG3; - hdr->dofh_ident[DOF_ID_MODEL] = DOF_MODEL_NATIVE; // No variants - hdr->dofh_ident[DOF_ID_ENCODING] = DOF_ENCODE_NATIVE; // No variants - hdr->dofh_ident[DOF_ID_VERSION] = DOF_VERSION_1; // No variants - hdr->dofh_ident[DOF_ID_DIFVERS] = DIF_VERSION_2; // No variants - // all other fields of ident to zero - - hdr->dofh_flags = 0; - hdr->dofh_hdrsize = sizeof(dof_hdr_t); - hdr->dofh_secsize = sizeof(dof_sec_t); - hdr->dofh_secnum = num_sections; - hdr->dofh_secoff = sizeof(dof_hdr_t); - hdr->dofh_loadsz = size; - hdr->dofh_filesz = size; - - // First section: STRTAB - dof_sec_t* sec = (dof_sec_t*)(dof + sizeof(dof_hdr_t)); - sec->dofs_type = DOF_SECT_STRTAB; - sec->dofs_align = alignment_for[STRTAB]; - sec->dofs_flags = DOF_SECF_LOAD; - sec->dofs_entsize = 0; - sec->dofs_offset = secoffs[STRTAB]; - sec->dofs_size = secsize[STRTAB]; - // Make data for this section - char* str = (char*)(dof + sec->dofs_offset); - - *str = 0; str += 1; // "" - - // Run through all strings again - for(int prvc = 0; prvc < providers_count; ++prvc) { - JVM_DTraceProvider* provider = &providers[prvc]; - char* provider_name = java_lang_String::as_utf8_string( - JNIHandles::resolve_non_null(provider->name)); - strcpy(str, provider_name); - str += strlen(provider_name) + 1; - - // All probes - for(int prbc = 0; prbc < provider->probe_count; ++prbc) { - JVM_DTraceProbe* p = &(provider->probes[prbc]); - - char* function = java_lang_String::as_utf8_string( - JNIHandles::resolve_non_null(p->function)); - strcpy(str, function); - str += strlen(str) + 1; - - char* name = java_lang_String::as_utf8_string( - JNIHandles::resolve_non_null(p->name)); - strcpy(str, name); - str += strlen(name) + 1; - - Symbol* sig = Method::resolve_jmethod_id(p->method)->signature(); - SignatureStream ss(sig); - for ( ; !ss.at_return_type(); ss.next()) { - BasicType bt = ss.type(); - const char* t; - if (bt == T_OBJECT && - ss.as_symbol_or_null() == vmSymbols::java_lang_String()) { - t = string_sig; - } else if (bt == T_LONG) { - t = long_sig; - } else { - t = int_sig; - } - strcpy(str, t); - str += strlen(t) + 1; - } - } - } - - curstr = 1; - for(int prvc = 0; prvc < providers_count; ++prvc) { - JVM_DTraceProvider* provider = &providers[prvc]; - size_t provider_sec = PROVIDERS + prvc * 4; - size_t probe_sec = PROBES + prvc * 4; - size_t probeoffs_sec = PROBE_OFFSETS + prvc * 4; - size_t argoffs_sec = ARG_OFFSETS + prvc * 4; - - // PROVIDER /////////////////////////////////////////////////////////////// - // Section header - sec = (dof_sec_t*) - (dof + sizeof(dof_hdr_t) + sizeof(dof_sec_t) * provider_sec); - sec->dofs_type = DOF_SECT_PROVIDER; - sec->dofs_align = alignment_for[PROVIDERS]; - sec->dofs_flags = DOF_SECF_LOAD; - sec->dofs_entsize = 0; - sec->dofs_offset = secoffs[provider_sec]; - sec->dofs_size = secsize[provider_sec]; - // Make provider decriiption - dof_provider_t* prv = (dof_provider_t*)(dof + sec->dofs_offset); - prv->dofpv_strtab = STRTAB; - prv->dofpv_probes = probe_sec; - prv->dofpv_prargs = argoffs_sec; - prv->dofpv_proffs = probeoffs_sec; - prv->dofpv_name = stroffs[curstr++]; // Index in string table - prv->dofpv_provattr = DOF_ATTR( - provider->providerAttributes.nameStability, - provider->providerAttributes.dataStability, - provider->providerAttributes.dependencyClass); - prv->dofpv_modattr = DOF_ATTR( - provider->moduleAttributes.nameStability, - provider->moduleAttributes.dataStability, - provider->moduleAttributes.dependencyClass); - prv->dofpv_funcattr = DOF_ATTR( - provider->functionAttributes.nameStability, - provider->functionAttributes.dataStability, - provider->functionAttributes.dependencyClass); - prv->dofpv_nameattr = DOF_ATTR( - provider->nameAttributes.nameStability, - provider->nameAttributes.dataStability, - provider->nameAttributes.dependencyClass); - prv->dofpv_argsattr = DOF_ATTR( - provider->argsAttributes.nameStability, - provider->argsAttributes.dataStability, - provider->argsAttributes.dependencyClass); - - // PROBES ///////////////////////////////////////////////////////////////// - // Section header - sec = (dof_sec_t*) - (dof + sizeof(dof_hdr_t) + sizeof(dof_sec_t) * probe_sec); - sec->dofs_type = DOF_SECT_PROBES; - sec->dofs_align = alignment_for[PROBES]; - sec->dofs_flags = DOF_SECF_LOAD; - sec->dofs_entsize = sizeof(dof_probe_t); - sec->dofs_offset = secoffs[probe_sec]; - sec->dofs_size = secsize[probe_sec]; - // Make probes descriptions - uint32_t argsoffs = 0; - for(int prbc = 0; prbc < provider->probe_count; ++prbc) { - JVM_DTraceProbe* probe = &(provider->probes[prbc]); - Method* m = Method::resolve_jmethod_id(probe->method); - int arg_count = ArgumentCount(m->signature()).size(); - assert(m->code() != NULL, "must have an nmethod"); - - dof_probe_t* prb = - (dof_probe_t*)(dof + sec->dofs_offset + prbc * sizeof(dof_probe_t)); - - prb->dofpr_addr = (uint64_t)m->code()->entry_point(); - prb->dofpr_func = stroffs[curstr++]; // Index in string table - prb->dofpr_name = stroffs[curstr++]; // Index in string table - prb->dofpr_nargv = stroffs[curstr ]; // Index in string table - // We spent siglen strings here - curstr += arg_count; - prb->dofpr_xargv = prb->dofpr_nargv; // Same bunch of strings - prb->dofpr_argidx = argsoffs; - prb->dofpr_offidx = prbc; - prb->dofpr_nargc = arg_count; - prb->dofpr_xargc = arg_count; - prb->dofpr_noffs = 1; // Number of offsets - // Next bunch of offsets - argsoffs += arg_count; - } - - // PROFFS ///////////////////////////////////////////////////////////////// - // Section header - sec = (dof_sec_t*) - (dof + sizeof(dof_hdr_t) + sizeof(dof_sec_t) * probeoffs_sec); - sec->dofs_type = DOF_SECT_PROFFS; - sec->dofs_align = alignment_for[PROBE_OFFSETS]; - sec->dofs_flags = DOF_SECF_LOAD; - sec->dofs_entsize = sizeof(uint32_t); - sec->dofs_offset = secoffs[probeoffs_sec]; - sec->dofs_size = secsize[probeoffs_sec]; - // Make offsets - for (int prbc = 0; prbc < provider->probe_count; ++prbc) { - uint32_t* pof = - (uint32_t*)(dof + sec->dofs_offset + sizeof(uint32_t) * prbc); - JVM_DTraceProbe* probe = &(provider->probes[prbc]); - Method* m = Method::resolve_jmethod_id(probe->method); - *pof = m->code()->trap_offset(); - } - - // PRARGS ///////////////////////////////////////////////////////////////// - // Section header - sec = (dof_sec_t*) - (dof + sizeof(dof_hdr_t) + sizeof(dof_sec_t) * argoffs_sec); - sec->dofs_type = DOF_SECT_PRARGS; - sec->dofs_align = alignment_for[ARG_OFFSETS]; - sec->dofs_flags = DOF_SECF_LOAD; - sec->dofs_entsize = sizeof(uint8_t); - sec->dofs_offset = secoffs[argoffs_sec]; - sec->dofs_size = secsize[argoffs_sec]; - // Make arguments - uint8_t* par = (uint8_t*)(dof + sec->dofs_offset); - for (int prbc = 0; prbc < provider->probe_count; ++prbc) { - JVM_DTraceProbe* p = &(provider->probes[prbc]); - Symbol* sig = Method::resolve_jmethod_id(p->method)->signature(); - uint8_t count = (uint8_t)ArgumentCount(sig).size(); - for (uint8_t i = 0; i < count; ++i) { - *par++ = i; - } - } - } - - // Register module - return dof_register(module, dof, moduleBaseAddress); -} - - -void DTraceJSDT::pd_dispose(int handle) { - int fd; - if (handle == -1) { - return; - } - fd = dofhelper_open(); - if (fd < 0) - return; - ioctl(fd, DTRACEHIOC_REMOVE, handle); - close(fd); -} - -jboolean DTraceJSDT::pd_is_supported() { - int fd = dofhelper_open(); - if (fd < 0) { - return false; - } - close(fd); - return true; -} - -static const char* dofSecTypeFor(uint32_t type) { - switch (type) { - case 0: return "DOF_SECT_NONE"; - case 1: return "DOF_SECT_COMMENTS"; - case 2: return "DOF_SECT_SOURCE"; - case 3: return "DOF_SECT_ECBDESC"; - case 4: return "DOF_SECT_PROBEDESC"; - case 5: return "DOF_SECT_ACTDESC"; - case 6: return "DOF_SECT_DIFOHDR"; - case 7: return "DOF_SECT_DIF"; - case 8: return "DOF_SECT_STRTAB"; - case 9: return "DOF_SECT_VARTAB"; - case 10: return "DOF_SECT_RELTAB"; - case 11: return "DOF_SECT_TYPETAB"; - case 12: return "DOF_SECT_URELHDR"; - case 13: return "DOF_SECT_KRELHDR"; - case 14: return "DOF_SECT_OPTDESC"; - case 15: return "DOF_SECT_PROVIDER"; - case 16: return "DOF_SECT_PROBES"; - case 17: return "DOF_SECT_PRARGS"; - case 18: return "DOF_SECT_PROFFS"; - case 19: return "DOF_SECT_INTTAB"; - case 20: return "DOF_SECT_UTSNAME"; - case 21: return "DOF_SECT_XLTAB"; - case 22: return "DOF_SECT_XLMEMBERS"; - case 23: return "DOF_SECT_XLIMPORT"; - case 24: return "DOF_SECT_XLEXPORT"; - case 25: return "DOF_SECT_PREXPORT"; - case 26: return "DOF_SECT_PRENOFFS"; - default: return ""; - } -} - -static void printDOFStringTabSec(void* dof, dof_sec_t* sec) { - size_t tab = sec->dofs_offset; - size_t limit = sec->dofs_size; - tty->print_cr("// String Table:"); - for (size_t idx = 0; idx < limit; /*empty*/) { - char* str = ((char*)dof) + tab + idx; - tty->print_cr("// [0x%x + 0x%x] '%s'", tab, idx, str); - idx += strlen(str) + 1; - } -} - -static void printDOFProviderSec(void* dof, dof_sec_t* sec) { - dof_provider_t* prov = (dof_provider_t*)((char*)dof + sec->dofs_offset); - tty->print_cr("// dof_provider_t {"); - tty->print_cr("// dofpv_strtab = %d", prov->dofpv_strtab); - tty->print_cr("// dofpv_probes = %d", prov->dofpv_probes); - tty->print_cr("// dofpv_prargs = %d", prov->dofpv_prargs); - tty->print_cr("// dofpv_proffs = %d", prov->dofpv_proffs); - tty->print_cr("// dofpv_name = 0x%x", prov->dofpv_name); - tty->print_cr("// dofpv_provattr = 0x%08x", prov->dofpv_provattr); - tty->print_cr("// dofpv_modattr = 0x%08x", prov->dofpv_modattr); - tty->print_cr("// dofpv_funcattr = 0x%08x", prov->dofpv_funcattr); - tty->print_cr("// dofpv_nameattr = 0x%08x", prov->dofpv_nameattr); - tty->print_cr("// dofpv_argsattr = 0x%08x", prov->dofpv_argsattr); - tty->print_cr("// }"); -} - -static void printDOFProbesSec(void* dof, dof_sec_t* sec) { - size_t idx = sec->dofs_offset; - size_t limit = idx + sec->dofs_size; - for (size_t idx = sec->dofs_offset; idx < limit; idx += sec->dofs_entsize) { - dof_probe_t* prb = (dof_probe_t*)((char*)dof + idx); - tty->print_cr("// dof_probe_t {"); - tty->print_cr("// dofpr_addr = 0x%016llx", prb->dofpr_addr); - tty->print_cr("// dofpr_func = 0x%x", prb->dofpr_func); - tty->print_cr("// dofpr_name = 0x%x", prb->dofpr_name); - tty->print_cr("// dofpr_nargv = 0x%x", prb->dofpr_nargv); - tty->print_cr("// dofpr_xargv = 0x%x", prb->dofpr_xargv); - tty->print_cr("// dofpr_argidx = 0x%x", prb->dofpr_argidx); - tty->print_cr("// dofpr_offidx = 0x%x", prb->dofpr_offidx); - tty->print_cr("// dofpr_nargc = %d", prb->dofpr_nargc); - tty->print_cr("// dofpr_xargc = %d", prb->dofpr_xargc); - tty->print_cr("// dofpr_noffs = %d", prb->dofpr_noffs); - tty->print_cr("// }"); - } -} - -static void printDOFOffsetsSec(void* dof, dof_sec_t* sec) { - size_t tab = sec->dofs_offset; - size_t limit = sec->dofs_size; - tty->print_cr("// Offsets:"); - for (size_t idx = 0; idx < limit; idx += sec->dofs_entsize) { - uint32_t* off = (uint32_t*)((char*)dof + tab + idx); - tty->print_cr("// [0x%x + 0x%x]: %d", tab, idx, *off); - } -} - -static void printDOFArgsSec(void* dof, dof_sec_t* sec) { - size_t tab = sec->dofs_offset; - size_t limit = sec->dofs_size; - tty->print_cr("// Arguments:"); - for (size_t idx = 0; idx < limit; idx += sec->dofs_entsize) { - uint8_t* arg = (uint8_t*)((char*)dof + tab + idx); - tty->print_cr("// [0x%x + 0x%x]: %d", tab, idx, *arg); - } -} - -static void printDOFSection(void* dof, dof_sec_t* sec) { - tty->print_cr("// dof_sec_t {"); - tty->print_cr("// dofs_type = 0x%x /* %s */", - sec->dofs_type, dofSecTypeFor(sec->dofs_type)); - tty->print_cr("// dofs_align = %d", sec->dofs_align); - tty->print_cr("// dofs_flags = 0x%x", sec->dofs_flags); - tty->print_cr("// dofs_entsize = %d", sec->dofs_entsize); - tty->print_cr("// dofs_offset = 0x%llx", sec->dofs_offset); - tty->print_cr("// dofs_size = %lld", sec->dofs_size); - tty->print_cr("// }"); - switch (sec->dofs_type) { - case DOF_SECT_STRTAB: printDOFStringTabSec(dof, sec); break; - case DOF_SECT_PROVIDER: printDOFProviderSec(dof, sec); break; - case DOF_SECT_PROBES: printDOFProbesSec(dof, sec); break; - case DOF_SECT_PROFFS: printDOFOffsetsSec(dof, sec); break; - case DOF_SECT_PRARGS: printDOFArgsSec(dof, sec); break; - default: tty->print_cr("//
"); - } -} - -static void printDOFHeader(dof_hdr_t* hdr) { - tty->print_cr("// dof_hdr_t {"); - tty->print_cr("// dofh_ident[DOF_ID_MAG0] = 0x%x", - hdr->dofh_ident[DOF_ID_MAG0]); - tty->print_cr("// dofh_ident[DOF_ID_MAG1] = 0x%x", - hdr->dofh_ident[DOF_ID_MAG1]); - tty->print_cr("// dofh_ident[DOF_ID_MAG2] = 0x%x", - hdr->dofh_ident[DOF_ID_MAG2]); - tty->print_cr("// dofh_ident[DOF_ID_MAG3] = 0x%x", - hdr->dofh_ident[DOF_ID_MAG3]); - tty->print_cr("// dofh_ident[DOF_ID_MODEL] = 0x%x", - hdr->dofh_ident[DOF_ID_MODEL]); - tty->print_cr("// dofh_ident[DOF_ID_ENCODING] = 0x%x", - hdr->dofh_ident[DOF_ID_ENCODING]); - tty->print_cr("// dofh_ident[DOF_ID_VERSION] = 0x%x", - hdr->dofh_ident[DOF_ID_VERSION]); - tty->print_cr("// dofh_ident[DOF_ID_DIFVERS] = 0x%x", - hdr->dofh_ident[DOF_ID_DIFVERS]); - tty->print_cr("// dofh_flags = 0x%x", hdr->dofh_flags); - tty->print_cr("// dofh_hdrsize = %d", hdr->dofh_hdrsize); - tty->print_cr("// dofh_secsize = %d", hdr->dofh_secsize); - tty->print_cr("// dofh_secnum = %d", hdr->dofh_secnum); - tty->print_cr("// dofh_secoff = %lld", hdr->dofh_secoff); - tty->print_cr("// dofh_loadsz = %lld", hdr->dofh_loadsz); - tty->print_cr("// dofh_filesz = %lld", hdr->dofh_filesz); - tty->print_cr("// }"); -} - -static void printDOF(void* dof) { - dof_hdr_t* hdr = (dof_hdr_t*)dof; - printDOFHeader(hdr); - for (int i = 0; i < hdr->dofh_secnum; ++i) { - dof_sec_t* sec = - (dof_sec_t*)((char*)dof + sizeof(dof_hdr_t) + i * sizeof(dof_sec_t)); - tty->print_cr("// [Section #%d]", i); - printDOFSection(dof, sec); - } -} - -static void printDOFHelper(dof_helper_t* helper) { - tty->print_cr("// dof_helper_t {"); - tty->print_cr("// dofhp_mod = \"%s\"", helper->dofhp_mod); - tty->print_cr("// dofhp_addr = 0x%016llx", helper->dofhp_addr); - tty->print_cr("// dofhp_dof = 0x%016llx", helper->dofhp_dof); - printDOF((void*)helper->dofhp_dof); - tty->print_cr("// }"); - size_t len = ((dof_hdr_t*)helper)->dofh_loadsz; - tty->print_data((void*)helper->dofhp_dof, len, true); -} - -#else // ndef HAVE_DTRACE_H - -// Get here if we're not building on at least Solaris 10 -int DTraceJSDT::pd_activate( - void* baseAddress, jstring module, - jint provider_count, JVM_DTraceProvider* providers) { - return -1; -} - -void DTraceJSDT::pd_dispose(int handle) { -} - -jboolean DTraceJSDT::pd_is_supported() { - return false; -} -#endif diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 8a280b0b5ae..47c0f8a9253 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -1475,6 +1475,16 @@ jlong os::javaTimeMillis() { return jlong(t.tv_sec) * 1000 + jlong(t.tv_usec) / 1000; } +void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) { + timeval t; + if (gettimeofday(&t, NULL) == -1) { + fatal(err_msg("os::javaTimeSystemUTC: gettimeofday (%s)", strerror(errno))); + } + seconds = jlong(t.tv_sec); + nanos = jlong(t.tv_usec) * 1000; +} + + jlong os::javaTimeNanos() { return (jlong)getTimeNanos(); } diff --git a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp index b6c3c26f049..3c941eaeef4 100644 --- a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp +++ b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp @@ -199,7 +199,38 @@ static pid_t filename_to_pid(const char* filename) { } -// check if the given path is considered a secure directory for +// Check if the given statbuf is considered a secure directory for +// the backing store files. Returns true if the directory is considered +// a secure location. Returns false if the statbuf is a symbolic link or +// if an error occurred. +// +static bool is_statbuf_secure(struct stat *statp) { + if (S_ISLNK(statp->st_mode) || !S_ISDIR(statp->st_mode)) { + // The path represents a link or some non-directory file type, + // which is not what we expected. Declare it insecure. + // + return false; + } + // We have an existing directory, check if the permissions are safe. + // + if ((statp->st_mode & (S_IWGRP|S_IWOTH)) != 0) { + // The directory is open for writing and could be subjected + // to a symlink or a hard link attack. Declare it insecure. + // + return false; + } + // See if the uid of the directory matches the effective uid of the process. + // + if (statp->st_uid != geteuid()) { + // The directory was not created by this user, declare it insecure. + // + return false; + } + return true; +} + + +// Check if the given path is considered a secure directory for // the backing store files. Returns true if the directory exists // and is considered a secure location. Returns false if the path // is a symbolic link or if an error occurred. @@ -213,27 +244,185 @@ static bool is_directory_secure(const char* path) { return false; } - // the path exists, now check it's mode - if (S_ISLNK(statbuf.st_mode) || !S_ISDIR(statbuf.st_mode)) { - // the path represents a link or some non-directory file type, - // which is not what we expected. declare it insecure. - // + // The path exists, see if it is secure. + return is_statbuf_secure(&statbuf); +} + + +// Check if the given directory file descriptor is considered a secure +// directory for the backing store files. Returns true if the directory +// exists and is considered a secure location. Returns false if the path +// is a symbolic link or if an error occurred. +// +static bool is_dirfd_secure(int dir_fd) { + struct stat statbuf; + int result = 0; + + RESTARTABLE(::fstat(dir_fd, &statbuf), result); + if (result == OS_ERR) { return false; } - else { - // we have an existing directory, check if the permissions are safe. - // - if ((statbuf.st_mode & (S_IWGRP|S_IWOTH)) != 0) { - // the directory is open for writing and could be subjected - // to a symlnk attack. declare it insecure. - // - return false; + + // The path exists, now check its mode. + return is_statbuf_secure(&statbuf); +} + + +// Check to make sure fd1 and fd2 are referencing the same file system object. +// +static bool is_same_fsobject(int fd1, int fd2) { + struct stat statbuf1; + struct stat statbuf2; + int result = 0; + + RESTARTABLE(::fstat(fd1, &statbuf1), result); + if (result == OS_ERR) { + return false; + } + RESTARTABLE(::fstat(fd2, &statbuf2), result); + if (result == OS_ERR) { + return false; + } + + if ((statbuf1.st_ino == statbuf2.st_ino) && + (statbuf1.st_dev == statbuf2.st_dev)) { + return true; + } else { + return false; + } +} + + +// Open the directory of the given path and validate it. +// Return a DIR * of the open directory. +// +static DIR *open_directory_secure(const char* dirname) { + // Open the directory using open() so that it can be verified + // to be secure by calling is_dirfd_secure(), opendir() and then check + // to see if they are the same file system object. This method does not + // introduce a window of opportunity for the directory to be attacked that + // calling opendir() and is_directory_secure() does. + int result; + DIR *dirp = NULL; + RESTARTABLE(::open(dirname, O_RDONLY|O_NOFOLLOW), result); + if (result == OS_ERR) { + // Directory doesn't exist or is a symlink, so there is nothing to cleanup. + if (PrintMiscellaneous && Verbose) { + if (errno == ELOOP) { + warning("directory %s is a symlink and is not secure\n", dirname); + } else { + warning("could not open directory %s: %s\n", dirname, strerror(errno)); + } } + return dirp; + } + int fd = result; + + // Determine if the open directory is secure. + if (!is_dirfd_secure(fd)) { + // The directory is not a secure directory. + os::close(fd); + return dirp; + } + + // Open the directory. + dirp = ::opendir(dirname); + if (dirp == NULL) { + // The directory doesn't exist, close fd and return. + os::close(fd); + return dirp; + } + + // Check to make sure fd and dirp are referencing the same file system object. + if (!is_same_fsobject(fd, dirp->dd_fd)) { + // The directory is not secure. + os::close(fd); + os::closedir(dirp); + dirp = NULL; + return dirp; + } + + // Close initial open now that we know directory is secure + os::close(fd); + + return dirp; +} + +// NOTE: The code below uses fchdir(), open() and unlink() because +// fdopendir(), openat() and unlinkat() are not supported on all +// versions. Once the support for fdopendir(), openat() and unlinkat() +// is available on all supported versions the code can be changed +// to use these functions. + +// Open the directory of the given path, validate it and set the +// current working directory to it. +// Return a DIR * of the open directory and the saved cwd fd. +// +static DIR *open_directory_secure_cwd(const char* dirname, int *saved_cwd_fd) { + + // Open the directory. + DIR* dirp = open_directory_secure(dirname); + if (dirp == NULL) { + // Directory doesn't exist or is insecure, so there is nothing to cleanup. + return dirp; + } + int fd = dirp->dd_fd; + + // Open a fd to the cwd and save it off. + int result; + RESTARTABLE(::open(".", O_RDONLY), result); + if (result == OS_ERR) { + *saved_cwd_fd = -1; + } else { + *saved_cwd_fd = result; + } + + // Set the current directory to dirname by using the fd of the directory. + result = fchdir(fd); + + return dirp; +} + +// Close the directory and restore the current working directory. +// +static void close_directory_secure_cwd(DIR* dirp, int saved_cwd_fd) { + + int result; + // If we have a saved cwd change back to it and close the fd. + if (saved_cwd_fd != -1) { + result = fchdir(saved_cwd_fd); + ::close(saved_cwd_fd); + } + + // Close the directory. + os::closedir(dirp); +} + +// Check if the given file descriptor is considered a secure. +// +static bool is_file_secure(int fd, const char *filename) { + + int result; + struct stat statbuf; + + // Determine if the file is secure. + RESTARTABLE(::fstat(fd, &statbuf), result); + if (result == OS_ERR) { + if (PrintMiscellaneous && Verbose) { + warning("fstat failed on %s: %s\n", filename, strerror(errno)); + } + return false; + } + if (statbuf.st_nlink > 1) { + // A file with multiple links is not expected. + if (PrintMiscellaneous && Verbose) { + warning("file %s has multiple links\n", filename); + } + return false; } return true; } - // return the user name for the given user id // // the caller is expected to free the allocated memory. @@ -308,9 +497,11 @@ static char* get_user_name_slow(int vmid, TRAPS) { const char* tmpdirname = os::get_temp_directory(); + // open the temp directory DIR* tmpdirp = os::opendir(tmpdirname); if (tmpdirp == NULL) { + // Cannot open the directory to get the user name, return. return NULL; } @@ -335,7 +526,8 @@ static char* get_user_name_slow(int vmid, TRAPS) { strcat(usrdir_name, "/"); strcat(usrdir_name, dentry->d_name); - DIR* subdirp = os::opendir(usrdir_name); + // open the user directory + DIR* subdirp = open_directory_secure(usrdir_name); if (subdirp == NULL) { FREE_C_HEAP_ARRAY(char, usrdir_name); @@ -504,26 +696,6 @@ static void remove_file(const char* path) { } -// remove file -// -// this method removes the file with the given file name in the -// named directory. -// -static void remove_file(const char* dirname, const char* filename) { - - size_t nbytes = strlen(dirname) + strlen(filename) + 2; - char* path = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal); - - strcpy(path, dirname); - strcat(path, "/"); - strcat(path, filename); - - remove_file(path); - - FREE_C_HEAP_ARRAY(char, path); -} - - // cleanup stale shared memory resources // // This method attempts to remove all stale shared memory files in @@ -535,17 +707,11 @@ static void remove_file(const char* dirname, const char* filename) { // static void cleanup_sharedmem_resources(const char* dirname) { - // open the user temp directory - DIR* dirp = os::opendir(dirname); - + int saved_cwd_fd; + // open the directory + DIR* dirp = open_directory_secure_cwd(dirname, &saved_cwd_fd); if (dirp == NULL) { - // directory doesn't exist, so there is nothing to cleanup - return; - } - - if (!is_directory_secure(dirname)) { - // the directory is not a secure directory - os::closedir(dirp); + // directory doesn't exist or is insecure, so there is nothing to cleanup return; } @@ -559,6 +725,7 @@ static void cleanup_sharedmem_resources(const char* dirname) { // struct dirent* entry; char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal); + errno = 0; while ((entry = os::readdir(dirp, (struct dirent *)dbuf)) != NULL) { @@ -569,7 +736,7 @@ static void cleanup_sharedmem_resources(const char* dirname) { if (strcmp(entry->d_name, ".") != 0 && strcmp(entry->d_name, "..") != 0) { // attempt to remove all unexpected files, except "." and ".." - remove_file(dirname, entry->d_name); + unlink(entry->d_name); } errno = 0; @@ -592,11 +759,14 @@ static void cleanup_sharedmem_resources(const char* dirname) { if ((pid == os::current_process_id()) || (kill(pid, 0) == OS_ERR && (errno == ESRCH || errno == EPERM))) { - remove_file(dirname, entry->d_name); + unlink(entry->d_name); } errno = 0; } - os::closedir(dirp); + + // close the directory and reset the current working directory + close_directory_secure_cwd(dirp, saved_cwd_fd); + FREE_C_HEAP_ARRAY(char, dbuf); } @@ -653,19 +823,54 @@ static int create_sharedmem_resources(const char* dirname, const char* filename, return -1; } - int result; - - RESTARTABLE(::open(filename, O_RDWR|O_CREAT|O_TRUNC, S_IREAD|S_IWRITE), result); - if (result == OS_ERR) { - if (PrintMiscellaneous && Verbose) { - warning("could not create file %s: %s\n", filename, strerror(errno)); - } + int saved_cwd_fd; + // open the directory and set the current working directory to it + DIR* dirp = open_directory_secure_cwd(dirname, &saved_cwd_fd); + if (dirp == NULL) { + // Directory doesn't exist or is insecure, so cannot create shared + // memory file. return -1; } + // Open the filename in the current directory. + // Cannot use O_TRUNC here; truncation of an existing file has to happen + // after the is_file_secure() check below. + int result; + RESTARTABLE(::open(filename, O_RDWR|O_CREAT|O_NOFOLLOW, S_IREAD|S_IWRITE), result); + if (result == OS_ERR) { + if (PrintMiscellaneous && Verbose) { + if (errno == ELOOP) { + warning("file %s is a symlink and is not secure\n", filename); + } else { + warning("could not create file %s: %s\n", filename, strerror(errno)); + } + } + // close the directory and reset the current working directory + close_directory_secure_cwd(dirp, saved_cwd_fd); + + return -1; + } + // close the directory and reset the current working directory + close_directory_secure_cwd(dirp, saved_cwd_fd); + // save the file descriptor int fd = result; + // check to see if the file is secure + if (!is_file_secure(fd, filename)) { + ::close(fd); + return -1; + } + + // truncate the file to get rid of any existing data + RESTARTABLE(::ftruncate(fd, (off_t)0), result); + if (result == OS_ERR) { + if (PrintMiscellaneous && Verbose) { + warning("could not truncate shared memory file: %s\n", strerror(errno)); + } + ::close(fd); + return -1; + } // set the file size RESTARTABLE(::ftruncate(fd, (off_t)size), result); if (result == OS_ERR) { @@ -701,8 +906,15 @@ static int open_sharedmem_file(const char* filename, int oflags, TRAPS) { THROW_MSG_(vmSymbols::java_io_IOException(), strerror(errno), OS_ERR); } } + int fd = result; - return result; + // check to see if the file is secure + if (!is_file_secure(fd, filename)) { + ::close(fd); + return -1; + } + + return fd; } // create a named shared memory region. returns the address of the @@ -734,13 +946,21 @@ static char* mmap_create_shared(size_t size) { char* dirname = get_user_tmp_dir(user_name); char* filename = get_sharedmem_filename(dirname, vmid); + // get the short filename + char* short_filename = strrchr(filename, '/'); + if (short_filename == NULL) { + short_filename = filename; + } else { + short_filename++; + } + // cleanup any stale shared memory files cleanup_sharedmem_resources(dirname); assert(((size > 0) && (size % os::vm_page_size() == 0)), "unexpected PerfMemory region size"); - fd = create_sharedmem_resources(dirname, filename, size); + fd = create_sharedmem_resources(dirname, short_filename, size); FREE_C_HEAP_ARRAY(char, user_name); FREE_C_HEAP_ARRAY(char, dirname); @@ -856,12 +1076,12 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor // constructs for the file and the shared memory mapping. if (mode == PerfMemory::PERF_MODE_RO) { mmap_prot = PROT_READ; - file_flags = O_RDONLY; + file_flags = O_RDONLY | O_NOFOLLOW; } else if (mode == PerfMemory::PERF_MODE_RW) { #ifdef LATER mmap_prot = PROT_READ | PROT_WRITE; - file_flags = O_RDWR; + file_flags = O_RDWR | O_NOFOLLOW; #else THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "Unsupported access mode"); diff --git a/hotspot/src/os/solaris/vm/vmError_solaris.cpp b/hotspot/src/os/solaris/vm/vmError_solaris.cpp index 6f3f5b06fe6..e24e5f6bf4c 100644 --- a/hotspot/src/os/solaris/vm/vmError_solaris.cpp +++ b/hotspot/src/os/solaris/vm/vmError_solaris.cpp @@ -30,6 +30,7 @@ #include #include +#include #include void VMError::show_message_box(char *buf, int buflen) { @@ -59,9 +60,15 @@ void VMError::show_message_box(char *buf, int buflen) { } while (yes); } +// handle all synchronous program error signals which may happen during error +// reporting. They must be unblocked, caught, handled. + +static const int SIGNALS[] = { SIGSEGV, SIGBUS, SIGILL, SIGFPE, SIGTRAP }; // add more if needed +static const int NUM_SIGNALS = sizeof(SIGNALS) / sizeof(int); + // Space for our "saved" signal flags and handlers -static int resettedSigflags[2]; -static address resettedSighandler[2]; +static int resettedSigflags[NUM_SIGNALS]; +static address resettedSighandler[NUM_SIGNALS]; static void save_signal(int idx, int sig) { @@ -74,19 +81,19 @@ static void save_signal(int idx, int sig) } int VMError::get_resetted_sigflags(int sig) { - if(SIGSEGV == sig) { - return resettedSigflags[0]; - } else if(SIGBUS == sig) { - return resettedSigflags[1]; + for (int i = 0; i < NUM_SIGNALS; i++) { + if (SIGNALS[i] == sig) { + return resettedSigflags[i]; + } } return -1; } address VMError::get_resetted_sighandler(int sig) { - if(SIGSEGV == sig) { - return resettedSighandler[0]; - } else if(SIGBUS == sig) { - return resettedSighandler[1]; + for (int i = 0; i < NUM_SIGNALS; i++) { + if (SIGNALS[i] == sig) { + return resettedSighandler[i]; + } } return NULL; } @@ -96,16 +103,25 @@ static void crash_handler(int sig, siginfo_t* info, void* ucVoid) { sigset_t newset; sigemptyset(&newset); sigaddset(&newset, sig); - sigprocmask(SIG_UNBLOCK, &newset, NULL); + // also unmask other synchronous signals + for (int i = 0; i < NUM_SIGNALS; i++) { + sigaddset(&newset, SIGNALS[i]); + } + thr_sigsetmask(SIG_UNBLOCK, &newset, NULL); VMError err(NULL, sig, NULL, info, ucVoid); err.report_and_die(); } void VMError::reset_signal_handlers() { - // Save sigflags for resetted signals - save_signal(0, SIGSEGV); - save_signal(1, SIGBUS); - os::signal(SIGSEGV, CAST_FROM_FN_PTR(void *, crash_handler)); - os::signal(SIGBUS, CAST_FROM_FN_PTR(void *, crash_handler)); + // install signal handlers for all synchronous program error signals + sigset_t newset; + sigemptyset(&newset); + + for (int i = 0; i < NUM_SIGNALS; i++) { + save_signal(i, SIGNALS[i]); + os::signal(SIGNALS[i], CAST_FROM_FN_PTR(void *, crash_handler)); + sigaddset(&newset, SIGNALS[i]); + } + thr_sigsetmask(SIG_UNBLOCK, &newset, NULL); } diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index fb09815cf79..76f6384b7b9 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -428,9 +428,9 @@ static unsigned __stdcall java_start(Thread* thread) { } // Diagnostic code to investigate JDK-6573254 - int res = 50115; // non-java thread + int res = 30115; // non-java thread if (thread->is_Java_thread()) { - res = 40115; // java thread + res = 20115; // java thread } // Install a win32 structured exception handler around every thread created @@ -839,6 +839,12 @@ jlong windows_to_java_time(FILETIME wt) { return (a - offset()) / 10000; } +// Returns time ticks in (10th of micro seconds) +jlong windows_to_time_ticks(FILETIME wt) { + jlong a = jlong_from(wt.dwHighDateTime, wt.dwLowDateTime); + return (a - offset()); +} + FILETIME java_to_windows_time(jlong l) { jlong a = (l * 10000) + offset(); FILETIME result; @@ -874,6 +880,15 @@ jlong os::javaTimeMillis() { } } +void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) { + FILETIME wt; + GetSystemTimeAsFileTime(&wt); + jlong ticks = windows_to_time_ticks(wt); // 10th of micros + jlong secs = jlong(ticks / 10000000); // 10000 * 1000 + seconds = secs; + nanos = jlong(ticks - (secs*10000000)) * 100; +} + jlong os::javaTimeNanos() { if (!win32::_has_performance_count) { return javaTimeMillis() * NANOSECS_PER_MILLISEC; // the best we can do. @@ -1693,7 +1708,7 @@ void os::win32::print_windows_version(outputStream* st) { } break; - case 6004: + case 10000: if (is_workstation) { st->print("10"); } else { @@ -3791,6 +3806,7 @@ int os::win32::exit_process_or_thread(Ept what, int exit_code) { static INIT_ONCE init_once_crit_sect = INIT_ONCE_STATIC_INIT; static CRITICAL_SECTION crit_sect; + static volatile jint process_exiting = 0; int i, j; DWORD res; HANDLE hproc, hthr; @@ -3798,10 +3814,10 @@ int os::win32::exit_process_or_thread(Ept what, int exit_code) { // The first thread that reached this point, initializes the critical section. if (!InitOnceExecuteOnce(&init_once_crit_sect, init_crit_sect_call, &crit_sect, NULL)) { warning("crit_sect initialization failed in %s: %d\n", __FILE__, __LINE__); - } else { + } else if (OrderAccess::load_acquire(&process_exiting) == 0) { EnterCriticalSection(&crit_sect); - if (what == EPT_THREAD) { + if (what == EPT_THREAD && OrderAccess::load_acquire(&process_exiting) == 0) { // Remove from the array those handles of the threads that have completed exiting. for (i = 0, j = 0; i < handle_count; ++i) { res = WaitForSingleObject(handles[i], 0 /* don't wait */); @@ -3856,7 +3872,7 @@ int os::win32::exit_process_or_thread(Ept what, int exit_code) { // The current exiting thread has stored its handle in the array, and now // should leave the critical section before calling _endthreadex(). - } else { // what != EPT_THREAD + } else if (what != EPT_THREAD) { if (handle_count > 0) { // Before ending the process, make sure all the threads that had called // _endthreadex() completed. @@ -3882,24 +3898,28 @@ int os::win32::exit_process_or_thread(Ept what, int exit_code) { handle_count = 0; } - // End the process, not leaving critical section. - // This makes sure no other thread executes exit-related code at the same - // time, thus a race is avoided. - if (what == EPT_PROCESS) { - ::exit(exit_code); - } else { - _exit(exit_code); - } + OrderAccess::release_store(&process_exiting, 1); } LeaveCriticalSection(&crit_sect); } + + if (what == EPT_THREAD) { + while (OrderAccess::load_acquire(&process_exiting) != 0) { + // Some other thread is about to call exit(), so we + // don't let the current thread proceed to _endthreadex() + SuspendThread(GetCurrentThread()); + // Avoid busy-wait loop, if SuspendThread() failed. + Sleep(EXIT_TIMEOUT); + } + } } // We are here if either // - there's no 'race at exit' bug on this OS release; // - initialization of the critical section failed (unlikely); - // - the current thread has stored its handle and left the critical section. + // - the current thread has stored its handle and left the critical section; + // - the process-exiting thread has raised the flag and left the critical section. if (what == EPT_THREAD) { _endthreadex((unsigned)exit_code); } else if (what == EPT_PROCESS) { diff --git a/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp b/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp index 60969caa962..4e7e702ad66 100644 --- a/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp +++ b/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2007, 2008, 2011 Red Hat, Inc. + * Copyright 2007, 2008, 2011, 2015, Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -237,7 +237,13 @@ inline jint Atomic::xchg(jint exchange_value, volatile jint* dest) { // operation. Note that some platforms only support this with the // limitation that the only valid value to store is the immediate // constant 1. There is a test for this in JNI_CreateJavaVM(). - return __sync_lock_test_and_set (dest, exchange_value); + jint result = __sync_lock_test_and_set (dest, exchange_value); + // All atomic operations are expected to be full memory barriers + // (see atomic.hpp). However, __sync_lock_test_and_set is not + // a full memory barrier, but an acquire barrier. Hence, this added + // barrier. + __sync_synchronize(); + return result; #endif // M68K #endif // ARM } @@ -250,7 +256,9 @@ inline intptr_t Atomic::xchg_ptr(intptr_t exchange_value, #ifdef M68K return m68k_lock_test_and_set(dest, exchange_value); #else - return __sync_lock_test_and_set (dest, exchange_value); + intptr_t result = __sync_lock_test_and_set (dest, exchange_value); + __sync_synchronize(); + return result; #endif // M68K #endif // ARM } diff --git a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp index d9df41034d4..266c950422b 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2007, 2008, 2011 Red Hat, Inc. + * Copyright 2007, 2008, 2011, 2015, Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -231,7 +231,13 @@ inline jint Atomic::xchg(jint exchange_value, volatile jint* dest) { // operation. Note that some platforms only support this with the // limitation that the only valid value to store is the immediate // constant 1. There is a test for this in JNI_CreateJavaVM(). - return __sync_lock_test_and_set (dest, exchange_value); + jint result = __sync_lock_test_and_set (dest, exchange_value); + // All atomic operations are expected to be full memory barriers + // (see atomic.hpp). However, __sync_lock_test_and_set is not + // a full memory barrier, but an acquire barrier. Hence, this added + // barrier. + __sync_synchronize(); + return result; #endif // M68K #endif // ARM } @@ -244,7 +250,9 @@ inline intptr_t Atomic::xchg_ptr(intptr_t exchange_value, #ifdef M68K return m68k_lock_test_and_set(dest, exchange_value); #else - return __sync_lock_test_and_set (dest, exchange_value); + intptr_t result = __sync_lock_test_and_set (dest, exchange_value); + __sync_synchronize(); + return result; #endif // M68K #endif // ARM } diff --git a/hotspot/src/share/vm/adlc/formssel.cpp b/hotspot/src/share/vm/adlc/formssel.cpp index c5becc89b47..4a68da6cd1c 100644 --- a/hotspot/src/share/vm/adlc/formssel.cpp +++ b/hotspot/src/share/vm/adlc/formssel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -3489,9 +3489,7 @@ int MatchNode::needs_ideal_memory_edge(FormDict &globals) const { "GetAndAddL", "GetAndSetL", "GetAndSetN", }; int cnt = sizeof(needs_ideal_memory_list)/sizeof(char*); - if( strcmp(_opType,"PrefetchRead")==0 || - strcmp(_opType,"PrefetchWrite")==0 || - strcmp(_opType,"PrefetchAllocation")==0 ) + if( strcmp(_opType,"PrefetchAllocation")==0 ) return 1; if( _lChild ) { const char *opType = _lChild->_opType; diff --git a/hotspot/src/share/vm/asm/codeBuffer.hpp b/hotspot/src/share/vm/asm/codeBuffer.hpp index 023360ee67c..bb9c5c79af4 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.hpp +++ b/hotspot/src/share/vm/asm/codeBuffer.hpp @@ -42,7 +42,6 @@ public: Verified_Entry, Frame_Complete, // Offset in the code where the frame setup is (for forte stackwalks) is complete OSR_Entry, - Dtrace_trap = OSR_Entry, // dtrace probes can never have an OSR entry so reuse it Exceptions, // Offset where exception handler lives Deopt, // Offset where deopt handler lives DeoptMH, // Offset where MethodHandle deopt handler lives diff --git a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp index bbc5f477783..26cee689ab0 100644 --- a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp +++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -964,8 +964,6 @@ void Canonicalizer::do_UnsafePutRaw(UnsafePutRaw* x) { if (OptimizeUnsafes) do_U void Canonicalizer::do_UnsafeGetObject(UnsafeGetObject* x) {} void Canonicalizer::do_UnsafePutObject(UnsafePutObject* x) {} void Canonicalizer::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {} -void Canonicalizer::do_UnsafePrefetchRead (UnsafePrefetchRead* x) {} -void Canonicalizer::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) {} void Canonicalizer::do_ProfileCall(ProfileCall* x) {} void Canonicalizer::do_ProfileReturnType(ProfileReturnType* x) {} void Canonicalizer::do_ProfileInvoke(ProfileInvoke* x) {} diff --git a/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp b/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp index c1191830ed0..e9ba74c1a48 100644 --- a/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp +++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -101,8 +101,6 @@ class Canonicalizer: InstructionVisitor { virtual void do_UnsafeGetObject(UnsafeGetObject* x); virtual void do_UnsafePutObject(UnsafePutObject* x); virtual void do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x); - virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x); - virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x); virtual void do_ProfileCall (ProfileCall* x); virtual void do_ProfileReturnType (ProfileReturnType* x); virtual void do_ProfileInvoke (ProfileInvoke* x); diff --git a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp index e3a4f4d5680..05a8c70506f 100644 --- a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp +++ b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -601,15 +601,6 @@ class G1PostBarrierStub: public CodeStub { LIR_Opr _addr; LIR_Opr _new_val; - static jbyte* _byte_map_base; - static jbyte* byte_map_base_slow(); - static jbyte* byte_map_base() { - if (_byte_map_base == NULL) { - _byte_map_base = byte_map_base_slow(); - } - return _byte_map_base; - } - public: // addr (the address of the object head) and new_val must be registers. G1PostBarrierStub(LIR_Opr addr, LIR_Opr new_val): _addr(addr), _new_val(new_val) { } diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index 351e410aa15..7bf14b5386d 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -3497,11 +3497,6 @@ bool GraphBuilder::try_inline_intrinsics(ciMethod* callee) { case vmIntrinsics::_putFloat_raw : return append_unsafe_put_raw(callee, T_FLOAT); case vmIntrinsics::_putDouble_raw : return append_unsafe_put_raw(callee, T_DOUBLE); - case vmIntrinsics::_prefetchRead : return append_unsafe_prefetch(callee, false, false); - case vmIntrinsics::_prefetchWrite : return append_unsafe_prefetch(callee, false, true); - case vmIntrinsics::_prefetchReadStatic : return append_unsafe_prefetch(callee, true, false); - case vmIntrinsics::_prefetchWriteStatic : return append_unsafe_prefetch(callee, true, true); - case vmIntrinsics::_checkIndex : if (!InlineNIOCheckIndex) return false; preserves_state = true; @@ -4258,27 +4253,6 @@ bool GraphBuilder::append_unsafe_put_raw(ciMethod* callee, BasicType t) { } -bool GraphBuilder::append_unsafe_prefetch(ciMethod* callee, bool is_static, bool is_store) { - if (InlineUnsafeOps) { - Values* args = state()->pop_arguments(callee->arg_size()); - int obj_arg_index = 1; // Assume non-static case - if (is_static) { - obj_arg_index = 0; - } else { - null_check(args->at(0)); - } - Instruction* offset = args->at(obj_arg_index + 1); -#ifndef _LP64 - offset = append(new Convert(Bytecodes::_l2i, offset, as_ValueType(T_INT))); -#endif - Instruction* op = is_store ? append(new UnsafePrefetchWrite(args->at(obj_arg_index), offset)) - : append(new UnsafePrefetchRead (args->at(obj_arg_index), offset)); - compilation()->set_has_unsafe_access(true); - } - return InlineUnsafeOps; -} - - void GraphBuilder::append_unsafe_CAS(ciMethod* callee) { ValueStack* state_before = copy_state_for_exception(); ValueType* result_type = as_ValueType(callee->return_type()); diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp index 2caf6142e53..d53c1c04953 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -368,7 +368,6 @@ class GraphBuilder VALUE_OBJ_CLASS_SPEC { bool append_unsafe_put_obj(ciMethod* callee, BasicType t, bool is_volatile); bool append_unsafe_get_raw(ciMethod* callee, BasicType t); bool append_unsafe_put_raw(ciMethod* callee, BasicType t); - bool append_unsafe_prefetch(ciMethod* callee, bool is_store, bool is_static); void append_unsafe_CAS(ciMethod* callee); bool append_unsafe_get_and_set_obj(ciMethod* callee, bool is_add); diff --git a/hotspot/src/share/vm/c1/c1_Instruction.hpp b/hotspot/src/share/vm/c1/c1_Instruction.hpp index 3121088c9e6..b61786c58c5 100644 --- a/hotspot/src/share/vm/c1/c1_Instruction.hpp +++ b/hotspot/src/share/vm/c1/c1_Instruction.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -103,9 +103,6 @@ class UnsafeObjectOp; class UnsafeGetObject; class UnsafePutObject; class UnsafeGetAndSetObject; -class UnsafePrefetch; -class UnsafePrefetchRead; -class UnsafePrefetchWrite; class ProfileCall; class ProfileReturnType; class ProfileInvoke; @@ -209,8 +206,6 @@ class InstructionVisitor: public StackObj { virtual void do_UnsafeGetObject(UnsafeGetObject* x) = 0; virtual void do_UnsafePutObject(UnsafePutObject* x) = 0; virtual void do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) = 0; - virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x) = 0; - virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) = 0; virtual void do_ProfileCall (ProfileCall* x) = 0; virtual void do_ProfileReturnType (ProfileReturnType* x) = 0; virtual void do_ProfileInvoke (ProfileInvoke* x) = 0; @@ -2442,34 +2437,6 @@ LEAF(UnsafeGetAndSetObject, UnsafeObjectOp) f->visit(&_value); } }; -BASE(UnsafePrefetch, UnsafeObjectOp) - public: - UnsafePrefetch(Value object, Value offset) - : UnsafeObjectOp(T_VOID, object, offset, false, false) - { - } -}; - - -LEAF(UnsafePrefetchRead, UnsafePrefetch) - public: - UnsafePrefetchRead(Value object, Value offset) - : UnsafePrefetch(object, offset) - { - ASSERT_VALUES - } -}; - - -LEAF(UnsafePrefetchWrite, UnsafePrefetch) - public: - UnsafePrefetchWrite(Value object, Value offset) - : UnsafePrefetch(object, offset) - { - ASSERT_VALUES - } -}; - LEAF(ProfileCall, Instruction) private: ciMethod* _method; diff --git a/hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp b/hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp index 842acec5be9..6b4e31b9a54 100644 --- a/hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp +++ b/hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -853,11 +853,6 @@ void InstructionPrinter::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) { output()->put(')'); } -void InstructionPrinter::do_UnsafePrefetchRead(UnsafePrefetchRead* x) { - print_unsafe_object_op(x, "UnsafePrefetchRead"); - output()->put(')'); -} - void InstructionPrinter::do_RangeCheckPredicate(RangeCheckPredicate* x) { if (x->x() != NULL && x->y() != NULL) { @@ -880,11 +875,6 @@ void InstructionPrinter::do_Assert(Assert* x) { } #endif -void InstructionPrinter::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { - print_unsafe_object_op(x, "UnsafePrefetchWrite"); - output()->put(')'); -} - void InstructionPrinter::do_ProfileCall(ProfileCall* x) { output()->print("profile "); print_value(x->recv()); diff --git a/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp b/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp index a3a91033d70..c2ef4b7b969 100644 --- a/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp +++ b/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -129,8 +129,6 @@ class InstructionPrinter: public InstructionVisitor { virtual void do_UnsafeGetObject(UnsafeGetObject* x); virtual void do_UnsafePutObject(UnsafePutObject* x); virtual void do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x); - virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x); - virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x); virtual void do_ProfileCall (ProfileCall* x); virtual void do_ProfileReturnType (ProfileReturnType* x); virtual void do_ProfileInvoke (ProfileInvoke* x); diff --git a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp index f60190ae6c3..0494b28ff98 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.cpp +++ b/hotspot/src/share/vm/c1/c1_LIR.cpp @@ -527,8 +527,6 @@ void LIR_OpVisitState::visit(LIR_Op* op) { case lir_move: // input and result always valid, may have info case lir_pack64: // input and result always valid case lir_unpack64: // input and result always valid - case lir_prefetchr: // input always valid, result and info always invalid - case lir_prefetchw: // input always valid, result and info always invalid { assert(op->as_Op1() != NULL, "must be"); LIR_Op1* op1 = (LIR_Op1*)op; @@ -1266,13 +1264,6 @@ void LIR_List::volatile_load_unsafe_reg(LIR_Opr base, LIR_Opr offset, LIR_Opr ds } -void LIR_List::prefetch(LIR_Address* addr, bool is_store) { - append(new LIR_Op1( - is_store ? lir_prefetchw : lir_prefetchr, - LIR_OprFact::address(addr))); -} - - void LIR_List::store_mem_int(jint v, LIR_Opr base, int offset_in_bytes, BasicType type, CodeEmitInfo* info, LIR_PatchCode patch_code) { append(new LIR_Op1( lir_move, diff --git a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp index e26c280c38a..ae2b994db46 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.hpp +++ b/hotspot/src/share/vm/c1/c1_LIR.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -925,8 +925,6 @@ enum LIR_Code { , lir_branch , lir_cond_float_branch , lir_move - , lir_prefetchr - , lir_prefetchw , lir_convert , lir_alloc_object , lir_monaddr @@ -2212,8 +2210,6 @@ class LIR_List: public CompilationResourceObj { void load(LIR_Address* addr, LIR_Opr src, CodeEmitInfo* info = NULL, LIR_PatchCode patch_code = lir_patch_none); - void prefetch(LIR_Address* addr, bool is_store); - void store_mem_int(jint v, LIR_Opr base, int offset_in_bytes, BasicType type, CodeEmitInfo* info, LIR_PatchCode patch_code = lir_patch_none); void store_mem_oop(jobject o, LIR_Opr base, int offset_in_bytes, BasicType type, CodeEmitInfo* info, LIR_PatchCode patch_code = lir_patch_none); void store(LIR_Opr src, LIR_Address* addr, CodeEmitInfo* info = NULL, LIR_PatchCode patch_code = lir_patch_none); diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp index dc43a87389d..f82913e0d18 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp @@ -503,14 +503,6 @@ void LIR_Assembler::emit_op1(LIR_Op1* op) { } break; - case lir_prefetchr: - prefetchr(op->in_opr()); - break; - - case lir_prefetchw: - prefetchw(op->in_opr()); - break; - case lir_roundfp: { LIR_OpRoundFP* round_op = op->as_OpRoundFP(); roundfp_op(round_op->in_opr(), round_op->tmp(), round_op->result_opr(), round_op->pop_fpu_stack()); diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp index 2211b0cc32c..b7891cb830b 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -182,9 +182,6 @@ class LIR_Assembler: public CompilationResourceObj { LIR_PatchCode patch_code, CodeEmitInfo* info, bool wide, bool unaligned); - void prefetchr (LIR_Opr src); - void prefetchw (LIR_Opr src); - void shift_op(LIR_Code code, LIR_Opr left, LIR_Opr count, LIR_Opr dest, LIR_Opr tmp); void shift_op(LIR_Code code, LIR_Opr left, jint count, LIR_Opr dest); diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index 2beb72a60f1..9939243508b 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -32,6 +32,7 @@ #include "ci/ciArrayKlass.hpp" #include "ci/ciInstance.hpp" #include "ci/ciObjArray.hpp" +#include "runtime/arguments.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" #include "runtime/vm_version.hpp" @@ -1431,7 +1432,6 @@ void LIRGenerator::pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val, // No pre barriers break; case BarrierSet::ModRef: - case BarrierSet::Other: // No pre barriers break; default : @@ -1453,7 +1453,6 @@ void LIRGenerator::post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) { CardTableModRef_post_barrier(addr, new_val); break; case BarrierSet::ModRef: - case BarrierSet::Other: // No post barriers break; default : @@ -2386,35 +2385,6 @@ void LIRGenerator::do_UnsafePutObject(UnsafePutObject* x) { } -void LIRGenerator::do_UnsafePrefetch(UnsafePrefetch* x, bool is_store) { - LIRItem src(x->object(), this); - LIRItem off(x->offset(), this); - - src.load_item(); - if (off.is_constant() && can_inline_as_constant(x->offset())) { - // let it be a constant - off.dont_load_item(); - } else { - off.load_item(); - } - - set_no_result(x); - - LIR_Address* addr = generate_address(src.result(), off.result(), 0, 0, T_BYTE); - __ prefetch(addr, is_store); -} - - -void LIRGenerator::do_UnsafePrefetchRead(UnsafePrefetchRead* x) { - do_UnsafePrefetch(x, false); -} - - -void LIRGenerator::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { - do_UnsafePrefetch(x, true); -} - - void LIRGenerator::do_SwitchRanges(SwitchRangeArray* x, LIR_Opr value, BlockBegin* default_sux) { int lng = x->length(); @@ -3351,7 +3321,12 @@ void LIRGenerator::do_ProfileInvoke(ProfileInvoke* x) { if (!x->inlinee()->is_accessor()) { CodeEmitInfo* info = state_for(x, x->state(), true); // Notify the runtime very infrequently only to take care of counter overflows - increment_event_counter_impl(info, x->inlinee(), (1 << Tier23InlineeNotifyFreqLog) - 1, InvocationEntryBci, false, true); + int freq_log = Tier23InlineeNotifyFreqLog; + double scale; + if (_method->has_option_value("CompileThresholdScaling", scale)) { + freq_log = Arguments::scaled_freq_log(freq_log, scale); + } + increment_event_counter_impl(info, x->inlinee(), right_n_bits(freq_log), InvocationEntryBci, false, true); } } @@ -3366,7 +3341,11 @@ void LIRGenerator::increment_event_counter(CodeEmitInfo* info, int bci, bool bac ShouldNotReachHere(); } // Increment the appropriate invocation/backedge counter and notify the runtime. - increment_event_counter_impl(info, info->scope()->method(), (1 << freq_log) - 1, bci, backedge, true); + double scale; + if (_method->has_option_value("CompileThresholdScaling", scale)) { + freq_log = Arguments::scaled_freq_log(freq_log, scale); + } + increment_event_counter_impl(info, info->scope()->method(), right_n_bits(freq_log), bci, backedge, true); } void LIRGenerator::decrement_age(CodeEmitInfo* info) { diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp index ba003e5851f..5095af782c9 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -251,8 +251,6 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { void do_Reference_get(Intrinsic* x); void do_update_CRC32(Intrinsic* x); - void do_UnsafePrefetch(UnsafePrefetch* x, bool is_store); - LIR_Opr call_runtime(BasicTypeArray* signature, LIRItemList* args, address entry, ValueType* result_type, CodeEmitInfo* info); LIR_Opr call_runtime(BasicTypeArray* signature, LIR_OprList* args, address entry, ValueType* result_type, CodeEmitInfo* info); @@ -539,8 +537,6 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { virtual void do_UnsafeGetObject(UnsafeGetObject* x); virtual void do_UnsafePutObject(UnsafePutObject* x); virtual void do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x); - virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x); - virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x); virtual void do_ProfileCall (ProfileCall* x); virtual void do_ProfileReturnType (ProfileReturnType* x); virtual void do_ProfileInvoke (ProfileInvoke* x); diff --git a/hotspot/src/share/vm/c1/c1_Optimizer.cpp b/hotspot/src/share/vm/c1/c1_Optimizer.cpp index f366462f60c..b44d74e12b4 100644 --- a/hotspot/src/share/vm/c1/c1_Optimizer.cpp +++ b/hotspot/src/share/vm/c1/c1_Optimizer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -528,8 +528,6 @@ public: void do_UnsafeGetObject(UnsafeGetObject* x); void do_UnsafePutObject(UnsafePutObject* x); void do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x); - void do_UnsafePrefetchRead (UnsafePrefetchRead* x); - void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x); void do_ProfileCall (ProfileCall* x); void do_ProfileReturnType (ProfileReturnType* x); void do_ProfileInvoke (ProfileInvoke* x); @@ -716,8 +714,6 @@ void NullCheckVisitor::do_UnsafePutRaw (UnsafePutRaw* x) {} void NullCheckVisitor::do_UnsafeGetObject(UnsafeGetObject* x) {} void NullCheckVisitor::do_UnsafePutObject(UnsafePutObject* x) {} void NullCheckVisitor::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {} -void NullCheckVisitor::do_UnsafePrefetchRead (UnsafePrefetchRead* x) {} -void NullCheckVisitor::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) {} void NullCheckVisitor::do_ProfileCall (ProfileCall* x) { nce()->clear_last_explicit_null_check(); nce()->handle_ProfileCall(x); } void NullCheckVisitor::do_ProfileReturnType (ProfileReturnType* x) { nce()->handle_ProfileReturnType(x); } diff --git a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp index f7b68af9862..2fd6cb59221 100644 --- a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp +++ b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp @@ -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 @@ -159,8 +159,6 @@ public: void do_UnsafeGetRaw (UnsafeGetRaw* x) { /* nothing to do */ }; void do_UnsafeGetObject(UnsafeGetObject* x) { /* nothing to do */ }; void do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) { /* nothing to do */ }; - void do_UnsafePrefetchRead (UnsafePrefetchRead* x) { /* nothing to do */ }; - void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { /* nothing to do */ }; void do_ProfileCall (ProfileCall* x) { /* nothing to do */ }; void do_ProfileReturnType (ProfileReturnType* x) { /* nothing to do */ }; void do_ProfileInvoke (ProfileInvoke* x) { /* nothing to do */ }; diff --git a/hotspot/src/share/vm/c1/c1_ValueMap.hpp b/hotspot/src/share/vm/c1/c1_ValueMap.hpp index e394118b1ce..3b3b02ee4b7 100644 --- a/hotspot/src/share/vm/c1/c1_ValueMap.hpp +++ b/hotspot/src/share/vm/c1/c1_ValueMap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -200,8 +200,6 @@ class ValueNumberingVisitor: public InstructionVisitor { void do_RoundFP (RoundFP* x) { /* nothing to do */ } void do_UnsafeGetRaw (UnsafeGetRaw* x) { /* nothing to do */ } void do_UnsafeGetObject(UnsafeGetObject* x) { /* nothing to do */ } - void do_UnsafePrefetchRead (UnsafePrefetchRead* x) { /* nothing to do */ } - void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { /* nothing to do */ } void do_ProfileCall (ProfileCall* x) { /* nothing to do */ } void do_ProfileReturnType (ProfileReturnType* x) { /* nothing to do */ } void do_ProfileInvoke (ProfileInvoke* x) { /* nothing to do */ }; diff --git a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp index ae9def38b26..4c0cd3d8083 100644 --- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp +++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp @@ -89,8 +89,8 @@ class BCEscapeAnalyzer::StateInfo { public: ArgumentMap *_vars; ArgumentMap *_stack; - short _stack_height; - short _max_stack; + int _stack_height; + int _max_stack; bool _initialized; ArgumentMap empty_map; diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp index 43691b907d7..b81206a1616 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp @@ -501,32 +501,31 @@ ciInstanceKlass::compute_nonstatic_fields_impl(GrowableArray* return fields; } -void ciInstanceKlass::compute_injected_fields_helper() { +bool ciInstanceKlass::compute_injected_fields_helper() { ASSERT_IN_VM; InstanceKlass* k = get_instanceKlass(); for (InternalFieldStream fs(k); !fs.done(); fs.next()) { if (fs.access_flags().is_static()) continue; - _has_injected_fields++; - break; - } -} - -bool ciInstanceKlass::compute_injected_fields() { - assert(_has_injected_fields == -1, "shouldn't be initialized yet"); - assert(is_loaded(), "must be loaded"); - - if (super() != NULL && super()->has_injected_fields()) { - _has_injected_fields = 1; return true; } + return false; +} - _has_injected_fields = 0; - GUARDED_VM_ENTRY({ - compute_injected_fields_helper(); - }); +void ciInstanceKlass::compute_injected_fields() { + assert(is_loaded(), "must be loaded"); - return _has_injected_fields > 0 ? true : false; + int has_injected_fields = 0; + if (super() != NULL && super()->has_injected_fields()) { + has_injected_fields = 1; + } else { + GUARDED_VM_ENTRY({ + has_injected_fields = compute_injected_fields_helper() ? 1 : 0; + }); + } + // may be concurrently initialized for shared ciInstanceKlass objects + assert(_has_injected_fields == -1 || _has_injected_fields == has_injected_fields, "broken concurrent initialization"); + _has_injected_fields = has_injected_fields; } // ------------------------------------------------------------------ diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp index 424b61a0a10..df9ed0f7fe9 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp @@ -72,8 +72,8 @@ private: // Itsef: more than one implementors. ciInstanceKlass* _implementor; - bool compute_injected_fields(); - void compute_injected_fields_helper(); + void compute_injected_fields(); + bool compute_injected_fields_helper(); protected: ciInstanceKlass(KlassHandle h_k); @@ -193,7 +193,7 @@ public: bool has_injected_fields() { if (_has_injected_fields == -1) { - return compute_injected_fields(); + compute_injected_fields(); } return _has_injected_fields > 0 ? true : false; } diff --git a/hotspot/src/share/vm/ci/ciMethod.cpp b/hotspot/src/share/vm/ci/ciMethod.cpp index d32df16bcbb..4769254e9b6 100644 --- a/hotspot/src/share/vm/ci/ciMethod.cpp +++ b/hotspot/src/share/vm/ci/ciMethod.cpp @@ -70,7 +70,8 @@ // Loaded method. ciMethod::ciMethod(methodHandle h_m, ciInstanceKlass* holder) : ciMetadata(h_m()), - _holder(holder) + _holder(holder), + _has_injected_profile(false) { assert(h_m() != NULL, "no null method"); @@ -168,7 +169,8 @@ ciMethod::ciMethod(ciInstanceKlass* holder, _liveness( NULL), _can_be_statically_bound(false), _method_blocks( NULL), - _method_data( NULL) + _method_data( NULL), + _has_injected_profile( false) #if defined(COMPILER2) || defined(SHARK) , _flow( NULL), diff --git a/hotspot/src/share/vm/ci/ciMethod.hpp b/hotspot/src/share/vm/ci/ciMethod.hpp index 5a46fc483c9..76662089bd8 100644 --- a/hotspot/src/share/vm/ci/ciMethod.hpp +++ b/hotspot/src/share/vm/ci/ciMethod.hpp @@ -79,6 +79,7 @@ class ciMethod : public ciMetadata { bool _is_c1_compilable; bool _is_c2_compilable; bool _can_be_statically_bound; + bool _has_injected_profile; // Lazy fields, filled in on demand address _code; @@ -286,6 +287,9 @@ class ciMethod : public ciMetadata { int instructions_size(); int scale_count(int count, float prof_factor = 1.); // make MDO count commensurate with IIC + bool has_injected_profile() const { return _has_injected_profile; } + void set_injected_profile(bool x) { _has_injected_profile = x; } + // Stack walking support bool is_ignored_by_security_stack_walk() const; diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index f80d0fcc00e..13449eef879 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -62,6 +62,7 @@ #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" #include "utilities/ostream.hpp" +#include "utilities/resourceHash.hpp" #if INCLUDE_CDS #include "classfile/systemDictionaryShared.hpp" #endif @@ -693,7 +694,6 @@ void ClassFileParser::patch_constant_pool(constantPoolHandle cp, int index, Hand } - class NameSigHash: public ResourceObj { public: Symbol* _name; // name @@ -1370,6 +1370,33 @@ void ClassFileParser::parse_linenumber_table( } +class LVT_Hash : public AllStatic { + public: + + static bool equals(LocalVariableTableElement const& e0, LocalVariableTableElement const& e1) { + /* + * 3-tuple start_bci/length/slot has to be unique key, + * so the following comparison seems to be redundant: + * && elem->name_cp_index == entry->_elem->name_cp_index + */ + return (e0.start_bci == e1.start_bci && + e0.length == e1.length && + e0.name_cp_index == e1.name_cp_index && + e0.slot == e1.slot); + } + + static unsigned int hash(LocalVariableTableElement const& e0) { + unsigned int raw_hash = e0.start_bci; + + raw_hash = e0.length + raw_hash * 37; + raw_hash = e0.name_cp_index + raw_hash * 37; + raw_hash = e0.slot + raw_hash * 37; + + return raw_hash; + } +}; + + // Class file LocalVariableTable elements. class Classfile_LVT_Element VALUE_OBJ_CLASS_SPEC { public: @@ -1380,88 +1407,6 @@ class Classfile_LVT_Element VALUE_OBJ_CLASS_SPEC { u2 slot; }; - -class LVT_Hash: public CHeapObj { - public: - LocalVariableTableElement *_elem; // element - LVT_Hash* _next; // Next entry in hash table -}; - -unsigned int hash(LocalVariableTableElement *elem) { - unsigned int raw_hash = elem->start_bci; - - raw_hash = elem->length + raw_hash * 37; - raw_hash = elem->name_cp_index + raw_hash * 37; - raw_hash = elem->slot + raw_hash * 37; - - return raw_hash % HASH_ROW_SIZE; -} - -void initialize_hashtable(LVT_Hash** table) { - for (int i = 0; i < HASH_ROW_SIZE; i++) { - table[i] = NULL; - } -} - -void clear_hashtable(LVT_Hash** table) { - for (int i = 0; i < HASH_ROW_SIZE; i++) { - LVT_Hash* current = table[i]; - LVT_Hash* next; - while (current != NULL) { - next = current->_next; - current->_next = NULL; - delete(current); - current = next; - } - table[i] = NULL; - } -} - -LVT_Hash* LVT_lookup(LocalVariableTableElement *elem, int index, LVT_Hash** table) { - LVT_Hash* entry = table[index]; - - /* - * 3-tuple start_bci/length/slot has to be unique key, - * so the following comparison seems to be redundant: - * && elem->name_cp_index == entry->_elem->name_cp_index - */ - while (entry != NULL) { - if (elem->start_bci == entry->_elem->start_bci - && elem->length == entry->_elem->length - && elem->name_cp_index == entry->_elem->name_cp_index - && elem->slot == entry->_elem->slot - ) { - return entry; - } - entry = entry->_next; - } - return NULL; -} - -// Return false if the local variable is found in table. -// Return true if no duplicate is found. -// And local variable is added as a new entry in table. -bool LVT_put_after_lookup(LocalVariableTableElement *elem, LVT_Hash** table) { - // First lookup for duplicates - int index = hash(elem); - LVT_Hash* entry = LVT_lookup(elem, index, table); - - if (entry != NULL) { - return false; - } - // No duplicate is found, allocate a new entry and fill it. - if ((entry = new LVT_Hash()) == NULL) { - return false; - } - entry->_elem = elem; - - // Insert into hash table - entry->_next = table[index]; - table[index] = entry; - - return true; -} - void copy_lvt_element(Classfile_LVT_Element *src, LocalVariableTableElement *lvt) { lvt->start_bci = Bytes::get_Java_u2((u1*) &src->start_bci); lvt->length = Bytes::get_Java_u2((u1*) &src->length); @@ -1861,8 +1806,12 @@ void ClassFileParser::copy_localvariable_table(ConstMethod* cm, u2** localvariable_type_table_start, TRAPS) { - LVT_Hash** lvt_Hash = NEW_RESOURCE_ARRAY(LVT_Hash*, HASH_ROW_SIZE); - initialize_hashtable(lvt_Hash); + ResourceMark rm(THREAD); + + typedef ResourceHashtable LVT_HashTable; + + LVT_HashTable* table = new LVT_HashTable(); // To fill LocalVariableTable in Classfile_LVT_Element* cf_lvt; @@ -1872,11 +1821,10 @@ void ClassFileParser::copy_localvariable_table(ConstMethod* cm, cf_lvt = (Classfile_LVT_Element *) localvariable_table_start[tbl_no]; for (int idx = 0; idx < localvariable_table_length[tbl_no]; idx++, lvt++) { copy_lvt_element(&cf_lvt[idx], lvt); - // If no duplicates, add LVT elem in hashtable lvt_Hash. - if (LVT_put_after_lookup(lvt, lvt_Hash) == false + // If no duplicates, add LVT elem in hashtable. + if (table->put(*lvt, lvt) == false && _need_verify && _major_version >= JAVA_1_5_VERSION) { - clear_hashtable(lvt_Hash); classfile_parse_error("Duplicated LocalVariableTable attribute " "entry for '%s' in class file %s", _cp->symbol_at(lvt->name_cp_index)->as_utf8(), @@ -1893,29 +1841,25 @@ void ClassFileParser::copy_localvariable_table(ConstMethod* cm, cf_lvtt = (Classfile_LVT_Element *) localvariable_type_table_start[tbl_no]; for (int idx = 0; idx < localvariable_type_table_length[tbl_no]; idx++) { copy_lvt_element(&cf_lvtt[idx], &lvtt_elem); - int index = hash(&lvtt_elem); - LVT_Hash* entry = LVT_lookup(&lvtt_elem, index, lvt_Hash); + LocalVariableTableElement** entry = table->get(lvtt_elem); if (entry == NULL) { if (_need_verify) { - clear_hashtable(lvt_Hash); classfile_parse_error("LVTT entry for '%s' in class file %s " "does not match any LVT entry", _cp->symbol_at(lvtt_elem.name_cp_index)->as_utf8(), CHECK); } - } else if (entry->_elem->signature_cp_index != 0 && _need_verify) { - clear_hashtable(lvt_Hash); + } else if ((*entry)->signature_cp_index != 0 && _need_verify) { classfile_parse_error("Duplicated LocalVariableTypeTable attribute " "entry for '%s' in class file %s", _cp->symbol_at(lvtt_elem.name_cp_index)->as_utf8(), CHECK); } else { // to add generic signatures into LocalVariableTable - entry->_elem->signature_cp_index = lvtt_elem.descriptor_cp_index; + (*entry)->signature_cp_index = lvtt_elem.descriptor_cp_index; } } } - clear_hashtable(lvt_Hash); } diff --git a/hotspot/src/share/vm/classfile/compactHashtable.cpp b/hotspot/src/share/vm/classfile/compactHashtable.cpp index 157b1681425..bd197554293 100644 --- a/hotspot/src/share/vm/classfile/compactHashtable.cpp +++ b/hotspot/src/share/vm/classfile/compactHashtable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -221,6 +221,30 @@ template const char* CompactHashtable::init(const char* return (const char*)end; } +template void CompactHashtable::symbols_do(SymbolClosure *cl) { + assert(!DumpSharedSpaces, "run-time only"); + for (juint i = 0; i < _bucket_count; i ++) { + juint bucket_info = _buckets[i]; + juint bucket_offset = BUCKET_OFFSET(bucket_info); + int bucket_type = BUCKET_TYPE(bucket_info); + juint* bucket = _buckets + bucket_offset; + juint* bucket_end = _buckets; + + Symbol* sym; + if (bucket_type == COMPACT_BUCKET_TYPE) { + sym = (Symbol*)((void*)(_base_address + bucket[0])); + cl->do_symbol(&sym); + } else { + bucket_end += BUCKET_OFFSET(_buckets[i + 1]); + while (bucket < bucket_end) { + sym = (Symbol*)((void*)(_base_address + bucket[1])); + cl->do_symbol(&sym); + bucket += 2; + } + } + } +} + // Explicitly instantiate these types template class CompactHashtable; diff --git a/hotspot/src/share/vm/classfile/compactHashtable.hpp b/hotspot/src/share/vm/classfile/compactHashtable.hpp index ac01fa7114b..28149643727 100644 --- a/hotspot/src/share/vm/classfile/compactHashtable.hpp +++ b/hotspot/src/share/vm/classfile/compactHashtable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -188,6 +188,7 @@ public: // dump time. // template class CompactHashtable VALUE_OBJ_CLASS_SPEC { + friend class VMStructs; uintx _base_address; juint _entry_count; juint _bucket_count; @@ -249,6 +250,9 @@ public: } return NULL; } + + // iterate over symbols + void symbols_do(SymbolClosure *cl); }; //////////////////////////////////////////////////////////////////////// diff --git a/hotspot/src/share/vm/classfile/symbolTable.cpp b/hotspot/src/share/vm/classfile/symbolTable.cpp index 4df696f74c7..3d08364be82 100644 --- a/hotspot/src/share/vm/classfile/symbolTable.cpp +++ b/hotspot/src/share/vm/classfile/symbolTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -82,6 +82,10 @@ void SymbolTable::initialize_symbols(int arena_alloc_size) { // Call function for all symbols in the symbol table. void SymbolTable::symbols_do(SymbolClosure *cl) { + // all symbols from shared table + _shared_table.symbols_do(cl); + + // all symbols from the dynamic table const int n = the_table()->table_size(); for (int i = 0; i < n; i++) { for (HashtableEntry* p = the_table()->bucket(i); diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp index 3e2589ef3c5..ca1b6b477cd 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.cpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp @@ -1905,11 +1905,12 @@ void SystemDictionary::initialize_preloaded_classes(TRAPS) { InstanceKlass::cast(WK_KLASS(Reference_klass))->set_reference_type(REF_OTHER); InstanceRefKlass::update_nonstatic_oop_maps(WK_KLASS(Reference_klass)); - initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(PhantomReference_klass), scan, CHECK); + initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Cleaner_klass), scan, CHECK); InstanceKlass::cast(WK_KLASS(SoftReference_klass))->set_reference_type(REF_SOFT); InstanceKlass::cast(WK_KLASS(WeakReference_klass))->set_reference_type(REF_WEAK); InstanceKlass::cast(WK_KLASS(FinalReference_klass))->set_reference_type(REF_FINAL); InstanceKlass::cast(WK_KLASS(PhantomReference_klass))->set_reference_type(REF_PHANTOM); + InstanceKlass::cast(WK_KLASS(Cleaner_klass))->set_reference_type(REF_CLEANER); // JSR 292 classes WKID jsr292_group_start = WK_KLASS_ENUM_NAME(MethodHandle_klass); diff --git a/hotspot/src/share/vm/classfile/systemDictionary.hpp b/hotspot/src/share/vm/classfile/systemDictionary.hpp index fd371bfb45d..a558e6479cd 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.hpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp @@ -128,6 +128,7 @@ class Ticks; do_klass(WeakReference_klass, java_lang_ref_WeakReference, Pre ) \ do_klass(FinalReference_klass, java_lang_ref_FinalReference, Pre ) \ do_klass(PhantomReference_klass, java_lang_ref_PhantomReference, Pre ) \ + do_klass(Cleaner_klass, sun_misc_Cleaner, Pre ) \ do_klass(Finalizer_klass, java_lang_ref_Finalizer, Pre ) \ \ do_klass(Thread_klass, java_lang_Thread, Pre ) \ diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index 679d70de021..aaf33d55079 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -1546,23 +1546,28 @@ void ClassVerifier::verify_method(methodHandle m, TRAPS) { no_control_flow = true; break; case Bytecodes::_getstatic : case Bytecodes::_putstatic : + // pass TRUE, operand can be an array type for getstatic/putstatic. + verify_field_instructions( + &bcs, ¤t_frame, cp, true, CHECK_VERIFY(this)); + no_control_flow = false; break; case Bytecodes::_getfield : case Bytecodes::_putfield : + // pass FALSE, operand can't be an array type for getfield/putfield. verify_field_instructions( - &bcs, ¤t_frame, cp, CHECK_VERIFY(this)); + &bcs, ¤t_frame, cp, false, CHECK_VERIFY(this)); no_control_flow = false; break; case Bytecodes::_invokevirtual : case Bytecodes::_invokespecial : case Bytecodes::_invokestatic : verify_invoke_instructions( - &bcs, code_length, ¤t_frame, - &this_uninit, return_type, cp, CHECK_VERIFY(this)); + &bcs, code_length, ¤t_frame, (bci >= ex_min && bci < ex_max), + &this_uninit, return_type, cp, &stackmap_table, CHECK_VERIFY(this)); no_control_flow = false; break; case Bytecodes::_invokeinterface : case Bytecodes::_invokedynamic : verify_invoke_instructions( - &bcs, code_length, ¤t_frame, - &this_uninit, return_type, cp, CHECK_VERIFY(this)); + &bcs, code_length, ¤t_frame, (bci >= ex_min && bci < ex_max), + &this_uninit, return_type, cp, &stackmap_table, CHECK_VERIFY(this)); no_control_flow = false; break; case Bytecodes::_new : { @@ -1945,7 +1950,7 @@ bool ClassVerifier::is_protected_access(instanceKlassHandle this_class, InstanceKlass* target_instance = InstanceKlass::cast(target_class); fieldDescriptor fd; if (is_method) { - Method* m = target_instance->uncached_lookup_method(field_name, field_sig, Klass::normal); + Method* m = target_instance->uncached_lookup_method(field_name, field_sig, Klass::find_overpass); if (m != NULL && m->is_protected()) { if (!this_class->is_same_class_package(m->method_holder())) { return true; @@ -2107,6 +2112,7 @@ bool ClassVerifier::name_in_supers( void ClassVerifier::verify_field_instructions(RawBytecodeStream* bcs, StackMapFrame* current_frame, constantPoolHandle cp, + bool allow_arrays, TRAPS) { u2 index = bcs->get_index_u2(); verify_cp_type(bcs->bci(), index, cp, @@ -2126,8 +2132,8 @@ void ClassVerifier::verify_field_instructions(RawBytecodeStream* bcs, // Get referenced class type VerificationType ref_class_type = cp_ref_index_to_type( index, cp, CHECK_VERIFY(this)); - if (!ref_class_type.is_object()) { - /* Unreachable? Class file parser verifies Fieldref contents */ + if (!ref_class_type.is_object() && + (!allow_arrays || !ref_class_type.is_array())) { verify_error(ErrorContext::bad_type(bcs->bci(), TypeOrigin::cp(index, ref_class_type)), "Expecting reference to class in class %s at constant pool index %d", @@ -2406,8 +2412,9 @@ bool ClassVerifier::ends_in_athrow(u4 start_bc_offset) { void ClassVerifier::verify_invoke_init( RawBytecodeStream* bcs, u2 ref_class_index, VerificationType ref_class_type, - StackMapFrame* current_frame, u4 code_length, bool *this_uninit, - constantPoolHandle cp, TRAPS) { + StackMapFrame* current_frame, u4 code_length, bool in_try_block, + bool *this_uninit, constantPoolHandle cp, StackMapTable* stackmap_table, + TRAPS) { u2 bci = bcs->bci(); VerificationType type = current_frame->pop_stack( VerificationType::reference_check(), CHECK_VERIFY(this)); @@ -2423,28 +2430,36 @@ void ClassVerifier::verify_invoke_init( return; } - // Check if this call is done from inside of a TRY block. If so, make - // sure that all catch clause paths end in a throw. Otherwise, this - // can result in returning an incomplete object. - ExceptionTable exhandlers(_method()); - int exlength = exhandlers.length(); - for(int i = 0; i < exlength; i++) { - u2 start_pc = exhandlers.start_pc(i); - u2 end_pc = exhandlers.end_pc(i); + // If this invokespecial call is done from inside of a TRY block then make + // sure that all catch clause paths end in a throw. Otherwise, this can + // result in returning an incomplete object. + if (in_try_block) { + ExceptionTable exhandlers(_method()); + int exlength = exhandlers.length(); + for(int i = 0; i < exlength; i++) { + u2 start_pc = exhandlers.start_pc(i); + u2 end_pc = exhandlers.end_pc(i); - if (bci >= start_pc && bci < end_pc) { - if (!ends_in_athrow(exhandlers.handler_pc(i))) { - verify_error(ErrorContext::bad_code(bci), - "Bad method call from after the start of a try block"); - return; - } else if (VerboseVerification) { - ResourceMark rm; - tty->print_cr( - "Survived call to ends_in_athrow(): %s", - current_class()->name()->as_C_string()); + if (bci >= start_pc && bci < end_pc) { + if (!ends_in_athrow(exhandlers.handler_pc(i))) { + verify_error(ErrorContext::bad_code(bci), + "Bad method call from after the start of a try block"); + return; + } else if (VerboseVerification) { + ResourceMark rm; + tty->print_cr( + "Survived call to ends_in_athrow(): %s", + current_class()->name()->as_C_string()); + } } } - } + + // Check the exception handler target stackmaps with the locals from the + // incoming stackmap (before initialize_object() changes them to outgoing + // state). + verify_exception_handler_targets(bci, true, current_frame, + stackmap_table, CHECK_VERIFY(this)); + } // in_try_block current_frame->initialize_object(type, current_type()); *this_uninit = true; @@ -2481,7 +2496,7 @@ void ClassVerifier::verify_invoke_init( Method* m = InstanceKlass::cast(ref_klass)->uncached_lookup_method( vmSymbols::object_initializer_name(), cp->signature_ref_at(bcs->get_index_u2()), - Klass::normal); + Klass::find_overpass); // Do nothing if method is not found. Let resolution detect the error. if (m != NULL) { instanceKlassHandle mh(THREAD, m->method_holder()); @@ -2498,6 +2513,13 @@ void ClassVerifier::verify_invoke_init( } } } + // Check the exception handler target stackmaps with the locals from the + // incoming stackmap (before initialize_object() changes them to outgoing + // state). + if (in_try_block) { + verify_exception_handler_targets(bci, *this_uninit, current_frame, + stackmap_table, CHECK_VERIFY(this)); + } current_frame->initialize_object(type, new_class_type); } else { verify_error(ErrorContext::bad_type(bci, current_frame->stack_top_ctx()), @@ -2526,8 +2548,8 @@ bool ClassVerifier::is_same_or_direct_interface( void ClassVerifier::verify_invoke_instructions( RawBytecodeStream* bcs, u4 code_length, StackMapFrame* current_frame, - bool *this_uninit, VerificationType return_type, - constantPoolHandle cp, TRAPS) { + bool in_try_block, bool *this_uninit, VerificationType return_type, + constantPoolHandle cp, StackMapTable* stackmap_table, TRAPS) { // Make sure the constant pool item is the right type u2 index = bcs->get_index_u2(); Bytecodes::Code opcode = bcs->raw_code(); @@ -2693,7 +2715,8 @@ void ClassVerifier::verify_invoke_instructions( opcode != Bytecodes::_invokedynamic) { if (method_name == vmSymbols::object_initializer_name()) { // method verify_invoke_init(bcs, index, ref_class_type, current_frame, - code_length, this_uninit, cp, CHECK_VERIFY(this)); + code_length, in_try_block, this_uninit, cp, stackmap_table, + CHECK_VERIFY(this)); } else { // other methods // Ensures that target class is assignable to method class. if (opcode == Bytecodes::_invokespecial) { diff --git a/hotspot/src/share/vm/classfile/verifier.hpp b/hotspot/src/share/vm/classfile/verifier.hpp index ed9a173b187..113e404e42e 100644 --- a/hotspot/src/share/vm/classfile/verifier.hpp +++ b/hotspot/src/share/vm/classfile/verifier.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -297,12 +297,13 @@ class ClassVerifier : public StackObj { void verify_field_instructions( RawBytecodeStream* bcs, StackMapFrame* current_frame, - constantPoolHandle cp, TRAPS); + constantPoolHandle cp, bool allow_arrays, TRAPS); void verify_invoke_init( RawBytecodeStream* bcs, u2 ref_index, VerificationType ref_class_type, - StackMapFrame* current_frame, u4 code_length, bool* this_uninit, - constantPoolHandle cp, TRAPS); + StackMapFrame* current_frame, u4 code_length, bool in_try_block, + bool* this_uninit, constantPoolHandle cp, StackMapTable* stackmap_table, + TRAPS); // Used by ends_in_athrow() to push all handlers that contain bci onto // the handler_stack, if the handler is not already on the stack. @@ -316,8 +317,8 @@ class ClassVerifier : public StackObj { void verify_invoke_instructions( RawBytecodeStream* bcs, u4 code_length, StackMapFrame* current_frame, - bool* this_uninit, VerificationType return_type, - constantPoolHandle cp, TRAPS); + bool in_try_block, bool* this_uninit, VerificationType return_type, + constantPoolHandle cp, StackMapTable* stackmap_table, TRAPS); VerificationType get_newarray_type(u2 index, u2 bci, TRAPS); void verify_anewarray(u2 bci, u2 index, constantPoolHandle cp, diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index d6a84b75af0..64e717bbc10 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -79,6 +79,7 @@ template(java_lang_ref_WeakReference, "java/lang/ref/WeakReference") \ template(java_lang_ref_FinalReference, "java/lang/ref/FinalReference") \ template(java_lang_ref_PhantomReference, "java/lang/ref/PhantomReference") \ + template(sun_misc_Cleaner, "sun/misc/Cleaner") \ template(java_lang_ref_Finalizer, "java/lang/ref/Finalizer") \ template(java_lang_reflect_AccessibleObject, "java/lang/reflect/AccessibleObject") \ template(java_lang_reflect_Method, "java/lang/reflect/Method") \ @@ -242,7 +243,6 @@ template(returnType_name, "returnType") \ template(signature_name, "signature") \ template(slot_name, "slot") \ - template(selectAlternative_name, "selectAlternative") \ \ /* Support for annotations (JDK 1.5 and above) */ \ \ @@ -294,8 +294,7 @@ template(setTarget_signature, "(Ljava/lang/invoke/MethodHandle;)V") \ NOT_LP64( do_alias(intptr_signature, int_signature) ) \ LP64_ONLY( do_alias(intptr_signature, long_signature) ) \ - template(selectAlternative_signature, "(ZLjava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodHandle;)Ljava/lang/invoke/MethodHandle;") \ - \ + \ /* common method and field names */ \ template(object_initializer_name, "") \ template(class_initializer_name, "") \ @@ -867,6 +866,12 @@ do_name( fullFence_name, "fullFence") \ do_alias( fullFence_signature, void_method_signature) \ \ + /* Custom branch frequencies profiling support for JSR292 */ \ + do_class(java_lang_invoke_MethodHandleImpl, "java/lang/invoke/MethodHandleImpl") \ + do_intrinsic(_profileBoolean, java_lang_invoke_MethodHandleImpl, profileBoolean_name, profileBoolean_signature, F_S) \ + do_name( profileBoolean_name, "profileBoolean") \ + do_signature(profileBoolean_signature, "(Z[I)Z") \ + \ /* unsafe memory references (there are a lot of them...) */ \ do_signature(getObject_signature, "(Ljava/lang/Object;J)Ljava/lang/Object;") \ do_signature(putObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;)V") \ @@ -1016,18 +1021,6 @@ do_intrinsic(_getAndSetObject, sun_misc_Unsafe, getAndSetObject_name, getAndSetObject_signature, F_R)\ do_name( getAndSetObject_name, "getAndSetObject") \ do_signature(getAndSetObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;" ) \ - \ - /* prefetch_signature is shared by all prefetch variants */ \ - do_signature( prefetch_signature, "(Ljava/lang/Object;J)V") \ - \ - do_intrinsic(_prefetchRead, sun_misc_Unsafe, prefetchRead_name, prefetch_signature, F_RN) \ - do_name( prefetchRead_name, "prefetchRead") \ - do_intrinsic(_prefetchWrite, sun_misc_Unsafe, prefetchWrite_name, prefetch_signature, F_RN) \ - do_name( prefetchWrite_name, "prefetchWrite") \ - do_intrinsic(_prefetchReadStatic, sun_misc_Unsafe, prefetchReadStatic_name, prefetch_signature, F_SN) \ - do_name( prefetchReadStatic_name, "prefetchReadStatic") \ - do_intrinsic(_prefetchWriteStatic, sun_misc_Unsafe, prefetchWriteStatic_name, prefetch_signature, F_SN) \ - do_name( prefetchWriteStatic_name, "prefetchWriteStatic") \ /*== LAST_COMPILER_INLINE*/ \ /*the compiler does have special inlining code for these; bytecode inline is just fine */ \ \ @@ -1202,7 +1195,7 @@ class vmIntrinsics: AllStatic { #undef VM_INTRINSIC_ENUM ID_LIMIT, - LAST_COMPILER_INLINE = _prefetchWriteStatic, + LAST_COMPILER_INLINE = _getAndSetObject, FIRST_MH_SIG_POLY = _invokeGeneric, FIRST_MH_STATIC = _linkToVirtual, LAST_MH_SIG_POLY = _linkToInterface, diff --git a/hotspot/src/share/vm/code/codeCache.cpp b/hotspot/src/share/vm/code/codeCache.cpp index af50207fbbf..1d43669209e 100644 --- a/hotspot/src/share/vm/code/codeCache.cpp +++ b/hotspot/src/share/vm/code/codeCache.cpp @@ -199,15 +199,10 @@ void CodeCache::initialize_heaps() { } guarantee(NonProfiledCodeHeapSize + ProfiledCodeHeapSize + NonNMethodCodeHeapSize <= ReservedCodeCacheSize, "Size check"); - // Align reserved sizes of CodeHeaps - size_t non_method_size = ReservedCodeSpace::allocation_align_size_up(NonNMethodCodeHeapSize); - size_t profiled_size = ReservedCodeSpace::allocation_align_size_up(ProfiledCodeHeapSize); - size_t non_profiled_size = ReservedCodeSpace::allocation_align_size_up(NonProfiledCodeHeapSize); - - // Compute initial sizes of CodeHeaps - size_t init_non_method_size = MIN2(InitialCodeCacheSize, non_method_size); - size_t init_profiled_size = MIN2(InitialCodeCacheSize, profiled_size); - size_t init_non_profiled_size = MIN2(InitialCodeCacheSize, non_profiled_size); + // Align CodeHeaps + size_t alignment = heap_alignment(); + size_t non_method_size = align_size_up(NonNMethodCodeHeapSize, alignment); + size_t profiled_size = align_size_down(ProfiledCodeHeapSize, alignment); // Reserve one continuous chunk of memory for CodeHeaps and split it into // parts for the individual heaps. The memory layout looks like this: @@ -216,25 +211,34 @@ void CodeCache::initialize_heaps() { // Profiled nmethods // Non-nmethods // ---------- low ------------ - ReservedCodeSpace rs = reserve_heap_memory(non_profiled_size + profiled_size + non_method_size); + ReservedCodeSpace rs = reserve_heap_memory(ReservedCodeCacheSize); ReservedSpace non_method_space = rs.first_part(non_method_size); ReservedSpace rest = rs.last_part(non_method_size); ReservedSpace profiled_space = rest.first_part(profiled_size); ReservedSpace non_profiled_space = rest.last_part(profiled_size); // Non-nmethods (stubs, adapters, ...) - add_heap(non_method_space, "CodeHeap 'non-nmethods'", init_non_method_size, CodeBlobType::NonNMethod); + add_heap(non_method_space, "CodeHeap 'non-nmethods'", CodeBlobType::NonNMethod); // Tier 2 and tier 3 (profiled) methods - add_heap(profiled_space, "CodeHeap 'profiled nmethods'", init_profiled_size, CodeBlobType::MethodProfiled); + add_heap(profiled_space, "CodeHeap 'profiled nmethods'", CodeBlobType::MethodProfiled); // Tier 1 and tier 4 (non-profiled) methods and native methods - add_heap(non_profiled_space, "CodeHeap 'non-profiled nmethods'", init_non_profiled_size, CodeBlobType::MethodNonProfiled); + add_heap(non_profiled_space, "CodeHeap 'non-profiled nmethods'", CodeBlobType::MethodNonProfiled); +} + +size_t CodeCache::heap_alignment() { + // If large page support is enabled, align code heaps according to large + // page size to make sure that code cache is covered by large pages. + const size_t page_size = os::can_execute_large_page_memory() ? + os::page_size_for_region_unaligned(ReservedCodeCacheSize, 8) : + os::vm_page_size(); + return MAX2(page_size, (size_t) os::vm_allocation_granularity()); } ReservedCodeSpace CodeCache::reserve_heap_memory(size_t size) { // Determine alignment const size_t page_size = os::can_execute_large_page_memory() ? - MIN2(os::page_size_for_region(InitialCodeCacheSize, 8), - os::page_size_for_region(size, 8)) : + MIN2(os::page_size_for_region_aligned(InitialCodeCacheSize, 8), + os::page_size_for_region_aligned(size, 8)) : os::vm_page_size(); const size_t granularity = os::vm_allocation_granularity(); const size_t r_align = MAX2(page_size, granularity); @@ -284,7 +288,7 @@ const char* CodeCache::get_code_heap_flag_name(int code_blob_type) { return NULL; } -void CodeCache::add_heap(ReservedSpace rs, const char* name, size_t size_initial, int code_blob_type) { +void CodeCache::add_heap(ReservedSpace rs, const char* name, int code_blob_type) { // Check if heap is needed if (!heap_available(code_blob_type)) { return; @@ -295,8 +299,8 @@ void CodeCache::add_heap(ReservedSpace rs, const char* name, size_t size_initial _heaps->append(heap); // Reserve Space + size_t size_initial = MIN2(InitialCodeCacheSize, rs.size()); size_initial = round_to(size_initial, os::vm_page_size()); - if (!heap->reserve(rs, size_initial, CodeCacheSegmentSize)) { vm_exit_during_initialization("Could not reserve enough space for code cache"); } @@ -840,7 +844,7 @@ void CodeCache::initialize() { } else { // Use a single code heap ReservedCodeSpace rs = reserve_heap_memory(ReservedCodeCacheSize); - add_heap(rs, "CodeCache", InitialCodeCacheSize, CodeBlobType::All); + add_heap(rs, "CodeCache", CodeBlobType::All); } // Initialize ICache flush mechanism diff --git a/hotspot/src/share/vm/code/codeCache.hpp b/hotspot/src/share/vm/code/codeCache.hpp index 287c531a4de..d682f90c5b2 100644 --- a/hotspot/src/share/vm/code/codeCache.hpp +++ b/hotspot/src/share/vm/code/codeCache.hpp @@ -98,12 +98,13 @@ class CodeCache : AllStatic { // CodeHeap management static void initialize_heaps(); // Initializes the CodeHeaps // Creates a new heap with the given name and size, containing CodeBlobs of the given type - static void add_heap(ReservedSpace rs, const char* name, size_t size_initial, int code_blob_type); + static void add_heap(ReservedSpace rs, const char* name, int code_blob_type); static CodeHeap* get_code_heap(const CodeBlob* cb); // Returns the CodeHeap for the given CodeBlob static CodeHeap* get_code_heap(int code_blob_type); // Returns the CodeHeap for the given CodeBlobType // Returns the name of the VM option to set the size of the corresponding CodeHeap static const char* get_code_heap_flag_name(int code_blob_type); static bool heap_available(int code_blob_type); // Returns true if an own CodeHeap for the given CodeBlobType is available + static size_t heap_alignment(); // Returns the alignment of the CodeHeaps in bytes static ReservedCodeSpace reserve_heap_memory(size_t size); // Reserves one continuous chunk of memory for the CodeHeaps // Iteration diff --git a/hotspot/src/share/vm/code/dependencies.cpp b/hotspot/src/share/vm/code/dependencies.cpp index fbefd4a9b1e..eebbf78be6d 100644 --- a/hotspot/src/share/vm/code/dependencies.cpp +++ b/hotspot/src/share/vm/code/dependencies.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -560,7 +560,7 @@ void Dependencies::print_dependency(DepType dept, GrowableArray* ar put_star = !Dependencies::is_concrete_klass((Klass*)arg.metadata_value()); } else if (arg.is_method()) { what = "method "; - put_star = !Dependencies::is_concrete_method((Method*)arg.metadata_value()); + put_star = !Dependencies::is_concrete_method((Method*)arg.metadata_value(), NULL); } else if (arg.is_klass()) { what = "class "; } else { @@ -878,8 +878,8 @@ class ClassHierarchyWalker { // Static methods don't override non-static so punt return true; } - if ( !Dependencies::is_concrete_method(lm) - && !Dependencies::is_concrete_method(m) + if ( !Dependencies::is_concrete_method(lm, k) + && !Dependencies::is_concrete_method(m, ctxk) && lm->method_holder()->is_subtype_of(m->method_holder())) // Method m is overridden by lm, but both are non-concrete. return true; @@ -915,8 +915,17 @@ class ClassHierarchyWalker { } else if (!k->oop_is_instance()) { return false; // no methods to find in an array type } else { - Method* m = InstanceKlass::cast(k)->find_method(_name, _signature); - if (m == NULL || !Dependencies::is_concrete_method(m)) return false; + // Search class hierarchy first. + Method* m = InstanceKlass::cast(k)->find_instance_method(_name, _signature); + if (!Dependencies::is_concrete_method(m, k)) { + // Check interface defaults also, if any exist. + Array* default_methods = InstanceKlass::cast(k)->default_methods(); + if (default_methods == NULL) + return false; + m = InstanceKlass::cast(k)->find_method(default_methods, _name, _signature); + if (!Dependencies::is_concrete_method(m, NULL)) + return false; + } _found_methods[_num_participants] = m; // Note: If add_participant(k) is called, // the method m will already be memoized for it. @@ -1209,15 +1218,17 @@ bool Dependencies::is_concrete_klass(Klass* k) { return true; } -bool Dependencies::is_concrete_method(Method* m) { - // Statics are irrelevant to virtual call sites. - if (m->is_static()) return false; - - // We could also return false if m does not yet appear to be - // executed, if the VM version supports this distinction also. - // Default methods are considered "concrete" as well. - return !m->is_abstract() && - !m->is_overpass(); // error functions aren't concrete +bool Dependencies::is_concrete_method(Method* m, Klass * k) { + // NULL is not a concrete method, + // statics are irrelevant to virtual call sites, + // abstract methods are not concrete, + // overpass (error) methods are not concrete if k is abstract + // + // note "true" is conservative answer -- + // overpass clause is false if k == NULL, implies return true if + // answer depends on overpass clause. + return ! ( m == NULL || m -> is_static() || m -> is_abstract() || + m->is_overpass() && k != NULL && k -> is_abstract() ); } @@ -1242,16 +1253,6 @@ bool Dependencies::is_concrete_klass(ciInstanceKlass* k) { return true; } -bool Dependencies::is_concrete_method(ciMethod* m) { - // Statics are irrelevant to virtual call sites. - if (m->is_static()) return false; - - // We could also return false if m does not yet appear to be - // executed, if the VM version supports this distinction also. - return !m->is_abstract(); -} - - bool Dependencies::has_finalizable_subclass(ciInstanceKlass* k) { return k->has_finalizable_subclass(); } @@ -1469,7 +1470,7 @@ Method* Dependencies::find_unique_concrete_method(Klass* ctxk, Method* m) { Klass* wit = wf.find_witness_definer(ctxk); if (wit != NULL) return NULL; // Too many witnesses. Method* fm = wf.found_method(0); // Will be NULL if num_parts == 0. - if (Dependencies::is_concrete_method(m)) { + if (Dependencies::is_concrete_method(m, ctxk)) { if (fm == NULL) { // It turns out that m was always the only implementation. fm = m; @@ -1499,61 +1500,6 @@ Klass* Dependencies::check_exclusive_concrete_methods(Klass* ctxk, return wf.find_witness_definer(ctxk, changes); } -// Find the set of all non-abstract methods under ctxk that match m[0]. -// (The method m[0] must be defined or inherited in ctxk.) -// Include m itself in the set, unless it is abstract. -// Fill the given array m[0..(mlen-1)] with this set, and return the length. -// (The length may be zero if no concrete methods are found anywhere.) -// If there are too many concrete methods to fit in marray, return -1. -int Dependencies::find_exclusive_concrete_methods(Klass* ctxk, - int mlen, - Method* marray[]) { - Method* m0 = marray[0]; - ClassHierarchyWalker wf(m0); - assert(wf.check_method_context(ctxk, m0), "proper context"); - wf.record_witnesses(mlen); - bool participants_hide_witnesses = true; - Klass* wit = wf.find_witness_definer(ctxk); - if (wit != NULL) return -1; // Too many witnesses. - int num = wf.num_participants(); - assert(num <= mlen, "oob"); - // Keep track of whether m is also part of the result set. - int mfill = 0; - assert(marray[mfill] == m0, "sanity"); - if (Dependencies::is_concrete_method(m0)) - mfill++; // keep m0 as marray[0], the first result - for (int i = 0; i < num; i++) { - Method* fm = wf.found_method(i); - if (fm == m0) continue; // Already put this guy in the list. - if (mfill == mlen) { - return -1; // Oops. Too many methods after all! - } - marray[mfill++] = fm; - } -#ifndef PRODUCT - // Make sure the dependency mechanism will pass this discovery: - if (VerifyDependencies) { - // Turn off dependency tracing while actually testing deps. - FlagSetting fs(TraceDependencies, false); - switch (mfill) { - case 1: - guarantee(NULL == (void *)check_unique_concrete_method(ctxk, marray[0]), - "verify dep."); - break; - case 2: - guarantee(NULL == (void *) - check_exclusive_concrete_methods(ctxk, marray[0], marray[1]), - "verify dep."); - break; - default: - ShouldNotReachHere(); // mlen > 2 yet supported - } - } -#endif //PRODUCT - return mfill; -} - - Klass* Dependencies::check_has_no_finalizable_subclasses(Klass* ctxk, KlassDepChange* changes) { Klass* search_at = ctxk; if (changes != NULL) @@ -1561,7 +1507,6 @@ Klass* Dependencies::check_has_no_finalizable_subclasses(Klass* ctxk, KlassDepCh return find_finalizable_subclass(search_at); } - Klass* Dependencies::check_call_site_target_value(oop call_site, oop method_handle, CallSiteDepChange* changes) { assert(call_site ->is_a(SystemDictionary::CallSite_klass()), "sanity"); assert(method_handle->is_a(SystemDictionary::MethodHandle_klass()), "sanity"); diff --git a/hotspot/src/share/vm/code/dependencies.hpp b/hotspot/src/share/vm/code/dependencies.hpp index ff4ff328f8d..dee40b9beda 100644 --- a/hotspot/src/share/vm/code/dependencies.hpp +++ b/hotspot/src/share/vm/code/dependencies.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -288,7 +288,7 @@ class Dependencies: public ResourceObj { // In that case, there would be a middle ground between concrete // and abstract (as defined by the Java language and VM). static bool is_concrete_klass(Klass* k); // k is instantiable - static bool is_concrete_method(Method* m); // m is invocable + static bool is_concrete_method(Method* m, Klass* k); // m is invocable static Klass* find_finalizable_subclass(Klass* k); // These versions of the concreteness queries work through the CI. @@ -302,7 +302,6 @@ class Dependencies: public ResourceObj { // not go back into the VM to get their value; they must cache the // bit in the CI, either eagerly or lazily.) static bool is_concrete_klass(ciInstanceKlass* k); // k appears instantiable - static bool is_concrete_method(ciMethod* m); // m appears invocable static bool has_finalizable_subclass(ciInstanceKlass* k); // As a general rule, it is OK to compile under the assumption that @@ -349,7 +348,6 @@ class Dependencies: public ResourceObj { static Klass* find_unique_concrete_subtype(Klass* ctxk); static Method* find_unique_concrete_method(Klass* ctxk, Method* m); static int find_exclusive_concrete_subtypes(Klass* ctxk, int klen, Klass* k[]); - static int find_exclusive_concrete_methods(Klass* ctxk, int mlen, Method* m[]); // Create the encoding which will be stored in an nmethod. void encode_content_bytes(); diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 835b3dc831d..aaf0a113b11 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -477,9 +477,6 @@ void nmethod::init_defaults() { #if INCLUDE_RTM_OPT _rtm_state = NoRTM; #endif -#ifdef HAVE_DTRACE_H - _trap_offset = 0; -#endif // def HAVE_DTRACE_H } nmethod* nmethod::new_native_nmethod(methodHandle method, @@ -520,44 +517,6 @@ nmethod* nmethod::new_native_nmethod(methodHandle method, return nm; } -#ifdef HAVE_DTRACE_H -nmethod* nmethod::new_dtrace_nmethod(methodHandle method, - CodeBuffer *code_buffer, - int vep_offset, - int trap_offset, - int frame_complete, - int frame_size) { - code_buffer->finalize_oop_references(method); - // create nmethod - nmethod* nm = NULL; - { - MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - int nmethod_size = allocation_size(code_buffer, sizeof(nmethod)); - CodeOffsets offsets; - offsets.set_value(CodeOffsets::Verified_Entry, vep_offset); - offsets.set_value(CodeOffsets::Dtrace_trap, trap_offset); - offsets.set_value(CodeOffsets::Frame_Complete, frame_complete); - - nm = new (nmethod_size, CompLevel_none) nmethod(method(), nmethod_size, - &offsets, code_buffer, frame_size); - - NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_nmethod(nm)); - if (PrintAssembly && nm != NULL) { - Disassembler::decode(nm); - } - } - // verify nmethod - debug_only(if (nm) nm->verify();) // might block - - if (nm != NULL) { - nm->log_new_nmethod(); - } - - return nm; -} - -#endif // def HAVE_DTRACE_H - nmethod* nmethod::new_nmethod(methodHandle method, int compile_id, int entry_bci, @@ -718,91 +677,6 @@ nmethod::nmethod( } } -// For dtrace wrappers -#ifdef HAVE_DTRACE_H -nmethod::nmethod( - Method* method, - int nmethod_size, - CodeOffsets* offsets, - CodeBuffer* code_buffer, - int frame_size) - : CodeBlob("dtrace nmethod", code_buffer, sizeof(nmethod), - nmethod_size, offsets->value(CodeOffsets::Frame_Complete), frame_size, NULL), - _native_receiver_sp_offset(in_ByteSize(-1)), - _native_basic_lock_sp_offset(in_ByteSize(-1)) -{ - { - debug_only(No_Safepoint_Verifier nsv;) - assert_locked_or_safepoint(CodeCache_lock); - - init_defaults(); - _method = method; - _entry_bci = InvocationEntryBci; - // We have no exception handler or deopt handler make the - // values something that will never match a pc like the nmethod vtable entry - _exception_offset = 0; - _deoptimize_offset = 0; - _deoptimize_mh_offset = 0; - _unwind_handler_offset = -1; - _trap_offset = offsets->value(CodeOffsets::Dtrace_trap); - _orig_pc_offset = 0; - _consts_offset = data_offset(); - _stub_offset = data_offset(); - _oops_offset = data_offset(); - _metadata_offset = _oops_offset + round_to(code_buffer->total_oop_size(), oopSize); - _scopes_data_offset = _metadata_offset + round_to(code_buffer->total_metadata_size(), wordSize); - _scopes_pcs_offset = _scopes_data_offset; - _dependencies_offset = _scopes_pcs_offset; - _handler_table_offset = _dependencies_offset; - _nul_chk_table_offset = _handler_table_offset; - _nmethod_end_offset = _nul_chk_table_offset; - _compile_id = 0; // default - _comp_level = CompLevel_none; - _entry_point = code_begin() + offsets->value(CodeOffsets::Entry); - _verified_entry_point = code_begin() + offsets->value(CodeOffsets::Verified_Entry); - _osr_entry_point = NULL; - _exception_cache = NULL; - _pc_desc_cache.reset_to(NULL); - _hotness_counter = NMethodSweeper::hotness_counter_reset_val(); - - code_buffer->copy_values_to(this); - if (ScavengeRootsInCode) { - if (detect_scavenge_root_oops()) { - CodeCache::add_scavenge_root_nmethod(this); - } - Universe::heap()->register_nmethod(this); - } - DEBUG_ONLY(verify_scavenge_root_oops();) - CodeCache::commit(this); - } - - if (PrintNMethods || PrintDebugInfo || PrintRelocations || PrintDependencies) { - ttyLocker ttyl; // keep the following output all in one block - // This output goes directly to the tty, not the compiler log. - // To enable tools to match it up with the compilation activity, - // be sure to tag this tty output with the compile ID. - if (xtty != NULL) { - xtty->begin_head("print_dtrace_nmethod"); - xtty->method(_method); - xtty->stamp(); - xtty->end_head(" address='" INTPTR_FORMAT "'", (intptr_t) this); - } - // print the header part first - print(); - // then print the requested information - if (PrintNMethods) { - print_code(); - } - if (PrintRelocations) { - print_relocations(); - } - if (xtty != NULL) { - xtty->tail("print_dtrace_nmethod"); - } - } -} -#endif // def HAVE_DTRACE_H - void* nmethod::operator new(size_t size, int nmethod_size, int comp_level) throw () { return CodeCache::allocate(nmethod_size, CodeCache::get_code_blob_type(comp_level)); } @@ -2310,17 +2184,6 @@ void nmethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map #endif // !SHARK } - -oop nmethod::embeddedOop_at(u_char* p) { - RelocIterator iter(this, p, p + 1); - while (iter.next()) - if (iter.type() == relocInfo::oop_type) { - return iter.oop_reloc()->oop_value(); - } - return NULL; -} - - inline bool includes(void* p, void* from, void* to) { return from <= p && p < to; } diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index c95679649fd..66502f7198f 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -157,9 +157,6 @@ class nmethod : public CodeBlob { // Offset of the unwind handler if it exists int _unwind_handler_offset; -#ifdef HAVE_DTRACE_H - int _trap_offset; -#endif // def HAVE_DTRACE_H int _consts_offset; int _stub_offset; int _oops_offset; // offset to where embedded oop table begins (inside data) @@ -261,15 +258,6 @@ class nmethod : public CodeBlob { ByteSize basic_lock_sp_offset, /* synchronized natives only */ OopMapSet* oop_maps); -#ifdef HAVE_DTRACE_H - // For native wrappers - nmethod(Method* method, - int nmethod_size, - CodeOffsets* offsets, - CodeBuffer *code_buffer, - int frame_size); -#endif // def HAVE_DTRACE_H - // Creation support nmethod(Method* method, int nmethod_size, @@ -333,22 +321,6 @@ class nmethod : public CodeBlob { ByteSize basic_lock_sp_offset, OopMapSet* oop_maps); -#ifdef HAVE_DTRACE_H - // The method we generate for a dtrace probe has to look - // like an nmethod as far as the rest of the system is concerned - // which is somewhat unfortunate. - static nmethod* new_dtrace_nmethod(methodHandle method, - CodeBuffer *code_buffer, - int vep_offset, - int trap_offset, - int frame_complete, - int frame_size); - - int trap_offset() const { return _trap_offset; } - address trap_address() const { return insts_begin() + _trap_offset; } - -#endif // def HAVE_DTRACE_H - // accessors Method* method() const { return _method; } AbstractCompiler* compiler() const { return _compiler; } @@ -730,11 +702,6 @@ public: int compile_id() const { return _compile_id; } const char* compile_kind() const; - // For debugging - // CompiledIC* IC_at(char* p) const; - // PrimitiveIC* primitiveIC_at(char* p) const; - oop embeddedOop_at(address p); - // tells if any of this method's dependencies have been invalidated // (this is expensive!) static void check_all_dependencies(DepChange& changes); diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index 2b22da1f705..71b3fc5b3bf 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -252,7 +252,7 @@ CompileTask* CompileTask::allocate() { } else { task = new CompileTask(); DEBUG_ONLY(_num_allocated_tasks++;) - assert (_num_allocated_tasks < 10000, "Leaking compilation tasks?"); + assert (WhiteBoxAPI || _num_allocated_tasks < 10000, "Leaking compilation tasks?"); task->set_next(NULL); task->set_is_free(true); } @@ -1470,7 +1470,9 @@ bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci, // The method may be explicitly excluded by the user. bool quietly; - if (CompilerOracle::should_exclude(method, quietly)) { + double scale; + if (CompilerOracle::should_exclude(method, quietly) + || (CompilerOracle::has_option_value(method, "CompileThresholdScaling", scale) && scale == 0)) { if (!quietly) { // This does not happen quietly... ResourceMark rm; diff --git a/hotspot/src/share/vm/compiler/compilerOracle.cpp b/hotspot/src/share/vm/compiler/compilerOracle.cpp index b733305666b..8299da22f0f 100644 --- a/hotspot/src/share/vm/compiler/compilerOracle.cpp +++ b/hotspot/src/share/vm/compiler/compilerOracle.cpp @@ -105,7 +105,6 @@ class MethodMatcher : public CHeapObj { tty->print("."); print_symbol(method_name(), _method_mode); if (signature() != NULL) { - tty->print(" "); signature()->print_symbol_on(tty); } } @@ -467,43 +466,85 @@ static OracleCommand parse_command_name(const char * line, int* bytes_read) { return UnknownCommand; } - static void usage() { - tty->print_cr(" CompileCommand and the CompilerOracle allows simple control over"); - tty->print_cr(" what's allowed to be compiled. The standard supported directives"); - tty->print_cr(" are exclude and compileonly. The exclude directive stops a method"); - tty->print_cr(" from being compiled and compileonly excludes all methods except for"); - tty->print_cr(" the ones mentioned by compileonly directives. The basic form of"); - tty->print_cr(" all commands is a command name followed by the name of the method"); - tty->print_cr(" in one of two forms: the standard class file format as in"); - tty->print_cr(" class/name.methodName or the PrintCompilation format"); - tty->print_cr(" class.name::methodName. The method name can optionally be followed"); - tty->print_cr(" by a space then the signature of the method in the class file"); - tty->print_cr(" format. Otherwise the directive applies to all methods with the"); - tty->print_cr(" same name and class regardless of signature. Leading and trailing"); - tty->print_cr(" *'s in the class and/or method name allows a small amount of"); - tty->print_cr(" wildcarding. "); tty->cr(); - tty->print_cr(" Examples:"); + tty->print_cr("The CompileCommand option enables the user of the JVM to control specific"); + tty->print_cr("behavior of the dynamic compilers. Many commands require a pattern that defines"); + tty->print_cr("the set of methods the command shall be applied to. The CompileCommand"); + tty->print_cr("option provides the following commands:"); tty->cr(); - tty->print_cr(" exclude java/lang/StringBuffer.append"); - tty->print_cr(" compileonly java/lang/StringBuffer.toString ()Ljava/lang/String;"); - tty->print_cr(" exclude java/lang/String*.*"); - tty->print_cr(" exclude *.toString"); -} + tty->print_cr(" break, - debug breakpoint in compiler and in generated code"); + tty->print_cr(" print, - print assembly"); + tty->print_cr(" exclude, - don't compile or inline"); + tty->print_cr(" inline, - always inline"); + tty->print_cr(" dontinline, - don't inline"); + tty->print_cr(" compileonly, - compile only"); + tty->print_cr(" log, - log compilation"); + tty->print_cr(" option,,