Skip to content

Commit 3f4f4e8

Browse files
committed
Merge
2 parents b284181 + 388a56e commit 3f4f4e8

File tree

968 files changed

+12410
-9789
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

968 files changed

+12410
-9789
lines changed

bin/jib.sh

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#
3-
# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
3+
# Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
44
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
#
66
# This code is free software; you can redistribute it and/or modify it
@@ -135,6 +135,28 @@ install_jib() {
135135
echo "${data_string}" > "${install_data}"
136136
}
137137

138+
# Returns a shell-escaped version of the argument given.
139+
shell_quote() {
140+
if [[ -n "$1" ]]; then
141+
# Uses only shell-safe characters? No quoting needed.
142+
# '=' is a zsh meta-character, but only in word-initial position.
143+
if echo "$1" | grep '^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\.:,%/+=_-]\{1,\}$' > /dev/null \
144+
&& ! echo "$1" | grep '^=' > /dev/null; then
145+
quoted="$1"
146+
else
147+
if echo "$1" | grep "[\'!]" > /dev/null; then
148+
# csh does history expansion within single quotes, but not
149+
# when backslash-escaped!
150+
local quoted_quote="'\\''" quoted_exclam="'\\!'"
151+
word="${1//\'/${quoted_quote}}"
152+
word="${1//\!/${quoted_exclam}}"
153+
fi
154+
quoted="'$1'"
155+
fi
156+
echo "$quoted"
157+
fi
158+
}
159+
138160
# Main body starts here
139161

140162
setup_url
@@ -151,4 +173,16 @@ if [ -z "${JIB_SRC_DIR}" ]; then
151173
export JIB_SRC_DIR="${mydir}/../"
152174
fi
153175

176+
177+
# Save the original command line
178+
conf_quoted_arguments=()
179+
for conf_option; do
180+
conf_quoted_arguments=("${conf_quoted_arguments[@]}" "$(shell_quote "$conf_option")")
181+
done
182+
export REAL_CONFIGURE_COMMAND_LINE="${conf_quoted_arguments[@]}"
183+
184+
myfulldir="$(cd "${mydir}" > /dev/null && pwd)"
185+
export REAL_CONFIGURE_COMMAND_EXEC_FULL="$BASH $myfulldir/$myname"
186+
export REAL_CONFIGURE_COMMAND_EXEC_SHORT="$myname"
187+
154188
${installed_jib_script} "$@"

doc/testing.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ <h3 id="jtreg">JTReg</h3>
9292
<p>Individual JTReg tests or directories containing JTReg tests can also be specified, like <code>test/hotspot/jtreg/native_sanity/JniVersion.java</code> or <code>hotspot/jtreg/native_sanity</code>. Just like for test root selection, you can either specify an absolute path (which can even point to JTReg tests outside the source tree), or a path relative to either the JDK top directory or the <code>test</code> directory. <code>hotspot</code> can be used as an alias for <code>hotspot/jtreg</code> here as well.</p>
9393
<p>As long as the test groups or test paths can be uniquely resolved, you do not need to enter the <code>jtreg:</code> prefix. If this is not possible, or if you want to use a fully qualified test descriptor, add <code>jtreg:</code>, e.g. <code>jtreg:test/hotspot/jtreg/native_sanity</code>.</p>
9494
<h3 id="gtest">Gtest</h3>
95+
<p><strong>Note:</strong> To be able to run the Gtest suite, you need to configure your build to be able to find a proper version of the gtest source. For details, see the section <a href="building.html#running-tests">&quot;Running Tests&quot; in the build documentation</a>.</p>
9596
<p>Since the Hotspot Gtest suite is so quick, the default is to run all tests. This is specified by just <code>gtest</code>, or as a fully qualified test descriptor <code>gtest:all</code>.</p>
9697
<p>If you want, you can single out an individual test or a group of tests, for instance <code>gtest:LogDecorations</code> or <code>gtest:LogDecorations.level_test_vm</code>. This can be particularly useful if you want to run a shaky test repeatedly.</p>
9798
<p>For Gtest, there is a separate test suite for each JVM variant. The JVM variant is defined by adding <code>/&lt;variant&gt;</code> to the test descriptor, e.g. <code>gtest:Log/client</code>. If you specify no variant, gtest will run once for each JVM variant present (e.g. server, client). So if you only have the server JVM present, then <code>gtest:all</code> will be equivalent to <code>gtest:all/server</code>.</p>

