Skip to content

Commit

Permalink
Merge branch 'master' into matchers-experiment
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java
#	src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java
#	src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java
#	src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
  • Loading branch information
biboudis committed Jun 13, 2023
2 parents a38376b + 5d5ae35 commit 4d9202c
Show file tree
Hide file tree
Showing 3,057 changed files with 172,774 additions and 38,886 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
apt-architecture: 'i386'
# Some multilib libraries do not have proper inter-dependencies, so we have to
# install their dependencies manually.
apt-extra-packages: 'libfreetype6-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libc6-i386'
apt-extra-packages: 'libfreetype6-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libc6-i386 libgcc-s1:i386 libstdc++6:i386'
extra-conf-options: '--with-target-bits=32'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
Expand Down
2 changes: 1 addition & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
project=jdk
jbs=JDK
version=21
version=22

[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
Expand Down
14 changes: 2 additions & 12 deletions bin/idea.sh
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,7 @@ for root in $MODULE_ROOTS; do
root=`wslpath -am $root`
fi

VM_CI="jdk.internal.vm.ci/share/classes"
VM_COMPILER="src/jdk.internal.vm.compiler/share/classes"
if test "${root#*$VM_CI}" != "$root" || test "${root#*$VM_COMPILER}" != "$root"; then
for subdir in "$root"/*; do
if [ -d "$subdir" ]; then
SOURCES=$SOURCES" $SOURCE_PREFIX""$subdir"/src"$SOURCE_POSTFIX"
fi
done
else
SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
fi
SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
done

add_replacement "###SOURCE_ROOTS###" "$SOURCES"
Expand Down Expand Up @@ -274,4 +264,4 @@ $BOOT_JDK/bin/$JAVAC -d $JAVAC_CLASSES -sourcepath $JAVAC_SOURCE_PATH -cp $JAVAC

if [ "x$WSL_DISTRO_NAME" != "x" ]; then
rm -rf $ANT_TEMP
fi
fi
16 changes: 16 additions & 0 deletions doc/building.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ <h1 class="title">Building the JDK</h1>
id="toc-external-library-requirements">External Library Requirements</a>
<ul>
<li><a href="#freetype" id="toc-freetype">FreeType</a></li>
<li><a href="#fontconfig" id="toc-fontconfig">Fontconfig</a></li>
<li><a href="#cups" id="toc-cups">CUPS</a></li>
<li><a href="#x11" id="toc-x11">X11</a></li>
<li><a href="#alsa" id="toc-alsa">ALSA</a></li>
Expand Down Expand Up @@ -323,6 +324,7 @@ <h3 id="building-on-x86">Building on x86</h3>
<p>Even for 32-bit builds, it is recommended to use a 64-bit build
machine, and instead create a 32-bit target using
<code>--with-target-bits=32</code>.</p>
<p>Note: The Windows 32-bit x86 port is deprecated and may be removed in a future release.</p>
<h3 id="building-on-aarch64">Building on aarch64</h3>
<p>At a minimum, a machine with 8 cores is advisable, as well as 8 GB of
RAM. (The more cores to use, the more memory you need.) At least 6 GB of
Expand Down Expand Up @@ -399,6 +401,7 @@ <h3 id="windows">Windows</h3>
use <code>--with-msvcr-dll=/cygdrive/c/msvcr100.dll</code> rather than
<code>--with-msvcr-dll=c:\msvcr100.dll</code>. For details on this
conversion, see the section on <a href="#fixpath">Fixpath</a>.</p>
<p>Note: The Windows 32-bit x86 port is deprecated and may be removed in a future release.</p>
<h4 id="cygwin">Cygwin</h4>
<p>A functioning <a href="http://www.cygwin.com/">Cygwin</a> environment
is required for building the JDK on Windows. If you have a 64-bit OS, we
Expand Down Expand Up @@ -677,6 +680,19 @@ <h3 id="freetype">FreeType</h3>
<p>Use <code>--with-freetype-include=&lt;path&gt;</code> and
<code>--with-freetype-lib=&lt;path&gt;</code> if <code>configure</code>
does not automatically locate the platform FreeType files.</p>
<h3 id="fontconfig">Fontconfig</h3>
<p>Fontconfig from <a href="http://fontconfig.org">freedesktop.org
Fontconfig</a> is required on all platforms except Windows and
macOS.</p>
<ul>
<li>To install on an apt-based Linux, try running
<code>sudo apt-get install libfontconfig-dev</code>.</li>
<li>To install on an rpm-based Linux, try running
<code>sudo yum install fontconfig-devel</code>.</li>
</ul>
<p>Use <code>--with-fontconfig-include=&lt;path&gt;</code> and
<code>--with-fontconfig=&lt;path&gt;</code> if <code>configure</code>
does not automatically locate the platform Fontconfig files.</p>
<h3 id="cups">CUPS</h3>
<p>CUPS, <a href="http://www.cups.org">Common UNIX Printing System</a>
header files are required on all platforms, except Windows. Often these
Expand Down
17 changes: 17 additions & 0 deletions doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ space is required.
Even for 32-bit builds, it is recommended to use a 64-bit build machine, and
instead create a 32-bit target using `--with-target-bits=32`.

Note: The Windows 32-bit x86 port is deprecated and may be removed in a future release.

### Building on aarch64

At a minimum, a machine with 8 cores is advisable, as well as 8 GB of RAM.
Expand Down Expand Up @@ -199,6 +201,8 @@ rule also applies to input to the build system, e.g. in arguments to
`--with-msvcr-dll=c:\msvcr100.dll`. For details on this conversion, see the section
on [Fixpath](#fixpath).

Note: The Windows 32-bit x86 port is deprecated and may be removed in a future release.

#### Cygwin

A functioning [Cygwin](http://www.cygwin.com/) environment is required for
Expand Down Expand Up @@ -471,6 +475,19 @@ rather than bundling the JDK's own copy.
Use `--with-freetype-include=<path>` and `--with-freetype-lib=<path>`
if `configure` does not automatically locate the platform FreeType files.

### Fontconfig

Fontconfig from [freedesktop.org Fontconfig](http://fontconfig.org) is required
on all platforms except Windows and macOS.

* To install on an apt-based Linux, try running `sudo apt-get install
libfontconfig-dev`.
* To install on an rpm-based Linux, try running `sudo yum install
fontconfig-devel`.

Use `--with-fontconfig-include=<path>` and `--with-fontconfig=<path>`
if `configure` does not automatically locate the platform Fontconfig files.

### CUPS

CUPS, [Common UNIX Printing System](http://www.cups.org) header files are
Expand Down
1 change: 1 addition & 0 deletions make/CompileInterimLangtools.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ define SetupInterimModule
EXCLUDES := sun javax/tools/snippet-files, \
EXCLUDE_FILES := $(TOPDIR)/src/$1/share/classes/module-info.java \
$(TOPDIR)/src/$1/share/classes/javax/tools/ToolProvider.java \
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/Main.java \
Standard.java, \
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java \
$($1.interim_EXTRA_FILES), \
Expand Down
2 changes: 0 additions & 2 deletions make/Docs.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,13 @@ JAVA_WARNINGS_ARE_ERRORS ?= -Werror
JAVADOC_OPTIONS := -use -keywords -notimestamp \
-encoding ISO-8859-1 -docencoding UTF-8 -breakiterator \
-splitIndex --system none -javafx --expand-requires transitive \
--enable-preview -source $(JDK_SOURCE_TARGET_VERSION) \
--override-methods=summary \
--no-external-specs-page

# The reference options must stay stable to allow for comparisons across the
# development cycle.
REFERENCE_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
-encoding ISO-8859-1 -breakiterator -splitIndex --system none \
--enable-preview -source $(JDK_SOURCE_TARGET_VERSION) \
-html5 -javafx --expand-requires transitive \
--no-external-specs-page

Expand Down
5 changes: 5 additions & 0 deletions make/Global.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ test-prebuilt:
$(MAKE) --no-print-directory -r -R -I make/common/ -f make/RunTestsPrebuilt.gmk \
test-prebuilt CUSTOM_MAKE_DIR=$(CUSTOM_MAKE_DIR) TEST="$(TEST)" )

test-prebuilt-with-exit-code:
@( cd $(topdir) && \
$(MAKE) --no-print-directory -r -R -I make/common/ -f make/RunTestsPrebuilt.gmk \
test-prebuilt-with-exit-code CUSTOM_MAKE_DIR=$(CUSTOM_MAKE_DIR) TEST="$(TEST)" )

# Alias for backwards compatibility
run-test-prebuilt: test-prebuilt

Expand Down
11 changes: 1 addition & 10 deletions make/RunTests.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -595,16 +595,7 @@ define SetupRunMicroTestBody
endif

# Set library path for native dependencies
$1_JMH_JVM_ARGS := -Djava.library.path=$$(TEST_IMAGE_DIR)/micro/native \
--add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
--add-exports java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile.attribute=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile.constantpool=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile.instruction=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile.java.lang.constant=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile.components=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile.impl=ALL-UNNAMED
$1_JMH_JVM_ARGS := -Djava.library.path=$$(TEST_IMAGE_DIR)/micro/native

ifneq ($$(MICRO_VM_OPTIONS)$$(MICRO_JAVA_OPTIONS), )
$1_JMH_JVM_ARGS += $$(MICRO_VM_OPTIONS) $$(MICRO_JAVA_OPTIONS)
Expand Down
5 changes: 5 additions & 0 deletions make/RunTestsPrebuilt.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ test-prebuilt:
@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
TEST="$(TEST)"

test-prebuilt-with-exit-code: test-prebuilt
@if test -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error ; then \
exit 1 ; \
fi

all: test-prebuilt

.PHONY: default all test-prebuilt
36 changes: 32 additions & 4 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1'
elif test "x$OPENJDK_TARGET_OS" = xaix; then
# Linking is different on aix
SHARED_LIBRARY_FLAGS="-shared -Wl,-bM:SRE -Wl,-bnoentry"
SET_EXECUTABLE_ORIGIN=""
SET_SHARED_LIBRARY_ORIGIN=''
SET_SHARED_LIBRARY_NAME=''
SET_SHARED_LIBRARY_MAPFILE=''
else
# Default works for linux, might work on other platforms as well.
SHARED_LIBRARY_FLAGS='-shared'
Expand Down Expand Up @@ -206,7 +214,6 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
WARNINGS_ENABLE_ALL="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
DISABLED_WARNINGS="unknown-warning-option unused-parameter unused"
;;
xlc)
Expand Down Expand Up @@ -284,9 +291,15 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
C_O_FLAG_NONE="${C_O_FLAG_NONE} ${DISABLE_FORTIFY_CFLAGS}"
fi
elif test "x$TOOLCHAIN_TYPE" = xclang; then
C_O_FLAG_HIGHEST_JVM="-O3"
C_O_FLAG_HIGHEST="-O3"
C_O_FLAG_HI="-O3"
if test "x$OPENJDK_TARGET_OS" = xaix; then
C_O_FLAG_HIGHEST_JVM="-O3 -finline-functions"
C_O_FLAG_HIGHEST="-O3 -finline-functions"
C_O_FLAG_HI="-O3 -finline-functions"
else
C_O_FLAG_HIGHEST_JVM="-O3"
C_O_FLAG_HIGHEST="-O3"
C_O_FLAG_HI="-O3"
fi
C_O_FLAG_NORM="-O2"
C_O_FLAG_DEBUG_JVM="-O0"
C_O_FLAG_SIZE="-Os"
Expand Down Expand Up @@ -458,6 +471,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
# so for debug we build with '-qpic=large -bbigtoc'.
DEBUG_CFLAGS_JVM="-qpic=large"
fi
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
DEBUG_CFLAGS_JVM="-fpic -mcmodel=large"
fi
fi
if test "x$DEBUG_LEVEL" != xrelease; then
Expand Down Expand Up @@ -493,6 +509,12 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
-fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer"
fi
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
# clang compiler on aix needs -ffunction-sections
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -ftls-model -fno-math-errno -fstack-protector"
TOOLCHAIN_CFLAGS_JDK="-ffunction-sections -fsigned-char -fstack-protector"
fi
if test "x$TOOLCHAIN_TYPE" = xgcc; then
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fstack-protector"
TOOLCHAIN_CFLAGS_JDK="-pipe -fstack-protector"
Expand Down Expand Up @@ -601,6 +623,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
PICFLAG="-fPIC"
PIEFLAG="-fPIE"
elif test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
JVM_PICFLAG="-fpic -mcmodel=large -Wl,-bbigtoc
JDK_PICFLAG="-fpic
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
# '-qpic' defaults to 'qpic=small'. This means that the compiler generates only
# one instruction for accessing the TOC. If the TOC grows larger than 64K, the linker
Expand Down Expand Up @@ -746,6 +771,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
$1_CFLAGS_CPU_JDK="${$1_CFLAGS_CPU_JDK} -fno-omit-frame-pointer"
fi
fi
if test "x$OPENJDK_TARGET_OS" = xaix; then
$1_CFLAGS_CPU="-mcpu=pwr8"
fi
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
if test "x$FLAGS_CPU" = xppc64; then
Expand Down
19 changes: 16 additions & 3 deletions make/autoconf/flags-ldflags.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2023, 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
Expand Down Expand Up @@ -75,7 +75,11 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
elif test "x$TOOLCHAIN_TYPE" = xclang; then
BASIC_LDFLAGS_JVM_ONLY="-mno-omit-leaf-frame-pointer -mstack-alignment=16 \
-fPIC"
if test "x$OPENJDK_TARGET_OS" = xaix; then
BASIC_LDFLAGS="-Wl,-b64 -Wl,-brtl -Wl,-bnorwexec -Wl,-bnolibpath -Wl,-bnoexpall \
-Wl,-bernotok -Wl,-bdatapsize:64k -Wl,-btextpsize:64k -Wl,-bstackpsize:64k"
BASIC_LDFLAGS_JVM_ONLY="$BASIC_LDFLAGS_JVM_ONLY -Wl,-lC_r -Wl,-bbigtoc"
fi
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
BASIC_LDFLAGS="-b64 -brtl -bnorwexec -bnolibpath -bnoexpall -bernotok -btextpsize:64K \
-bdatapsize:64K -bstackpsize:64K"
Expand All @@ -88,7 +92,8 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
BASIC_LDFLAGS_JVM_ONLY="-opt:icf,8 -subsystem:windows"
fi
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
if (test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang) \
&& test "x$OPENJDK_TARGET_OS" != xaix; then
if test -n "$HAS_NOEXECSTACK"; then
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,noexecstack"
fi
Expand Down Expand Up @@ -116,6 +121,14 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
if test "x$DEBUG_LEVEL" != xrelease; then
DEBUGLEVEL_LDFLAGS_JVM_ONLY="$DEBUGLEVEL_LDFLAGS_JVM_ONLY -bbigtoc"
fi
elif test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
# We need '-fpic' or '-fpic -mcmodel=large -Wl,-bbigtoc' if the TOC overflows.
# Hotspot now overflows its 64K TOC (currently only for debug),
# so we build with '-fpic -mcmodel=large -Wl,-bbigtoc'.
if test "x$DEBUG_LEVEL" != xrelease; then
DEBUGLEVEL_LDFLAGS_JVM_ONLY="$DEBUGLEVEL_LDFLAGS_JVM_ONLY -Wl,-bbigtoc"
fi
fi
# Setup LDFLAGS for linking executables
Expand Down
16 changes: 16 additions & 0 deletions make/autoconf/platform.m4
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,22 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET],
PLATFORM_SET_MODULE_TARGET_OS_VALUES
PLATFORM_SET_RELEASE_FILE_OS_VALUES
PLATFORM_SETUP_LEGACY_VARS
PLATFORM_CHECK_DEPRECATION
])

AC_DEFUN_ONCE([PLATFORM_CHECK_DEPRECATION],
[
AC_ARG_ENABLE(deprecated-ports, [AS_HELP_STRING([--enable-deprecated-ports@<:@=yes/no@:>@],
[Suppress the error when configuring for a deprecated port @<:@no@:>@])])
AC_REQUIRE([PLATFORM_EXTRACT_TARGET_AND_BUILD])
if test "x$OPENJDK_TARGET_OS" = xwindows && test "x$OPENJDK_TARGET_CPU" = xx86; then
if test "x$enable_deprecated_ports" = "xyes"; then
AC_MSG_WARN([The Windows 32-bit x86 port is deprecated and may be removed in a future release.])
else
AC_MSG_ERROR(m4_normalize([The Windows 32-bit x86 port is deprecated and may be removed in a future release.
Use --enable-deprecated-ports=yes to suppress this error.]))
fi
fi
])

AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION],
Expand Down
Loading

0 comments on commit 4d9202c

Please sign in to comment.