# HG changeset patch # User jwilhelm # Date 1492540283 -7200 # Node ID 45deafa80e4f0eefcd441e633caf6b306cfb6e2b # Parent f113ce12fe24fbd24acf02711372d9f1e1c12426# Parent 177c44a7127362b8a8cff2c711f72b9a5294106f Merge diff -r f113ce12fe24 -r 45deafa80e4f common/autoconf/configure.ac --- a/common/autoconf/configure.ac Wed Jul 05 23:13:48 2017 +0200 +++ b/common/autoconf/configure.ac Tue Apr 18 20:31:23 2017 +0200 @@ -187,6 +187,9 @@ # Setup the JTReg Regression Test Harness. TOOLCHAIN_SETUP_JTREG +# Setup Jib dependency tool +TOOLCHAIN_SETUP_JIB + FLAGS_SETUP_INIT_FLAGS # Now we can test some aspects on the target using configure macros. diff -r f113ce12fe24 -r 45deafa80e4f common/autoconf/generated-configure.sh --- a/common/autoconf/generated-configure.sh Wed Jul 05 23:13:48 2017 +0200 +++ b/common/autoconf/generated-configure.sh Tue Apr 18 20:31:23 2017 +0200 @@ -663,8 +663,6 @@ JVM_FEATURES_client JVM_FEATURES_server INCLUDE_GRAAL -ELF_LIBS -ELF_CFLAGS STLPORT_LIB LIBZIP_CAN_USE_MMAP LIBDL @@ -788,6 +786,7 @@ COMPILER_BINDCMD_FILE_FLAG COMPILER_COMMAND_FILE_FLAG COMPILER_TARGET_BITS_FLAG +JIB_JAR JT_HOME JTREGEXE HOTSPOT_TOOLCHAIN_TYPE @@ -1177,6 +1176,7 @@ with_toolchain_version with_build_devkit with_jtreg +with_jib with_abi_profile enable_warnings_as_errors with_native_debug_symbols @@ -1212,9 +1212,6 @@ with_dxsdk with_dxsdk_lib with_dxsdk_include -with_libelf -with_libelf_include -with_libelf_lib with_jvm_features with_jvm_interpreter enable_jtreg_failure_handler @@ -1343,8 +1340,6 @@ PNG_LIBS LCMS_CFLAGS LCMS_LIBS -ELF_CFLAGS -ELF_LIBS ICECC_CMD ICECC_CREATE_ENV ICECC_WRAPPER @@ -2120,6 +2115,7 @@ dependent] --with-build-devkit Devkit to use for the build platform toolchain --with-jtreg Regression Test Harness [probed] + --with-jib Jib dependency management tool [not used] --with-abi-profile specify ABI profile for ARM builds (arm-vfp-sflt,arm-vfp-hflt,arm-sflt, armv5-vfp-sflt,armv6-vfp-hflt,arm64,aarch64) @@ -2173,11 +2169,6 @@ compatibility and is ignored --with-dxsdk-include Deprecated. Option is kept for backwards compatibility and is ignored - --with-libelf specify prefix directory for the libelf package - (expecting the libraries under PATH/lib and the - headers under PATH/include) - --with-libelf-include specify directory for the libelf include files - --with-libelf-lib specify directory for the libelf library --with-jvm-features additional JVM features to enable (separated by comma), use '--help' to show possible values [none] --with-jvm-interpreter Deprecated. Option is kept for backwards @@ -2313,8 +2304,6 @@ PNG_LIBS linker flags for PNG, overriding pkg-config LCMS_CFLAGS C compiler flags for LCMS, overriding pkg-config LCMS_LIBS linker flags for LCMS, overriding pkg-config - ELF_CFLAGS C compiler flags for ELF, overriding pkg-config - ELF_LIBS linker flags for ELF, overriding pkg-config ICECC_CMD Override default value for ICECC_CMD ICECC_CREATE_ENV Override default value for ICECC_CREATE_ENV @@ -4502,7 +4491,7 @@ # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2017, 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 @@ -4779,36 +4768,6 @@ ################################################################################ -# -# Copyright (c) 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. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# 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. -# - -################################################################################ -# Setup libelf (ELF library) -################################################################################ - - ################################################################################ # Determine which libraries are needed for this configuration @@ -4945,7 +4904,7 @@ # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2017, 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 @@ -5076,6 +5035,9 @@ # Setup the JTReg Regression Test Harness. +# Setup the JIB dependency resolver + + # # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -5177,7 +5139,7 @@ #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1490900744 +DATE_WHEN_GENERATED=1492540277 ############################################################################### # @@ -48882,6 +48844,41 @@ +# Setup Jib dependency tool + + +# Check whether --with-jib was given. +if test "${with_jib+set}" = set; then : + withval=$with_jib; +fi + + + if test "x$with_jib" = xno || test "x$with_jib" = x; then + # jib disabled + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jib" >&5 +$as_echo_n "checking for jib... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + elif test "x$with_jib" = xyes; then + as_fn_error $? "Must supply a value to --with-jib" "$LINENO" 5 + else + JIB_HOME="${with_jib}" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jib" >&5 +$as_echo_n "checking for jib... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${JIB_HOME}" >&5 +$as_echo "${JIB_HOME}" >&6; } + if test ! -d "${JIB_HOME}"; then + as_fn_error $? "--with-jib must be a directory" "$LINENO" 5 + fi + JIB_JAR=$(ls ${JIB_HOME}/lib/jib-*.jar) + if test ! -f "${JIB_JAR}"; then + as_fn_error $? "Could not find jib jar file in ${JIB_HOME}" "$LINENO" 5 + fi + fi + + + + # COMPILER_TARGET_BITS_FLAG : option for selecting 32- or 64-bit output # COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler @@ -53255,8 +53252,8 @@ fi if test "x$ENABLE_AOT" = "xtrue"; then - # Only enable AOT on linux-X64. - if test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-x86_64"; then + # Only enable AOT on X64 platforms. + if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then if test -e "$HOTSPOT_TOPDIR/src/jdk.aot"; then if test -e "$HOTSPOT_TOPDIR/src/jdk.internal.vm.compiler"; then ENABLE_AOT="true" @@ -64612,286 +64609,6 @@ -# Check whether --with-libelf was given. -if test "${with_libelf+set}" = set; then : - withval=$with_libelf; -fi - - -# Check whether --with-libelf-include was given. -if test "${with_libelf_include+set}" = set; then : - withval=$with_libelf_include; -fi - - -# Check whether --with-libelf-lib was given. -if test "${with_libelf_lib+set}" = set; then : - withval=$with_libelf_lib; -fi - - - if test "x$ENABLE_AOT" = xfalse; then - if (test "x${with_libelf}" != x && test "x${with_libelf}" != xno) || \ - (test "x${with_libelf_include}" != x && test "x${with_libelf_include}" != xno) || \ - (test "x${with_libelf_lib}" != x && test "x${with_libelf_lib}" != xno); then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libelf is not used, so --with-libelf[-*] is ignored" >&5 -$as_echo "$as_me: WARNING: libelf is not used, so --with-libelf[-*] is ignored" >&2;} - fi - LIBELF_CFLAGS= - LIBELF_LIBS= - else - LIBELF_FOUND=no - - if test "x${with_libelf}" = xno || test "x${with_libelf_include}" = xno || test "x${with_libelf_lib}" = xno; then - ENABLE_AOT="false" - if test "x${enable_aot}" = xyes; then - as_fn_error $? "libelf is explicitly disabled, cannot build AOT. Enable libelf or remove --enable-aot to disable AOT." "$LINENO" 5 - fi - else - if test "x${with_libelf}" != x; then - ELF_LIBS="-L${with_libelf}/lib -lelf" - ELF_CFLAGS="-I${with_libelf}/include" - LIBELF_FOUND=yes - fi - if test "x${with_libelf_include}" != x; then - ELF_CFLAGS="-I${with_libelf_include}" - LIBELF_FOUND=yes - fi - if test "x${with_libelf_lib}" != x; then - ELF_LIBS="-L${with_libelf_lib} -lelf" - LIBELF_FOUND=yes - fi - # Do not try pkg-config if we have a sysroot set. - if test "x$SYSROOT" = x; then - if test "x$LIBELF_FOUND" = xno; then - # Figure out ELF_CFLAGS and ELF_LIBS - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF" >&5 -$as_echo_n "checking for ELF... " >&6; } - -if test -n "$ELF_CFLAGS"; then - pkg_cv_ELF_CFLAGS="$ELF_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelf\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libelf") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_ELF_CFLAGS=`$PKG_CONFIG --cflags "libelf" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$ELF_LIBS"; then - pkg_cv_ELF_LIBS="$ELF_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelf\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libelf") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_ELF_LIBS=`$PKG_CONFIG --libs "libelf" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - ELF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libelf" 2>&1` - else - ELF_PKG_ERRORS=`$PKG_CONFIG --print-errors "libelf" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$ELF_PKG_ERRORS" >&5 - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - LIBELF_FOUND=no -elif test $pkg_failed = untried; then - LIBELF_FOUND=no -else - ELF_CFLAGS=$pkg_cv_ELF_CFLAGS - ELF_LIBS=$pkg_cv_ELF_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LIBELF_FOUND=yes -fi - fi - fi - if test "x$LIBELF_FOUND" = xno; then - for ac_header in libelf.h -do : - ac_fn_cxx_check_header_mongrel "$LINENO" "libelf.h" "ac_cv_header_libelf_h" "$ac_includes_default" -if test "x$ac_cv_header_libelf_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBELF_H 1 -_ACEOF - - LIBELF_FOUND=yes - ELF_CFLAGS= - ELF_LIBS=-lelf - -else - LIBELF_FOUND=no - -fi - -done - - fi - if test "x$LIBELF_FOUND" = xno; then - ENABLE_AOT="false" - - # Print a helpful message on how to acquire the necessary build dependency. - # elf is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=elf - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - if test "x${enable_aot}" = xyes; then - as_fn_error $? "libelf not found, cannot build AOT. Remove --enable-aot to disable AOT or: $HELP_MSG" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libelf not found, cannot build AOT. $HELP_MSG" >&5 -$as_echo "$as_me: WARNING: libelf not found, cannot build AOT. $HELP_MSG" >&2;} - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libelf works" >&5 -$as_echo_n "checking if libelf works... " >&6; } - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ELF_CFLAGS" - OLD_LIBS="$LIBS" - LIBS="$LIBS $ELF_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - - elf_version(0); - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - LIBELF_WORKS=yes -else - LIBELF_WORKS=no - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$OLD_CFLAGS" - LIBS="$OLD_LIBS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBELF_WORKS" >&5 -$as_echo "$LIBELF_WORKS" >&6; } - - if test "x$LIBELF_WORKS" = xno; then - ENABLE_AOT="false" - - # Print a helpful message on how to acquire the necessary build dependency. - # elf is the help tag: freetype, cups, alsa etc - MISSING_DEPENDENCY=elf - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - brew) - brew_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - if test "x$enable_aot" = "xyes"; then - as_fn_error $? "Found libelf but could not link and compile with it. Remove --enable-aot to disable AOT or: $HELP_MSG" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found libelf but could not link and compile with it. $HELP_MSG" >&5 -$as_echo "$as_me: WARNING: Found libelf but could not link and compile with it. $HELP_MSG" >&2;} - fi - fi - fi - fi - fi - - - - - - - diff -r f113ce12fe24 -r 45deafa80e4f common/autoconf/hotspot.m4 --- a/common/autoconf/hotspot.m4 Wed Jul 05 23:13:48 2017 +0200 +++ b/common/autoconf/hotspot.m4 Tue Apr 18 20:31:23 2017 +0200 @@ -212,8 +212,8 @@ fi if test "x$ENABLE_AOT" = "xtrue"; then - # Only enable AOT on linux-X64. - if test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-x86_64"; then + # Only enable AOT on X64 platforms. + if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then if test -e "$HOTSPOT_TOPDIR/src/jdk.aot"; then if test -e "$HOTSPOT_TOPDIR/src/jdk.internal.vm.compiler"; then ENABLE_AOT="true" diff -r f113ce12fe24 -r 45deafa80e4f common/autoconf/lib-elf.m4 --- a/common/autoconf/lib-elf.m4 Wed Jul 05 23:13:48 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -# -# Copyright (c) 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. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# 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. -# - -################################################################################ -# Setup libelf (ELF library) -################################################################################ -AC_DEFUN_ONCE([LIB_SETUP_LIBELF], -[ - AC_ARG_WITH(libelf, [AS_HELP_STRING([--with-libelf], - [specify prefix directory for the libelf package - (expecting the libraries under PATH/lib and the headers under PATH/include)])]) - AC_ARG_WITH(libelf-include, [AS_HELP_STRING([--with-libelf-include], - [specify directory for the libelf include files])]) - AC_ARG_WITH(libelf-lib, [AS_HELP_STRING([--with-libelf-lib], - [specify directory for the libelf library])]) - - if test "x$ENABLE_AOT" = xfalse; then - if (test "x${with_libelf}" != x && test "x${with_libelf}" != xno) || \ - (test "x${with_libelf_include}" != x && test "x${with_libelf_include}" != xno) || \ - (test "x${with_libelf_lib}" != x && test "x${with_libelf_lib}" != xno); then - AC_MSG_WARN([[libelf is not used, so --with-libelf[-*] is ignored]]) - fi - LIBELF_CFLAGS= - LIBELF_LIBS= - else - LIBELF_FOUND=no - - if test "x${with_libelf}" = xno || test "x${with_libelf_include}" = xno || test "x${with_libelf_lib}" = xno; then - ENABLE_AOT="false" - if test "x${enable_aot}" = xyes; then - AC_MSG_ERROR([libelf is explicitly disabled, cannot build AOT. Enable libelf or remove --enable-aot to disable AOT.]) - fi - else - if test "x${with_libelf}" != x; then - ELF_LIBS="-L${with_libelf}/lib -lelf" - ELF_CFLAGS="-I${with_libelf}/include" - LIBELF_FOUND=yes - fi - if test "x${with_libelf_include}" != x; then - ELF_CFLAGS="-I${with_libelf_include}" - LIBELF_FOUND=yes - fi - if test "x${with_libelf_lib}" != x; then - ELF_LIBS="-L${with_libelf_lib} -lelf" - LIBELF_FOUND=yes - fi - # Do not try pkg-config if we have a sysroot set. - if test "x$SYSROOT" = x; then - if test "x$LIBELF_FOUND" = xno; then - # Figure out ELF_CFLAGS and ELF_LIBS - PKG_CHECK_MODULES([ELF], [libelf], [LIBELF_FOUND=yes], [LIBELF_FOUND=no]) - fi - fi - if test "x$LIBELF_FOUND" = xno; then - AC_CHECK_HEADERS([libelf.h], - [ - LIBELF_FOUND=yes - ELF_CFLAGS= - ELF_LIBS=-lelf - ], - [LIBELF_FOUND=no] - ) - fi - if test "x$LIBELF_FOUND" = xno; then - ENABLE_AOT="false" - HELP_MSG_MISSING_DEPENDENCY([elf]) - if test "x${enable_aot}" = xyes; then - AC_MSG_ERROR([libelf not found, cannot build AOT. Remove --enable-aot to disable AOT or: $HELP_MSG]) - else - AC_MSG_WARN([libelf not found, cannot build AOT. $HELP_MSG]) - fi - else - AC_MSG_CHECKING([if libelf works]) - AC_LANG_PUSH(C) - OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ELF_CFLAGS" - OLD_LIBS="$LIBS" - LIBS="$LIBS $ELF_LIBS" - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], - [ - elf_version(0); - return 0; - ])], - [LIBELF_WORKS=yes], - [LIBELF_WORKS=no] - ) - CFLAGS="$OLD_CFLAGS" - LIBS="$OLD_LIBS" - AC_LANG_POP(C) - AC_MSG_RESULT([$LIBELF_WORKS]) - - if test "x$LIBELF_WORKS" = xno; then - ENABLE_AOT="false" - HELP_MSG_MISSING_DEPENDENCY([elf]) - if test "x$enable_aot" = "xyes"; then - AC_MSG_ERROR([Found libelf but could not link and compile with it. Remove --enable-aot to disable AOT or: $HELP_MSG]) - else - AC_MSG_WARN([Found libelf but could not link and compile with it. $HELP_MSG]) - fi - fi - fi - fi - fi - - AC_SUBST(ELF_CFLAGS) - AC_SUBST(ELF_LIBS) -]) diff -r f113ce12fe24 -r 45deafa80e4f common/autoconf/libraries.m4 --- a/common/autoconf/libraries.m4 Wed Jul 05 23:13:48 2017 +0200 +++ b/common/autoconf/libraries.m4 Tue Apr 18 20:31:23 2017 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2017, 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 @@ -31,7 +31,6 @@ m4_include([lib-freetype.m4]) m4_include([lib-std.m4]) m4_include([lib-x11.m4]) -m4_include([lib-elf.m4]) ################################################################################ # Determine which libraries are needed for this configuration @@ -91,7 +90,6 @@ LIB_SETUP_BUNDLED_LIBS LIB_SETUP_MISC_LIBS LIB_SETUP_SOLARIS_STLPORT - LIB_SETUP_LIBELF ]) ################################################################################ diff -r f113ce12fe24 -r 45deafa80e4f common/autoconf/spec.gmk.in --- a/common/autoconf/spec.gmk.in Wed Jul 05 23:13:48 2017 +0200 +++ b/common/autoconf/spec.gmk.in Tue Apr 18 20:31:23 2017 +0200 @@ -685,6 +685,7 @@ XATTR:=@XATTR@ JT_HOME:=@JT_HOME@ JTREGEXE:=@JTREGEXE@ +JIB_JAR:=@JIB_JAR@ XCODEBUILD=@XCODEBUILD@ DTRACE := @DTRACE@ FIXPATH:=@FIXPATH@ @@ -769,9 +770,6 @@ PNG_LIBS:=@PNG_LIBS@ PNG_CFLAGS:=@PNG_CFLAGS@ -ELF_CFLAGS:=@ELF_CFLAGS@ -ELF_LIBS:=@ELF_LIBS@ - #################################################### # # Misc diff -r f113ce12fe24 -r 45deafa80e4f common/autoconf/toolchain.m4 --- a/common/autoconf/toolchain.m4 Wed Jul 05 23:13:48 2017 +0200 +++ b/common/autoconf/toolchain.m4 Tue Apr 18 20:31:23 2017 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2017, 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,3 +964,31 @@ AC_SUBST(JT_HOME) AC_SUBST(JTREGEXE) ]) + +# Setup the JIB dependency resolver +AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JIB], +[ + AC_ARG_WITH(jib, [AS_HELP_STRING([--with-jib], + [Jib dependency management tool @<:@not used@:>@])]) + + if test "x$with_jib" = xno || test "x$with_jib" = x; then + # jib disabled + AC_MSG_CHECKING([for jib]) + AC_MSG_RESULT(no) + elif test "x$with_jib" = xyes; then + AC_MSG_ERROR([Must supply a value to --with-jib]) + else + JIB_HOME="${with_jib}" + AC_MSG_CHECKING([for jib]) + AC_MSG_RESULT(${JIB_HOME}) + if test ! -d "${JIB_HOME}"; then + AC_MSG_ERROR([--with-jib must be a directory]) + fi + JIB_JAR=$(ls ${JIB_HOME}/lib/jib-*.jar) + if test ! -f "${JIB_JAR}"; then + AC_MSG_ERROR([Could not find jib jar file in ${JIB_HOME}]) + fi + fi + + AC_SUBST(JIB_JAR) +]) diff -r f113ce12fe24 -r 45deafa80e4f common/conf/jib-profiles.js --- a/common/conf/jib-profiles.js Wed Jul 05 23:13:48 2017 +0200 +++ b/common/conf/jib-profiles.js Tue Apr 18 20:31:23 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, 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 @@ -236,7 +236,7 @@ // These are the base setttings for all the main build profiles. common.main_profile_base = { - dependencies: ["boot_jdk", "gnumake", "jtreg"], + dependencies: ["boot_jdk", "gnumake", "jtreg", "jib"], default_make_targets: ["product-bundles", "test-bundles"], configure_args: [ "--with-version-opt=" + common.build_id, @@ -557,7 +557,7 @@ "run-test-jprt": { target_os: input.build_os, target_cpu: input.build_cpu, - dependencies: [ "jtreg", "gnumake", "boot_jdk" ], + dependencies: [ "jtreg", "gnumake", "boot_jdk", "devkit", "jib" ], labels: "test", environment: { "JT_JAVA": common.boot_jdk_home @@ -567,7 +567,7 @@ "run-test": { target_os: input.build_os, target_cpu: input.build_cpu, - dependencies: [ "jtreg", "gnumake", "boot_jdk" ], + dependencies: [ "jtreg", "gnumake", "boot_jdk", "devkit", "jib" ], labels: "test", environment: { "JT_JAVA": common.boot_jdk_home @@ -584,7 +584,7 @@ var testOnlyProfilesPrebuilt = { "run-test-prebuilt": { src: "src.conf", - dependencies: [ "jtreg", "gnumake", testedProfile + ".jdk", + dependencies: [ "jtreg", "gnumake", "jib", testedProfile + ".jdk", testedProfile + ".test", "src.full" ], work_dir: input.get("src.full", "install_path") + "/test", @@ -912,9 +912,28 @@ ext: "tar.gz", revision: "2.7.1-v120+1.0", module: "freetype-" + input.target_platform - } + }, + + // This adds java jib as a dependency for the test artifacts resolver + jib: { + organization: "com.oracle.java.jib", + ext: "zip", + classifier: "distribution", + revision: "3.0-SNAPSHOT", + environment_name: "JIB_JAR", + environment_value: input.get("jib", "install_path") + + "/jib-3.0-SNAPSHOT-distribution/lib/jib-3.0-SNAPSHOT.jar" + } }; + // Need to add a value for the Visual Studio tools variable to make + // jaot be able to pick up the Visual Studio linker in testing. + if (input.target_os == "windows") { + dependencies.devkit.environment = { + VS120COMNTOOLS: input.get("devkit", "install_path") + "/Common7/Tools" + }; + } + return dependencies; }; diff -r f113ce12fe24 -r 45deafa80e4f make/CompileJavaModules.gmk --- a/make/CompileJavaModules.gmk Wed Jul 05 23:13:48 2017 +0200 +++ b/make/CompileJavaModules.gmk Tue Apr 18 20:31:23 2017 +0200 @@ -491,6 +491,7 @@ org.graalvm.compiler.jtt \ org.graalvm.compiler.lir.jtt \ org.graalvm.compiler.lir.test \ + org.graalvm.compiler.loop.test \ org.graalvm.compiler.microbenchmarks \ org.graalvm.compiler.nodes.test \ org.graalvm.compiler.options.test \ @@ -498,6 +499,7 @@ org.graalvm.compiler.replacements.test \ org.graalvm.compiler.test \ org.graalvm.compiler.virtual.bench \ + org.graalvm.util.test \ # ################################################################################ diff -r f113ce12fe24 -r 45deafa80e4f make/Javadoc.gmk --- a/make/Javadoc.gmk Wed Jul 05 23:13:48 2017 +0200 +++ b/make/Javadoc.gmk Tue Apr 18 20:31:23 2017 +0200 @@ -125,6 +125,7 @@ org.w3c.dom.stylesheets \ org.w3c.dom.xpath \ org.graalvm.compiler.% \ + org.graalvm.util% \ # CORE_PACKAGES := $(filter-out $(CORE_EXCLUDED_PACKAGES), \ diff -r f113ce12fe24 -r 45deafa80e4f make/MainSupport.gmk --- a/make/MainSupport.gmk Wed Jul 05 23:13:48 2017 +0200 +++ b/make/MainSupport.gmk Tue Apr 18 20:31:23 2017 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2017, 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 @@ -37,7 +37,7 @@ JT_HOME=$(JT_HOME) PRODUCT_HOME=$(strip $2) \ TEST_IMAGE_DIR=$(TEST_IMAGE_DIR) \ ALT_OUTPUTDIR=$(OUTPUT_ROOT) TEST_JOBS=$(TEST_JOBS) \ - JT_JAVA=$(BOOT_JDK) \ + JT_JAVA=$(BOOT_JDK) JIB_JAR=$(JIB_JAR) \ JOBS=$(JOBS) $1) || true endef diff -r f113ce12fe24 -r 45deafa80e4f make/jprt.properties --- a/make/jprt.properties Wed Jul 05 23:13:48 2017 +0200 +++ b/make/jprt.properties Tue Apr 18 20:31:23 2017 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2017, 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 @@ -441,25 +441,25 @@ # Hotspot jtreg tests my.make.rule.test.targets.hotspot.reg= \ - ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_compiler_1}, \ - ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_compiler_2}, \ - ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_compiler_3}, \ - ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_compiler_closed}, \ - ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_1}, \ - ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_2}, \ - ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_closed}, \ - ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_gcold}, \ - ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_gcbasher}, \ - ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_runtime}, \ - ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_serviceability}, \ + ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_compiler_1}, \ + ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_compiler_2}, \ + ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_compiler_3}, \ + ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_compiler_closed}, \ + ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_gc_1}, \ + ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_gc_2}, \ + ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_gc_closed}, \ + ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_gc_gcold}, \ + ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_gc_gcbasher}, \ + ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_runtime}, \ + ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_tier1_serviceability}, \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=jdk_svc_sanity}, \ - solaris_sparcv9_5.11-product-c2-hotspot_fast_gc_gcbasher, \ - solaris_x64_5.11-product-c2-hotspot_fast_gc_gcbasher, \ - linux_i586_3.8-product-c2-hotspot_fast_gc_gcbasher, \ - linux_x64_3.8-product-c2-hotspot_fast_gc_gcbasher, \ - macosx_x64_10.9-product-c2-hotspot_fast_gc_gcbasher, \ - windows_i586_6.3-product-c2-hotspot_fast_gc_gcbasher, \ - windows_x64_6.3-product-c2-hotspot_fast_gc_gcbasher, \ + solaris_sparcv9_5.11-product-c2-hotspot_tier1_gc_gcbasher, \ + solaris_x64_5.11-product-c2-hotspot_tier1_gc_gcbasher, \ + linux_i586_3.8-product-c2-hotspot_tier1_gc_gcbasher, \ + linux_x64_3.8-product-c2-hotspot_tier1_gc_gcbasher, \ + macosx_x64_10.9-product-c2-hotspot_tier1_gc_gcbasher, \ + windows_i586_6.3-product-c2-hotspot_tier1_gc_gcbasher, \ + windows_x64_6.3-product-c2-hotspot_tier1_gc_gcbasher, \ ${my.additional.make.rule.test.targets.hotspot.reg} # Other Makefile based Hotspot tests diff -r f113ce12fe24 -r 45deafa80e4f test/TestCommon.gmk --- a/test/TestCommon.gmk Wed Jul 05 23:13:48 2017 +0200 +++ b/test/TestCommon.gmk Tue Apr 18 20:31:23 2017 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1995, 2017, 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 @@ -369,9 +369,15 @@ endif # Give tests access to JT_JAVA, see JDK-8141609 JTREG_BASIC_OPTIONS += -e:JDK8_HOME=${JT_JAVA} +# Give aot tests access to Visual Studio installation +ifneq ($(VS120COMNTOOLS), ) + JTREG_BASIC_OPTIONS += -e:VS120COMNTOOLS=$(shell $(GETMIXEDPATH) "$(VS120COMNTOOLS)") +endif # Set other vm and test options JTREG_TEST_OPTIONS += $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_OPTIONS:%=-vmoption:%) $(JAVA_VM_ARGS:%=-vmoption:%) - +ifneq ($(JIB_JAR), ) + JTREG_BASIC_OPTIONS += -cpa:$(shell $(GETMIXEDPATH) "$(JIB_JAR)") +endif ifeq ($(IGNORE_MARKED_TESTS), true) # Option to tell jtreg to not run tests marked with "ignore" ifeq ($(PLATFORM), windows) diff -r f113ce12fe24 -r 45deafa80e4f test/lib/jdk/test/lib/artifacts/Artifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/lib/jdk/test/lib/artifacts/Artifact.java Tue Apr 18 20:31:23 2017 +0200 @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2017, 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 jdk.test.lib.artifacts; + +import java.lang.annotation.*; + +@Target(ElementType.TYPE) +@Repeatable(ArtifactContainer.class) +@Retention(RetentionPolicy.RUNTIME) +public @interface Artifact { + String organization(); + String name(); + String revision(); + String extension(); + String classifier() default ""; + boolean unpack() default true; +} + diff -r f113ce12fe24 -r 45deafa80e4f test/lib/jdk/test/lib/artifacts/ArtifactContainer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/lib/jdk/test/lib/artifacts/ArtifactContainer.java Tue Apr 18 20:31:23 2017 +0200 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2017, 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 jdk.test.lib.artifacts; + +import java.lang.annotation.*; + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface ArtifactContainer { + Artifact[] value(); +} + diff -r f113ce12fe24 -r 45deafa80e4f test/lib/jdk/test/lib/artifacts/ArtifactManager.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/lib/jdk/test/lib/artifacts/ArtifactManager.java Tue Apr 18 20:31:23 2017 +0200 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017, 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 jdk.test.lib.artifacts; + +import java.io.FileNotFoundException; +import java.nio.file.Path; + +public interface ArtifactManager { + public Path resolve(Artifact artifact) throws FileNotFoundException; +} diff -r f113ce12fe24 -r 45deafa80e4f test/lib/jdk/test/lib/artifacts/ArtifactResolver.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/lib/jdk/test/lib/artifacts/ArtifactResolver.java Tue Apr 18 20:31:23 2017 +0200 @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2017, 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 jdk.test.lib.artifacts; + +import java.io.FileNotFoundException; +import java.nio.file.Path; +import java.util.HashMap; + +public class ArtifactResolver { + public static HashMap resolve(Class klass) throws FileNotFoundException { + ArtifactManager manager = new DefaultArtifactManager(); + try { + String managerName = System.getProperty("jdk.test.lib.artifacts.artifactmanager"); + if (managerName != null) { + manager = (ArtifactManager) Class.forName(managerName).newInstance(); + } else { + manager = JibArtifactManager.newInstance(); + } + } catch (Exception e) { + // If we end up here, we'll use the DefaultArtifactManager + } + + ArtifactContainer artifactContainer = (ArtifactContainer) klass.getAnnotation(ArtifactContainer.class); + HashMap locations = new HashMap<>(); + Artifact[] artifacts; + + if (artifactContainer == null) { + artifacts = new Artifact[]{(Artifact) klass.getAnnotation(Artifact.class)}; + } else { + artifacts = artifactContainer.value(); + } + for (Artifact artifact : artifacts) { + locations.put(artifactName(artifact), manager.resolve(artifact)); + } + + return locations; + } + + private static String artifactName(Artifact artifact) { + // Format of the artifact name is .-(-) + String name = String.format("%s.%s-%s", artifact.organization(), artifact.name(), artifact.revision()); + if (artifact.classifier().length() != 0) { + name = name +"-" + artifact.classifier(); + } + return name; + } +} diff -r f113ce12fe24 -r 45deafa80e4f test/lib/jdk/test/lib/artifacts/DefaultArtifactManager.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/lib/jdk/test/lib/artifacts/DefaultArtifactManager.java Tue Apr 18 20:31:23 2017 +0200 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2017, 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 jdk.test.lib.artifacts; + +import java.io.FileNotFoundException; +import java.nio.file.Path; +import java.nio.file.Paths; + +public class DefaultArtifactManager implements ArtifactManager { + @Override + public Path resolve(Artifact artifact) throws FileNotFoundException { + String name = artifact.name(); + String location = System.getProperty(artifactProperty(name)); + if (location == null) { + throw new FileNotFoundException("Couldn't automatically resolve dependency for " + name + " , revision " + artifact.revision() + "\n" + + "Please specify the location using " + artifactProperty(name)); + } + return Paths.get(location); + } + + private static String artifactProperty(String name) { + return "jdk.test.lib.artifacts." + name; + } +} diff -r f113ce12fe24 -r 45deafa80e4f test/lib/jdk/test/lib/artifacts/JibArtifactManager.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/lib/jdk/test/lib/artifacts/JibArtifactManager.java Tue Apr 18 20:31:23 2017 +0200 @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2017, 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 jdk.test.lib.artifacts; + +import java.io.FileNotFoundException; +import java.lang.reflect.Method; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.Map; + +public class JibArtifactManager implements ArtifactManager { + private static String jibVersion = "1.0"; + private Object installerObject; + + private JibArtifactManager(Object o) { + installerObject = o; + } + + public static JibArtifactManager newInstance() throws ClassNotFoundException { + try { + Class jibServiceFactory = Class.forName("com.oracle.jib.api.JibServiceFactory"); + Object jibArtifactInstaller = jibServiceFactory.getMethod("createJibArtifactInstaller").invoke(null); + return new JibArtifactManager(jibArtifactInstaller); + } catch (Exception e) { + throw new ClassNotFoundException(); + } + } + + private Path download(String jibVersion, HashMap artifactDescription) throws Exception { + return invokeInstallerMethod("download", jibVersion, artifactDescription); + } + + private Path install(String jibVersion, HashMap artifactDescription) throws Exception { + return invokeInstallerMethod("install", jibVersion, artifactDescription); + } + + private Path invokeInstallerMethod(String methodName, String jibVersion, HashMap artifactDescription) throws Exception { + Method m = Class.forName("com.oracle.jib.api.JibArtifactInstaller").getMethod(methodName, String.class, Map.class); + return (Path)m.invoke(installerObject, jibVersion, artifactDescription); + } + + @Override + public Path resolve(Artifact artifact) throws FileNotFoundException { + Path path; + // Use the DefaultArtifactManager to enable users to override locations + try { + ArtifactManager manager = new DefaultArtifactManager(); + path = manager.resolve(artifact); + } catch (FileNotFoundException e) { + // Location hasn't been overridden, continue to automatically try to resolve the dependency + try { + HashMap artifactDescription = new HashMap<>(); + artifactDescription.put("module", artifact.name()); + artifactDescription.put("organization", artifact.organization()); + artifactDescription.put("ext", artifact.extension()); + artifactDescription.put("revision", artifact.revision()); + if (artifact.classifier().length() > 0) { + artifactDescription.put("classifier", artifact.classifier()); + } + + path = download(jibVersion, artifactDescription); + if (artifact.unpack()) { + path = install(jibVersion, artifactDescription); + } + } catch (Exception exception) { + throw new FileNotFoundException("Failed to resolve the artifact " + artifact); + } + } + return path; + } +} diff -r f113ce12fe24 -r 45deafa80e4f test/lib/sun/hotspot/WhiteBox.java --- a/test/lib/sun/hotspot/WhiteBox.java Wed Jul 05 23:13:48 2017 +0200 +++ b/test/lib/sun/hotspot/WhiteBox.java Tue Apr 18 20:31:23 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017, 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 @@ -390,6 +390,39 @@ // Force Full GC public native void fullGC(); + // Returns true if the current GC supports control of its concurrent + // phase via requestConcurrentGCPhase(). If false, a request will + // always fail. + public native boolean supportsConcurrentGCPhaseControl(); + + // Returns an array of concurrent phase names provided by this + // collector. These are the names recognized by + // requestConcurrentGCPhase(). + public native String[] getConcurrentGCPhases(); + + // Attempt to put the collector into the indicated concurrent phase, + // and attempt to remain in that state until a new request is made. + // + // Returns immediately if already in the requested phase. + // Otherwise, waits until the phase is reached. + // + // Throws IllegalStateException if unsupported by the current collector. + // Throws NullPointerException if phase is null. + // Throws IllegalArgumentException if phase is not valid for the current collector. + public void requestConcurrentGCPhase(String phase) { + if (!supportsConcurrentGCPhaseControl()) { + throw new IllegalStateException("Concurrent GC phase control not supported"); + } else if (phase == null) { + throw new NullPointerException("null phase"); + } else if (!requestConcurrentGCPhase0(phase)) { + throw new IllegalArgumentException("Unknown concurrent GC phase: " + phase); + } + } + + // Helper for requestConcurrentGCPhase(). Returns true if request + // succeeded, false if the phase is invalid. + private native boolean requestConcurrentGCPhase0(String phase); + // Method tries to start concurrent mark cycle. // It returns false if CM Thread is always in concurrent cycle. public native boolean g1StartConcMarkCycle(); @@ -456,7 +489,6 @@ public native void AddModulePackage(Object module, String pkg); public native void AddModuleExportsToAllUnnamed(Object module, String pkg); public native void AddModuleExportsToAll(Object module, String pkg); - public native Object GetModuleByPackageName(Object ldr, String pkg); public native int getOffsetForName0(String name); public int getOffsetForName(String name) throws Exception {