doc/testing.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ use a fully qualified test descriptor, add `jtreg:`, e.g.
169169

170170
### Gtest
171171

172+
**Note:** To be able to run the Gtest suite, you need to configure your build to
173+
be able to find a proper version of the gtest source. For details, see the
174+
section ["Running Tests" in the build
175+
documentation](building.html#running-tests).
176+
172177
Since the Hotspot Gtest suite is so quick, the default is to run all tests.
173178
This is specified by just `gtest`, or as a fully qualified test descriptor
174179
`gtest:all`.

make/Init.gmk

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,20 @@ else # HAS_SPEC=true
277277
$(ECHO) $(CONFIGURE_COMMAND_LINE)
278278

279279
reconfigure:
280-
ifneq ($(CONFIGURE_COMMAND_LINE), )
280+
ifneq ($(REAL_CONFIGURE_COMMAND_EXEC_FULL), )
281+
$(ECHO) "Re-running configure using original command line '$(REAL_CONFIGURE_COMMAND_EXEC_SHORT) $(REAL_CONFIGURE_COMMAND_LINE)'"
282+
$(eval RECONFIGURE_COMMAND := $(REAL_CONFIGURE_COMMAND_EXEC_FULL) $(REAL_CONFIGURE_COMMAND_LINE))
283+
else ifneq ($(CONFIGURE_COMMAND_LINE), )
281284
$(ECHO) "Re-running configure using arguments '$(CONFIGURE_COMMAND_LINE)'"
285+
$(eval RECONFIGURE_COMMAND := $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE))
282286
else
283287
$(ECHO) "Re-running configure using default settings"
288+
$(eval RECONFIGURE_COMMAND := $(BASH) $(TOPDIR)/configure)
284289
endif
285290
( cd $(CONFIGURE_START_DIR) && PATH="$(ORIGINAL_PATH)" AUTOCONF="$(AUTOCONF)" \
286291
CUSTOM_ROOT="$(CUSTOM_ROOT)" \
287292
CUSTOM_CONFIG_DIR="$(CUSTOM_CONFIG_DIR)" \
288-
$(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )
293+
$(RECONFIGURE_COMMAND) )
289294

290295
##############################################################################
291296
# The main target, for delegating into Main.gmk

