# HG changeset patch # User iignatyev # Date 1462187872 -10800 # Mon May 02 14:17:52 2016 +0300 # Node ID a121037461f3517e235a8c491114fd95941cff67 # Parent a79c570f52a691971c963b025982b82708b31063 [mq]: 8148244 diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -667,6 +667,7 @@ FASTDEBUG VARIANT USE_NEW_HOTSPOT_BUILD +STLPORT_LIB LIBZIP_CAN_USE_MMAP LIBDL LIBM @@ -4729,6 +4730,11 @@ ################################################################################ +################################################################################ +# libstlport.so.1 is needed for running gtest on Solaris. Find it to +# redistribute it in the test image. +################################################################################ + # # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52513,7 +52519,7 @@ if [[ " $JVM_FEATURES " =~ " management " ]] && ! [[ " $JVM_FEATURES " =~ " nmt " ]] ; then as_fn_error $? "Specified JVM feature 'management' requires feature 'nmt'" "$LINENO" 5 - fi + fi if [[ " $JVM_FEATURES " =~ " jvmci " ]] && ! [[ " $JVM_FEATURES " =~ " compiler2 " ]] ; then as_fn_error $? "Specified JVM feature 'jvmci' requires feature 'compiler2'" "$LINENO" 5 @@ -52521,7 +52527,7 @@ if [[ " $JVM_FEATURES " =~ " compiler2 " ]] && ! [[ " $JVM_FEATURES " =~ " all-gcs " ]] ; then as_fn_error $? "Specified JVM feature 'compiler2' requires feature 'all-gcs'" "$LINENO" 5 - fi + fi if [[ " $JVM_FEATURES " =~ " vm-structs " ]] && ! [[ " $JVM_FEATURES " =~ " all-gcs " ]] ; then as_fn_error $? "Specified JVM feature 'vm-structs' requires feature 'all-gcs'" "$LINENO" 5 @@ -52547,13 +52553,13 @@ if ! [[ " $JVM_VARIANTS " =~ " zero " ]] && ! [[ " $JVM_VARIANTS " =~ " zeroshark " ]] ; then if [[ " $JVM_FEATURES " =~ " zero " ]] ; then as_fn_error $? "To enable zero/zeroshark, you must use --with-jvm-variants=zero/zeroshark" "$LINENO" 5 - fi + fi fi if ! [[ " $JVM_VARIANTS " =~ " zeroshark " ]] ; then if [[ " $JVM_FEATURES " =~ " shark " ]] ; then as_fn_error $? "To enable shark, you must use --with-jvm-variants=zeroshark" "$LINENO" 5 - fi + fi fi # Only enable jvmci on x86_64, sparcv9 and aarch64, and only on server. @@ -63728,6 +63734,157 @@ + if test "$OPENJDK_TARGET_OS" = "solaris"; then + # Find the root of the Solaris Studio installation from the compiler path + SOLARIS_STUDIO_DIR="$(dirname $CC)/.." + STLPORT_LIB="$SOLARIS_STUDIO_DIR/lib/stlport4$OPENJDK_TARGET_CPU_ISADIR/libstlport.so.1" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libstlport.so.1" >&5 +$as_echo_n "checking for libstlport.so.1... " >&6; } + if test -f "$STLPORT_LIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, $STLPORT_LIB" >&5 +$as_echo "yes, $STLPORT_LIB" >&6; } + + # Only process if variable expands to non-empty + + if test "x$STLPORT_LIB" != 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="$STLPORT_LIB" + 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 STLPORT_LIB, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of STLPORT_LIB, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of STLPORT_LIB" "$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-style (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $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 + STLPORT_LIB="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STLPORT_LIB to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting STLPORT_LIB to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$STLPORT_LIB" + 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 + STLPORT_LIB="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STLPORT_LIB to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting STLPORT_LIB 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="$STLPORT_LIB" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STLPORT_LIB, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of STLPORT_LIB, 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 STLPORT_LIB, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + if test -d "$path"; then + STLPORT_LIB="`cd "$path"; $THEPWDCMD -L`" + else + dir="`$DIRNAME "$path"`" + base="`$BASENAME "$path"`" + STLPORT_LIB="`cd "$dir"; $THEPWDCMD -L`/$base" + fi + fi + fi + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, not found at $STLPORT_LIB" >&5 +$as_echo "no, not found at $STLPORT_LIB" >&6; } + as_fn_error $? "Failed to find libstlport.so.1, cannot build Hotspot gtests" "$LINENO" 5 + fi + + fi + + + diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4 --- a/common/autoconf/libraries.m4 +++ b/common/autoconf/libraries.m4 @@ -95,6 +95,7 @@ LIB_SETUP_LLVM LIB_SETUP_BUNDLED_LIBS LIB_SETUP_MISC_LIBS + LIB_SETUP_SOLARIS_STLPORT ]) ################################################################################ @@ -189,3 +190,25 @@ LIBZIP_CAN_USE_MMAP=true AC_SUBST(LIBZIP_CAN_USE_MMAP) ]) + +################################################################################ +# libstlport.so.1 is needed for running gtest on Solaris. Find it to +# redistribute it in the test image. +################################################################################ +AC_DEFUN_ONCE([LIB_SETUP_SOLARIS_STLPORT], +[ + if test "$OPENJDK_TARGET_OS" = "solaris"; then + # Find the root of the Solaris Studio installation from the compiler path + SOLARIS_STUDIO_DIR="$(dirname $CC)/.." + STLPORT_LIB="$SOLARIS_STUDIO_DIR/lib/stlport4$OPENJDK_TARGET_CPU_ISADIR/libstlport.so.1" + AC_MSG_CHECKING([for libstlport.so.1]) + if test -f "$STLPORT_LIB"; then + AC_MSG_RESULT([yes, $STLPORT_LIB]) + BASIC_FIXUP_PATH([STLPORT_LIB]) + else + AC_MSG_RESULT([no, not found at $STLPORT_LIB]) + AC_MSG_ERROR([Failed to find libstlport.so.1, cannot build Hotspot gtests]) + fi + AC_SUBST(STLPORT_LIB) + fi +]) \ No newline at end of file diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -683,6 +683,7 @@ LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@ MSVCR_DLL:=@MSVCR_DLL@ MSVCP_DLL:=@MSVCP_DLL@ +STLPORT_LIB:=@STLPORT_LIB@ #################################################### # diff --git a/make/Main.gmk b/make/Main.gmk --- a/make/Main.gmk +++ b/make/Main.gmk @@ -392,6 +392,9 @@ +($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \ test-image-jdk-jtreg-native) +test-image-hotspot-gtest: + +($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f GtestImage.gmk) + build-test-lib: +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f BuildTestLib.gmk) @@ -415,7 +418,7 @@ ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \ test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \ test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \ - test-failure-handler test-image-failure-handler + test-failure-handler test-image-failure-handler test-image-hotspot-gtest ################################################################################ # Run tests @@ -626,6 +629,8 @@ test-image-jdk-jtreg-native: build-test-jdk-jtreg-native + test-image-hotspot-gtest: hotspot + test-hotspot-internal: exploded-image test-hotspot-jtreg: jimages test-image @@ -707,7 +712,7 @@ # This target builds the test image test-image: prepare-test-image test-image-hotspot-jtreg-native \ - test-image-jdk-jtreg-native test-image-failure-handler + test-image-jdk-jtreg-native test-image-failure-handler test-image-hotspot-gtest # all-images is the top-most target, it builds all our deliverables ("images"). all-images: product-images test-image docs-image diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk @@ -372,6 +372,9 @@ # toolchain when compiling C++ code # STRIP_SYMBOLS Set to true to strip the final binary if the toolchain allows for it # DEBUG_SYMBOLS Set to false to disable generation of debug symbols +# COPY_DEBUG_SYMBOLS Set to false to override global setting of debug symbol copying +# ZIP_EXTERNAL_DEBUG_SYMBOLS Set to false to override global setting of debug symbol +# zipping # CFLAGS_DEBUG_SYMBOLS Overrides the default cflags for enabling debug symbols # CXXFLAGS_DEBUG_SYMBOLS Overrides the default cxxflags for enabling debug symbols # STRIPFLAGS Optionally change the flags given to the strip command @@ -807,7 +810,15 @@ # Need to make sure TARGET is first on list $1 := $$($1_TARGET) - ifeq ($(COPY_DEBUG_SYMBOLS), true) + ifneq ($$($1_COPY_DEBUG_SYMBOLS), false) + $1_COPY_DEBUG_SYMBOLS := $(COPY_DEBUG_SYMBOLS) + endif + + ifneq ($$($1_ZIP_EXTERNAL_DEBUG_SYMBOLS), false) + $1_ZIP_EXTERNAL_DEBUG_SYMBOLS := $(ZIP_EXTERNAL_DEBUG_SYMBOLS) + endif + + ifeq ($$($1_COPY_DEBUG_SYMBOLS), true) ifneq ($$($1_DEBUG_SYMBOLS), false) # Only copy debug symbols for dynamic libraries and programs. ifeq ($$($1_STATIC_LIBRARY), ) @@ -854,7 +865,7 @@ $$($1_TARGET): $$($1_DEBUGINFO_FILES) $$($1_DEBUGINFO_FILES): $$($1_ALL_OBJS) - ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true) + ifeq ($$($1_ZIP_EXTERNAL_DEBUG_SYMBOLS), true) $1_DEBUGINFO_ZIP := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).diz $1 += $$(subst $$($1_OBJECT_DIR),$$($1_OUTPUT_DIR),$$($1_DEBUGINFO_ZIP)) diff --git a/make/jprt.properties b/make/jprt.properties --- a/make/jprt.properties +++ b/make/jprt.properties @@ -438,6 +438,15 @@ windows_i586_6.3-*-default-hotspot_basicvmtest, \ windows_x64_6.3-*-default-hotspot_basicvmtest +my.make.rule.test.targets.hotspot.gtest= \ + linux_i586_3.8-*-default-hotspot_gtest, \ + linux_x64_3.8-*-default-hotspot_gtest, \ + macosx_x64_10.9-*-default-hotspot_gtest, \ + solaris_sparcv9_5.11-*-default-hotspot_gtest, \ + solaris_x64_5.11-*-default-hotspot_gtest, \ + windows_i586_6.3-*-default-hotspot_gtest, \ + windows_x64_6.3-*-default-hotspot_gtest + my.make.rule.test.targets.hotspot.reg.group= \ solaris_sparcv9_5.11-fastdebug-c2-GROUP, \ solaris_x64_5.11-fastdebug-c2-GROUP, \ @@ -465,6 +474,7 @@ # Other Makefile based Hotspot tests my.make.rule.test.targets.hotspot.other= \ ${my.make.rule.test.targets.hotspot.basicvmtests}, \ + ${my.make.rule.test.targets.hotspot.gtest}, \ ${my.additional.make.rule.test.targets.hotspot.other} # All the makefile based tests to run @@ -474,7 +484,9 @@ # Install the test bundle for the testset hotspot jtreg tests # (but not for the other Makefile based tests) -my.jprt.test.bundle.targets.hotspot=${my.make.rule.test.targets.hotspot.reg} +my.jprt.test.bundle.targets.hotspot= \ + ${my.make.rule.test.targets.hotspot.reg}, \ + ${my.make.rule.test.targets.hotspot.gtest} # Native jdk and hotspot test targets (testset=nativesanity) my.make.rule.test.targets.nativesanity= \