make/autoconf/basic.m4

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ AC_DEFUN_ONCE([BASIC_INIT],
3131
[
3232
# Save the original command line. This is passed to us by the wrapper configure script.
3333
AC_SUBST(CONFIGURE_COMMAND_LINE)
34+
# We might have the original command line if the wrapper was called by some
35+
# other script.
36+
AC_SUBST(REAL_CONFIGURE_COMMAND_EXEC_SHORT)
37+
AC_SUBST(REAL_CONFIGURE_COMMAND_EXEC_FULL)
38+
AC_SUBST(REAL_CONFIGURE_COMMAND_LINE)
3439
# AUTOCONF might be set in the environment by the user. Preserve for "make reconfigure".
3540
AC_SUBST(AUTOCONF)
3641
# Save the path variable before it gets changed

make/autoconf/help.m4

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
278278
printf "using default settings.\n"
279279
fi
280280
281+
if test "x$REAL_CONFIGURE_COMMAND_EXEC_FULL" != x; then
282+
printf "\n"
283+
printf "The original configure invocation was '$REAL_CONFIGURE_COMMAND_EXEC_SHORT $REAL_CONFIGURE_COMMAND_LINE'.\n"
284+
fi
285+
281286
printf "\n"
282287
printf "Configuration summary:\n"
283288
printf "* Name: $CONF_NAME\n"

make/autoconf/lib-hsdis.m4

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,23 @@ AC_DEFUN([LIB_BUILD_BINUTILS],
134134
BINUTILS_SRC="$with_binutils_src"
135135
UTIL_FIXUP_PATH(BINUTILS_SRC)
136136
137+
BINUTILS_DIR="$CONFIGURESUPPORT_OUTPUTDIR/binutils"
138+
137139
if ! test -d $BINUTILS_SRC; then
138140
AC_MSG_ERROR([--with-binutils-src is not pointing to a directory])
139141
fi
140142
if ! test -x $BINUTILS_SRC/configure; then
141143
AC_MSG_ERROR([--with-binutils-src does not look like a binutils source directory])
142144
fi
143145
144-
if test -e $BINUTILS_SRC/bfd/libbfd.a && \
145-
test -e $BINUTILS_SRC/opcodes/libopcodes.a && \
146-
test -e $BINUTILS_SRC/libiberty/libiberty.a && \
147-
test -e $BINUTILS_SRC/zlib/libz.a; then
146+
if ! test -d $BINUTILS_DIR; then
147+
$MKDIR -p $BINUTILS_DIR
148+
fi
149+
150+
if test -e $BINUTILS_DIR/bfd/libbfd.a && \
151+
test -e $BINUTILS_DIR/opcodes/libopcodes.a && \
152+
test -e $BINUTILS_DIR/libiberty/libiberty.a && \
153+
test -e $BINUTILS_DIR/zlib/libz.a; then
148154
AC_MSG_NOTICE([Found binutils binaries in binutils source directory -- not building])
149155
else
150156
# On Windows, we cannot build with the normal Microsoft CL, but must instead use
@@ -184,11 +190,11 @@ AC_DEFUN([LIB_BUILD_BINUTILS],
184190
binutils_cflags="$binutils_cflags $MACHINE_FLAG $JVM_PICFLAG $C_O_FLAG_NORM"
185191
186192
AC_MSG_NOTICE([Running binutils configure])
187-
AC_MSG_NOTICE([configure command line: ./configure --disable-nls CFLAGS="$binutils_cflags" CC="$binutils_cc" $binutils_target])
193+
AC_MSG_NOTICE([configure command line: cd $BINUTILS_DIR && $BINUTILS_SRC/configure --disable-nls CFLAGS="$binutils_cflags" CC="$binutils_cc" AR="$AR" $binutils_target])
188194
saved_dir=`pwd`
189-
cd "$BINUTILS_SRC"
190-
./configure --disable-nls CFLAGS="$binutils_cflags" CC="$binutils_cc" $binutils_target
191-
if test $? -ne 0 || ! test -e $BINUTILS_SRC/Makefile; then
195+
cd "$BINUTILS_DIR"
196+
$BINUTILS_SRC/configure --disable-nls CFLAGS="$binutils_cflags" CC="$binutils_cc" AR="$AR" $binutils_target
197+
if test $? -ne 0 || ! test -e $BINUTILS_DIR/Makefile; then
192198
AC_MSG_NOTICE([Automatic building of binutils failed on configure. Try building it manually])
193199
AC_MSG_ERROR([Cannot continue])
194200
fi
@@ -201,8 +207,6 @@ AC_DEFUN([LIB_BUILD_BINUTILS],
201207
cd $saved_dir
202208
AC_MSG_NOTICE([Building of binutils done])
203209
fi
204-
205-
BINUTILS_DIR="$BINUTILS_SRC"
206210
])
207211

208212
################################################################################
@@ -238,8 +242,14 @@ AC_DEFUN([LIB_SETUP_HSDIS_BINUTILS],
238242
elif test "x$BINUTILS_DIR" != x; then
239243
if test -e $BINUTILS_DIR/bfd/libbfd.a && \
240244
test -e $BINUTILS_DIR/opcodes/libopcodes.a && \
241-
test -e $BINUTILS_DIR/libiberty/libiberty.a; then
242-
HSDIS_CFLAGS="-I$BINUTILS_DIR/include -I$BINUTILS_DIR/bfd -DLIBARCH_$OPENJDK_TARGET_CPU_LEGACY_LIB"
245+
test -e $BINUTILS_DIR/libiberty/libiberty.a && \
246+
test -e $BINUTILS_DIR/zlib/libz.a; then
247+
HSDIS_CFLAGS="-DLIBARCH_$OPENJDK_TARGET_CPU_LEGACY_LIB"
248+
if test -n "$BINUTILS_SRC"; then
249+
HSDIS_CFLAGS="$HSDIS_CFLAGS -I$BINUTILS_SRC/include -I$BINUTILS_DIR/bfd"
250+
else
251+
HSDIS_CFLAGS="$HSDIS_CFLAGS -I$BINUTILS_DIR/include -I$BINUTILS_DIR/bfd"
252+
fi
243253
HSDIS_LDFLAGS=""
244254
HSDIS_LIBS="$BINUTILS_DIR/bfd/libbfd.a $BINUTILS_DIR/opcodes/libopcodes.a $BINUTILS_DIR/libiberty/libiberty.a $BINUTILS_DIR/zlib/libz.a"
245255
fi

make/autoconf/lib-tests.m4

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,25 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_GTEST],
5454
AC_MSG_RESULT([no])
5555
AC_MSG_ERROR([Can't find 'googlemock/include/gmock/gmock.h' under ${with_gtest} given with the --with-gtest option.])
5656
else
57-
GTEST_FRAMEWORK_SRC=${with_gtest}
57+
GTEST_FRAMEWORK_SRC=$with_gtest
5858
AC_MSG_RESULT([$GTEST_FRAMEWORK_SRC])
5959
UTIL_FIXUP_PATH([GTEST_FRAMEWORK_SRC])
60+
61+
# Try to verify version. We require 1.8.1, but this can not be directly
62+
# determined. :-( Instead, there are different, incorrect version
63+
# numbers we can look for.
64+
GTEST_VERSION_1="`$GREP GOOGLETEST_VERSION $GTEST_FRAMEWORK_SRC/CMakeLists.txt | $SED -E -e 's/set\(GOOGLETEST_VERSION (.*)\)/\1/'`"
65+
if test "x$GTEST_VERSION_1" != "x1.9.0"; then
66+
AC_MSG_ERROR([gtest at $GTEST_FRAMEWORK_SRC does not seem to be version 1.8.1])
67+
fi
68+
69+
# We cannot grep for "AC_IN*T" as a literal since then m4 will treat it as a macro
70+
# and expand it.
71+
# Additional [] needed to keep m4 from mangling shell constructs.
72+
[ GTEST_VERSION_2="`$GREP -A1 ^.C_INIT $GTEST_FRAMEWORK_SRC/configure.ac | $TAIL -n 1 | $SED -E -e 's/ +\[(.*)],/\1/'`" ]
73+
if test "x$GTEST_VERSION_2" != "x1.8.0"; then
74+
AC_MSG_ERROR([gtest at $GTEST_FRAMEWORK_SRC does not seem to be version 1.8.1 B])
75+
fi
6076
fi
6177
fi
6278
fi

make/autoconf/spec.gmk.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ CONFIGURE_COMMAND_LINE:=@CONFIGURE_COMMAND_LINE@
3535
# The current directory when configure was run
3636
CONFIGURE_START_DIR:=@CONFIGURE_START_DIR@
3737

38+
# How configure was originally called, if not called directly
39+
REAL_CONFIGURE_COMMAND_EXEC_SHORT := @REAL_CONFIGURE_COMMAND_EXEC_SHORT@
40+
REAL_CONFIGURE_COMMAND_EXEC_FULL := @REAL_CONFIGURE_COMMAND_EXEC_FULL@
41+
REAL_CONFIGURE_COMMAND_LINE := @REAL_CONFIGURE_COMMAND_LINE@
42+
3843
# A self-referential reference to this file.
3944
SPEC:=@SPEC@
4045

make/common/MakeBase.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -194,7 +194,7 @@ $(eval $(call SetupLogging))
194194

195195
################################################################################
196196

197-
MAX_PARAMS := 36
197+
MAX_PARAMS := 96
198198
PARAM_SEQUENCE := $(call sequence, 2, $(MAX_PARAMS))
199199

200200
# Template for creating a macro taking named parameters. To use it, assign the

0 commit comments

Comments
 (0)