diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000000..8cf0bd8d62a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +root = true + +[*] +charset = utf-8 + +[*.{cpp,hpp,c,h,java,cc,hh,m,mm,S,md,properties,gmk,m4,ac}] +trim_trailing_whitespace = true + +[Makefile] +trim_trailing_whitespace = true + +[src/hotspot/**.{cpp,hpp,h}] +indent_style = space +indent_size = 2 diff --git a/.gitattributes b/.gitattributes index ebb586628c3..5a18aa21d98 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ * -text +* encoding=utf-8 *.java diff=java *.c diff=cpp *.h diff=cpp diff --git a/.github/actions/do-build/action.yml b/.github/actions/do-build/action.yml index 252105f29fd..6f2c2ce0218 100644 --- a/.github/actions/do-build/action.yml +++ b/.github/actions/do-build/action.yml @@ -1,5 +1,5 @@ # -# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2022, 2025, 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 @@ -42,7 +42,7 @@ runs: - name: 'Build' id: build run: > - make LOG=info ${{ inputs.make-target }} + make -k LOG=info ${{ inputs.make-target }} || bash ./.github/scripts/gen-build-failure-report.sh "$GITHUB_STEP_SUMMARY" shell: bash diff --git a/.github/actions/get-bundles/action.yml b/.github/actions/get-bundles/action.yml index aaec9a6d19f..270d15159a0 100644 --- a/.github/actions/get-bundles/action.yml +++ b/.github/actions/get-bundles/action.yml @@ -32,10 +32,16 @@ inputs: debug-suffix: description: 'File name suffix denoting debug level, possibly empty' required: false + static-suffix: + description: 'Static bundle file name suffix' + required: false outputs: jdk-path: description: 'Path to the installed JDK bundle' value: ${{ steps.path-name.outputs.jdk }} + static-jdk-path: + description: 'Path to the installed static JDK bundle' + value: ${{ steps.path-name.outputs.static_jdk }} symbols-path: description: 'Path to the installed symbols bundle' value: ${{ steps.path-name.outputs.symbols }} @@ -61,6 +67,15 @@ runs: path: bundles if: steps.download-bundles.outcome == 'failure' + - name: 'Download static bundles artifact' + id: download-static-bundles + uses: actions/download-artifact@v4 + with: + name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }} + path: bundles + continue-on-error: true + if: ${{ inputs.static-suffix == '-static' }} + - name: 'Unpack bundles' run: | if [[ -e bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}.zip ]]; then @@ -75,6 +90,20 @@ runs: tar -xf bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz -C bundles/jdk fi + if [[ '${{ inputs.static-suffix }}' == '-static' ]]; then + if [[ -e bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}.zip ]]; then + echo 'Unpacking static jdk bundle...' + mkdir -p bundles/static-jdk + unzip -q bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}.zip -d bundles/static-jdk + fi + + if [[ -e bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}.tar.gz ]]; then + echo 'Unpacking static jdk bundle...' + mkdir -p bundles/static-jdk + tar -xf bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}.tar.gz -C bundles/static-jdk + fi + fi + if [[ -e bundles/symbols-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz ]]; then echo 'Unpacking symbols bundle...' mkdir -p bundles/symbols @@ -106,4 +135,12 @@ runs: echo "jdk=$jdk_dir" >> $GITHUB_OUTPUT echo "symbols=$symbols_dir" >> $GITHUB_OUTPUT echo "tests=$tests_dir" >> $GITHUB_OUTPUT + + if [[ '${{ inputs.static-suffix }}' == '-static' ]]; then + static_jdk_dir="$GITHUB_WORKSPACE/$(dirname $(find bundles/static-jdk -name bin -type d))" + if [[ '${{ runner.os }}' == 'Windows' ]]; then + static_jdk_dir="$(cygpath $static_jdk_dir)" + fi + echo "static_jdk=$static_jdk_dir" >> $GITHUB_OUTPUT + fi shell: bash diff --git a/.github/actions/upload-bundles/action.yml b/.github/actions/upload-bundles/action.yml index 30f4ac03c1e..dfa994baac0 100644 --- a/.github/actions/upload-bundles/action.yml +++ b/.github/actions/upload-bundles/action.yml @@ -35,6 +35,9 @@ inputs: bundle-suffix: description: 'Bundle name suffix, possibly empty' required: false + static-suffix: + description: 'Static JDK bundle name suffix, possibly empty' + required: false runs: using: composite @@ -46,6 +49,8 @@ runs: # Rename bundles to consistent names jdk_bundle_zip="$(ls build/*/bundles/jdk-*_bin${{ inputs.debug-suffix }}.zip 2> /dev/null || true)" jdk_bundle_tar_gz="$(ls build/*/bundles/jdk-*_bin${{ inputs.debug-suffix }}.tar.gz 2> /dev/null || true)" + static_jdk_bundle_zip="$(ls build/*/bundles/static-jdk-*_bin${{ inputs.debug-suffix }}.zip 2> /dev/null || true)" + static_jdk_bundle_tar_gz="$(ls build/*/bundles/static-jdk-*_bin${{ inputs.debug-suffix }}.tar.gz 2> /dev/null || true)" symbols_bundle="$(ls build/*/bundles/jdk-*_bin${{ inputs.debug-suffix }}-symbols.tar.gz 2> /dev/null || true)" tests_bundle="$(ls build/*/bundles/jdk-*_bin-tests${{ inputs.debug-suffix }}.tar.gz 2> /dev/null || true)" static_libs_bundle="$(ls build/*/bundles/jdk-*_bin-static-libs${{ inputs.debug-suffix }}.tar.gz 2> /dev/null || true)" @@ -58,6 +63,12 @@ runs: if [[ "$jdk_bundle_tar_gz" != "" ]]; then mv "$jdk_bundle_tar_gz" "bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz" fi + if [[ "$static_jdk_bundle_zip" != "" ]]; then + mv "$static_jdk_bundle_zip" "bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}.zip" + fi + if [[ "$static_jdk_bundle_tar_gz" != "" ]]; then + mv "$static_jdk_bundle_tar_gz" "bundles/jdk-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}.tar.gz" + fi if [[ "$symbols_bundle" != "" ]]; then mv "$symbols_bundle" "bundles/symbols-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz" fi @@ -68,7 +79,7 @@ runs: mv "$static_libs_bundle" "bundles/static-libs-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz" fi - if [[ "$jdk_bundle_zip$jdk_bundle_tar_gz$symbols_bundle$tests_bundle$static_libs_bundle" != "" ]]; then + if [[ "$jdk_bundle_zip$jdk_bundle_tar_gz$static_jdk_bundle_zip$static_jdk_bundle_tar_gz$symbols_bundle$tests_bundle$static_libs_bundle" != "" ]]; then echo 'bundles-found=true' >> $GITHUB_OUTPUT else echo 'bundles-found=false' >> $GITHUB_OUTPUT @@ -78,7 +89,7 @@ runs: - name: 'Upload bundles artifact' uses: actions/upload-artifact@v4 with: - name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.bundle-suffix }} + name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}${{ inputs.bundle-suffix }} path: bundles retention-days: 1 if: steps.bundles.outputs.bundles-found == 'true' diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 101668b2bd5..9c991eed419 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -64,6 +64,9 @@ on: bundle-suffix: required: false type: string + static-suffix: + required: false + type: string jobs: build-linux: @@ -143,3 +146,4 @@ jobs: platform: ${{ inputs.platform }} debug-suffix: "${{ matrix.debug-level == 'debug' && '-debug' || '' }}" bundle-suffix: ${{ inputs.bundle-suffix }} + static-suffix: ${{ inputs.static-suffix }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8dce1d214dc..6ca64bb82d0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -231,16 +231,14 @@ jobs: uses: ./.github/workflows/build-linux.yml with: platform: linux-x64 - make-target: 'static-jdk-image' + make-target: 'static-jdk-bundles' # There are issues with fastdebug static build in GHA due to space limit. # Only do release build for now. debug-levels: '[ "release" ]' gcc-major-version: '10' configure-arguments: ${{ github.event.inputs.configure-arguments }} make-arguments: ${{ github.event.inputs.make-arguments }} - # It currently doesn't produce any bundles, but probably will do in - # the future. - bundle-suffix: "-static" + static-suffix: "-static" if: needs.prepare.outputs.linux-x64 == 'true' build-linux-x64-static-libs: @@ -361,6 +359,19 @@ jobs: platform: linux-x64 bootjdk-platform: linux-x64 runs-on: ubuntu-22.04 + debug-suffix: -debug + + test-linux-x64-static: + name: linux-x64-static + needs: + - build-linux-x64 + - build-linux-x64-static + uses: ./.github/workflows/test.yml + with: + platform: linux-x64 + bootjdk-platform: linux-x64 + runs-on: ubuntu-22.04 + static-suffix: "-static" test-macos-aarch64: name: macos-aarch64 @@ -372,6 +383,7 @@ jobs: bootjdk-platform: macos-aarch64 runs-on: macos-14 xcode-toolset-version: '15.4' + debug-suffix: -debug test-windows-x64: name: windows-x64 @@ -382,3 +394,4 @@ jobs: platform: windows-x64 bootjdk-platform: windows-x64 runs-on: windows-2019 + debug-suffix: -debug diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 99aaf9650a0..665ae224372 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,6 +40,12 @@ on: xcode-toolset-version: required: false type: string + debug-suffix: + required: false + type: string + static-suffix: + required: false + type: string env: # These are needed to make the MSYS2 bash work properly @@ -86,35 +92,35 @@ jobs: - test-name: 'hs/tier1 common' test-suite: 'test/hotspot/jtreg/:tier1_common' - debug-suffix: -debug + debug-suffix: ${{ inputs.debug-suffix }} - test-name: 'hs/tier1 compiler part 1' test-suite: 'test/hotspot/jtreg/:tier1_compiler_1' - debug-suffix: -debug + debug-suffix: ${{ inputs.debug-suffix }} - test-name: 'hs/tier1 compiler part 2' test-suite: 'test/hotspot/jtreg/:tier1_compiler_2' - debug-suffix: -debug + debug-suffix: ${{ inputs.debug-suffix }} - test-name: 'hs/tier1 compiler part 3' test-suite: 'test/hotspot/jtreg/:tier1_compiler_3' - debug-suffix: -debug + debug-suffix: ${{ inputs.debug-suffix }} - test-name: 'hs/tier1 gc' test-suite: 'test/hotspot/jtreg/:tier1_gc' - debug-suffix: -debug + debug-suffix: ${{ inputs.debug-suffix }} - test-name: 'hs/tier1 runtime' test-suite: 'test/hotspot/jtreg/:tier1_runtime' - debug-suffix: -debug + debug-suffix: ${{ inputs.debug-suffix }} - test-name: 'hs/tier1 serviceability' test-suite: 'test/hotspot/jtreg/:tier1_serviceability' - debug-suffix: -debug + debug-suffix: ${{ inputs.debug-suffix }} - test-name: 'lib-test/tier1' test-suite: 'test/lib-test/:tier1' - debug-suffix: -debug + debug-suffix: ${{ inputs.debug-suffix }} steps: - name: 'Checkout the JDK source' @@ -140,6 +146,7 @@ jobs: with: platform: ${{ inputs.platform }} debug-suffix: ${{ matrix.debug-suffix }} + static-suffix: ${{ inputs.static-suffix }} - name: 'Install dependencies' run: | @@ -160,6 +167,21 @@ jobs: else echo "value=$PATH" >> $GITHUB_OUTPUT fi + if [[ '${{ inputs.static-suffix }}' == '-static' ]]; then + echo "static-hotspot-problemlist-path=`pwd`/test/hotspot/jtreg/ProblemList-StaticJdk.txt" >> $GITHUB_OUTPUT + echo "static-jdk-problemlist-path=`pwd`/test/jdk/ProblemList-StaticJdk.txt" >> $GITHUB_OUTPUT + echo "static-langtools-problemlist-path=`pwd`/test/langtools/ProblemList-StaticJdk.txt" >> $GITHUB_OUTPUT + echo "static-lib-test-problemlist-path=`pwd`/test/lib-test/ProblemList-StaticJdk.txt" >> $GITHUB_OUTPUT + fi + + - name: 'Set Extra Options' + id: extra-options + run: | + if [[ '${{ inputs.static-suffix }}' == '-static' ]]; then + echo "test-jdk=JDK_UNDER_TEST=${{ steps.bundles.outputs.static-jdk-path }}" >> $GITHUB_OUTPUT + echo "compile-jdk=JDK_FOR_COMPILE=${{ steps.bundles.outputs.jdk-path }}" >> $GITHUB_OUTPUT + echo "extra-problem-lists=EXTRA_PROBLEM_LISTS=${{ steps.path.outputs.static-hotspot-problemlist-path }}%20${{ steps.path.outputs.static-jdk-problemlist-path }}%20${{ steps.path.outputs.static-langtools-problemlist-path }}%20${{ steps.path.outputs.static-lib-test-problemlist-path }}" >> $GITHUB_OUTPUT + fi - name: 'Run tests' id: run-tests @@ -171,7 +193,9 @@ jobs: JDK_IMAGE_DIR=${{ steps.bundles.outputs.jdk-path }} SYMBOLS_IMAGE_DIR=${{ steps.bundles.outputs.symbols-path }} TEST_IMAGE_DIR=${{ steps.bundles.outputs.tests-path }} - JTREG='JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash;VERBOSE=fail,error,time;KEYWORDS=!headful' + ${{ steps.extra-options.outputs.test-jdk }} + ${{ steps.extra-options.outputs.compile-jdk }} + JTREG='JAVA_OPTIONS=-XX:-CreateCoredumpOnCrash;VERBOSE=fail,error,time;KEYWORDS=!headful;${{ steps.extra-options.outputs.extra-problem-lists }}' && bash ./.github/scripts/gen-test-summary.sh "$GITHUB_STEP_SUMMARY" "$GITHUB_OUTPUT" env: PATH: ${{ steps.path.outputs.value }} @@ -204,7 +228,7 @@ jobs: echo '::warning ::Missing test-support directory' fi - artifact_name="results-${{ inputs.platform }}-$(echo ${{ matrix.test-name }} | tr '/ ' '__')" + artifact_name="results-${{ inputs.platform }}-$(echo ${{ matrix.test-name }}${{ inputs.static-suffix }} | tr '/ ' '__')" echo "artifact-name=$artifact_name" >> $GITHUB_OUTPUT if: always() diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4a338235c1d..98ede25b88d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,3 @@ # Contributing to the JDK -Please see the [OpenJDK Developers’ Guide](https://openjdk.org/guide/). +Please see the [OpenJDK Developers' Guide](https://openjdk.org/guide/). diff --git a/doc/building.html b/doc/building.html index 7157848f561..da8465bc532 100644 --- a/doc/building.html +++ b/doc/building.html @@ -282,9 +282,34 @@ possible, use an SSD. The build process is very disk intensive, and having slow disk access will significantly increase build times. If you need to use a network share for the source code, see below for suggestions on how to keep the build artifacts on a local disk.
-On Windows, if using Cygwin, extra care -must be taken to make sure the environment is consistent. It is -recommended that you follow this procedure:
+UTF-8 support is needed to compile the JDK. On Unix systems, this
+typically means that the C.UTF-8 or
+en_US.UTF-8 locale needs to be available. For Windows
+users, please see the section on Locale
+Requirements below.
On Windows, extra care must be taken to have a smooth building +experience:
+Make sure that all relevant paths have short names. Short names
+are used by the build system to create space-free alternative paths.
+Short name creation is enabled per volume. The default setting can be
+checked with the command: fsutil 8dot3name query. If short
+name creation was turned off when a directory was created, it will not
+have a short name. Whether a short name exists can be checked by running
+dir /X in the containing directory (in cmd.exe). If a short
+path is present you should see something like 'ASDF~1' being displayed
+in one of the columns of the ouput. If a directory is missing a short
+name, the safest way to get one is to enable short names for that
+particular volume with
+fsutil 8dot3name set <drive letter>: 0 (note that
+you need to run as administrator for this), and then re-create the
+particular directory. A short name should be generated automatically
+then. Another option is to manually assign a short name to the directory
+using
+fsutil file setShortName <path> <short name>.
If using Cygwin, you must make sure the +file permissions and attributes between Windows and Cygwin are +consistent. It is recommended that you follow this procedure:
Create the directory that is going to contain the top directory
of the JDK clone by using the mkdir command in the Cygwin
@@ -294,6 +319,9 @@ it's children will inherit those attributes.
Do not put the JDK clone in a path under your Cygwin home directory. This is especially important if your user name contains spaces and/or mixed upper and lower case letters.
Failure to follow these procedures might result in hard-to-debug +build problems.
You need to install a git client. You have two choices, Cygwin git or Git for Windows. Unfortunately there are pros and cons with each choice.
@@ -311,9 +339,7 @@ It does work well with the Skara CLI tooling, however. To alleviate the line ending problems, make sure you setcore.autocrlf to
false (this is asked during installation).Failure to follow this procedure might result in hard-to-debug build -problems.
+The JDK is a massive project, and require machines ranging from @@ -376,7 +402,7 @@ to date at the time of writing.
It is recommended that you use at least macOS 13 (Ventura) and Xcode -14, but earlier versions may also work.
+It is recommended that you use at least macOS 14 and Xcode 15.4, but +earlier versions may also work.
The standard macOS environment contains the basic tooling needed to build, but for external libraries a package manager is recommended. The JDK uses homebrew in the examples, but @@ -586,15 +612,15 @@ to compile successfully without issues.
The minimum accepted version of gcc is 10.0. Older versions will not
be accepted by configure.
The JDK is currently known to compile successfully with gcc version -13.2 or newer.
+14.2 or newer.In general, any version between these two should be usable.
The minimum accepted version of clang is 13. Older versions will not @@ -1722,6 +1748,20 @@ packages in the sysroot, configure the build with --with-devkit=$DEVKIT \ --with-sysroot=$SYSROOT
and run make normally.
The Visual Studio Build Tools can be used for building the JDK +without a full Visual Studio installation. To set up the Visual Studio +2022 Build Tools on a Windows AArch64 machine for a native build, launch +the installer as follows in a Windows command prompt:
+vs_buildtools.exe --quiet --wait --norestart --nocache ^
+--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" ^
+--add Microsoft.VisualStudio.Component.VC.CoreBuildTools ^
+--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 ^
+--add Microsoft.VisualStudio.Component.Windows11SDK.22621
+To generate Windows AArch64 builds using Cygwin on a Windows x64
+machine, you must set the proper target platform by adding
+--openjdk-target=aarch64-unknown-cygwin to your configure
+command line.
Building the JDK requires a lot of horsepower. Some of the build
tools can be adjusted to utilize more or less of resources such as
diff --git a/doc/building.md b/doc/building.md
index 04db6e94d1c..1a9fe6b2e78 100644
--- a/doc/building.md
+++ b/doc/building.md
@@ -83,19 +83,44 @@ on where and how to check out the source code.
for the source code, see below for suggestions on how to keep the build
artifacts on a local disk.
-* On Windows, if using [Cygwin](#cygwin), extra care must be taken to make sure
- the environment is consistent. It is recommended that you follow this
- procedure:
+* UTF-8 support is needed to compile the JDK. On Unix systems, this typically
+ means that the `C.UTF-8` or `en_US.UTF-8` locale needs to be available. For
+ Windows users, please see the section on [Locale
+ Requirements](#locale-requirements) below.
- * Create the directory that is going to contain the top directory of the JDK
- clone by using the `mkdir` command in the Cygwin bash shell. That is, do
- *not* create it using Windows Explorer. This will ensure that it will have
- proper Cygwin attributes, and that it's children will inherit those
- attributes.
+* On Windows, extra care must be taken to have a smooth building experience:
- * Do not put the JDK clone in a path under your Cygwin home directory. This
- is especially important if your user name contains spaces and/or mixed
- upper and lower case letters.
+ * Make sure that all relevant paths have short names. Short names are used by
+ the build system to create space-free alternative paths. Short name
+ creation is enabled per volume. The default setting can be checked with the
+ command: `fsutil 8dot3name query`. If short name creation was turned off
+ when a directory was created, it will not have a short name. Whether a
+ short name exists can be checked by running `dir /X` in the containing
+ directory (in cmd.exe). If a short path is present you should see something
+ like 'ASDF~1' being displayed in one of the columns of the ouput. If a
+ directory is missing a short name, the safest way to get one is to enable
+ short names for that particular volume with `fsutil 8dot3name set
Proposed changes should be discussed on the HotSpot Developers mailing +list. Changes are likely to be cautious and incremental, since HotSpot +coders have been using these guidelines for years.
+Substantive changes are approved by rough consensus +of the HotSpot Group +Members. The Group Lead determines whether consensus has been +reached.
+Editorial changes (changes that only affect the description of +HotSpot style, not its substance) do not require the full consensus +gathering process. The normal HotSpot pull request process may be used +for editorial changes, with the additional requirement that the +requisite reviewers are also HotSpot Group Members.
Some programmers seem to have lexers and even C preprocessors installed directly behind their eyeballs. The rest of us require code @@ -124,7 +140,7 @@ conforms locally to its own peculiar conventions, it is not worth reformatting the whole thing. Also consider separating changes that make extensive stylistic updates from those which make functional changes.
-Many of the guidelines mentioned here have (sometimes widespread) counterexamples in the HotSpot code base. Finding a counterexample is not sufficient justification for new code to follow the counterexample @@ -137,20 +153,6 @@ bring it up for discussion and possible change. The architectural rule, of course, is "When in Rome do as the Romans". Sometimes in the suburbs of Rome the rules are a little different; these differences can be pointed out here.
-Proposed changes should be discussed on the HotSpot Developers mailing -list. Changes are likely to be cautious and incremental, since HotSpot -coders have been using these guidelines for years.
-Substantive changes are approved by rough consensus -of the HotSpot Group -Members. The Group Lead determines whether consensus has been -reached.
-Editorial changes (changes that only affect the description of -HotSpot style, not its substance) do not require the full consensus -gathering process. The normal HotSpot pull request process may be used -for editorial changes, with the additional requirement that the -requisite reviewers are also HotSpot Group Members.
Prefer having checks inside test code.
Not only does having test logic outside, e.g. verification method, depending on asserts in product code contradict with several items above -but also decreases test’s readability and stability. It is much easier +but also decreases test's readability and stability. It is much easier to understand that a test is testing when all testing logic is located inside a test or nearby in shared test libraries. As a rule of thumb, the closer a check to a test, the better.
@@ -198,7 +198,7 @@ the closer a check to a test, the better.Prefer EXPECT over ASSERT if possible.
This is related to the informativeness
property of tests, information for other checks can help to better
-localize a defect’s root-cause. One should use ASSERT if it
+localize a defect's root-cause. One should use ASSERT if it
is impossible to continue test execution or if it does not make much
sense. Later in the text, EXPECT forms will be used to
refer to both ASSERT/EXPECT.
eps.
Use string special macros for C strings comparisons.
-EXPECT_EQ just compares pointers’ values, which is
+
EXPECT_EQ just compares pointers' values, which is
hardly what one wants comparing C strings. GoogleTest provides
EXPECT_STREQ and EXPECT_STRNE macros to
compare C string contents. There are also case-insensitive versions
@@ -293,7 +293,7 @@ subsystem, etc.
This naming scheme helps to find tests, filter them and simplifies
test failure analysis. For example, class Foo - test group
Foo, compiler logging subsystem - test group
-CompilerLogging, G1 GC — test group G1GC, and
+CompilerLogging, G1 GC - test group G1GC, and
so forth.
A test file must have test_ prefix and .cpp
@@ -345,7 +345,7 @@ name starts or ends with an underscore are enough to be safe.
All test purpose friends should have either Test or
Testable suffix.
It greatly simplifies understanding of friendship’s purpose and +
It greatly simplifies understanding of friendship's purpose and
allows statically check that private members are not exposed
unexpectedly. Having FooTest as a friend of
Foo without any comments will be understood as a necessary
@@ -435,7 +435,7 @@ inapplicable tests.
Restore changed flags.
It is quite common for tests to configure JVM in a certain way
-changing flags’ values. GoogleTest provides two ways to set up
+changing flags' values. GoogleTest provides two ways to set up
environment before a test and restore it afterward: using either
constructor and destructor or SetUp and
TearDown functions. Both ways require to use a test fixture
@@ -444,7 +444,7 @@ class, which sometimes is too wordy. The simpler facilities like
be used in such cases to restore/set values.
Caveats:
Changing a flag’s value could break the invariants between flags' +
Changing a flag's value could break the invariants between flags' values and hence could lead to unexpected/unsupported JVM state.
FLAG_SET_* macros can change more than one flag (in
diff --git a/doc/hotspot-unit-tests.md b/doc/hotspot-unit-tests.md
index e1222baa2e3..69a95307109 100644
--- a/doc/hotspot-unit-tests.md
+++ b/doc/hotspot-unit-tests.md
@@ -106,7 +106,7 @@ Prefer having checks inside test code.
Not only does having test logic outside, e.g. verification method,
depending on asserts in product code contradict with several items
-above but also decreases test’s readability and stability. It is much
+above but also decreases test's readability and stability. It is much
easier to understand that a test is testing when all testing logic is
located inside a test or nearby in shared test libraries. As a rule of
thumb, the closer a check to a test, the better.
@@ -119,7 +119,7 @@ Prefer `EXPECT` over `ASSERT` if possible.
This is related to the [informativeness](#informativeness) property of
tests, information for other checks can help to better localize a
-defect’s root-cause. One should use `ASSERT` if it is impossible to
+defect's root-cause. One should use `ASSERT` if it is impossible to
continue test execution or if it does not make much sense. Later in
the text, `EXPECT` forms will be used to refer to both
`ASSERT/EXPECT`.
@@ -160,7 +160,7 @@ value of the difference between `v1` and `v2` is not greater than `eps`.
Use string special macros for C strings comparisons.
-`EXPECT_EQ` just compares pointers’ values, which is hardly what one
+`EXPECT_EQ` just compares pointers' values, which is hardly what one
wants comparing C strings. GoogleTest provides `EXPECT_STREQ` and
`EXPECT_STRNE` macros to compare C string contents. There are also
case-insensitive versions `EXPECT_STRCASEEQ`, `EXPECT_STRCASENE`.
@@ -226,7 +226,7 @@ subsystem, etc.
This naming scheme helps to find tests, filter them and simplifies
test failure analysis. For example, class `Foo` - test group `Foo`,
-compiler logging subsystem - test group `CompilerLogging`, G1 GC — test
+compiler logging subsystem - test group `CompilerLogging`, G1 GC - test
group `G1GC`, and so forth.
### Filename
@@ -287,7 +287,7 @@ Fixture classes should be named after tested classes, subsystems, etc
All test purpose friends should have either `Test` or `Testable` suffix.
-It greatly simplifies understanding of friendship’s purpose and allows
+It greatly simplifies understanding of friendship's purpose and allows
statically check that private members are not exposed unexpectedly.
Having `FooTest` as a friend of `Foo` without any comments will be
understood as a necessary evil to get testability.
@@ -397,7 +397,7 @@ and filter out inapplicable tests.
Restore changed flags.
It is quite common for tests to configure JVM in a certain way
-changing flags’ values. GoogleTest provides two ways to set up
+changing flags' values. GoogleTest provides two ways to set up
environment before a test and restore it afterward: using either
constructor and destructor or `SetUp` and `TearDown` functions. Both ways
require to use a test fixture class, which sometimes is too wordy. The
@@ -406,7 +406,7 @@ be used in such cases to restore/set values.
Caveats:
-* Changing a flag’s value could break the invariants between flags' values and hence could lead to unexpected/unsupported JVM state.
+* Changing a flag's value could break the invariants between flags' values and hence could lead to unexpected/unsupported JVM state.
* `FLAG_SET_*` macros can change more than one flag (in order to
maintain invariants) so it is hard to predict what flags will be
diff --git a/doc/testing.html b/doc/testing.html
index 6285fab1682..c1c0f15fed9 100644
--- a/doc/testing.html
+++ b/doc/testing.html
@@ -411,6 +411,13 @@ instrumentation
special target jcov-test instead of test, e.g.
make jcov-test TEST=jdk_lang. This will make sure the JCov
image is built, and that JCov reporting is enabled.
To include JCov coverage for just a subset of all modules, you can
+use the --with-jcov-modules arguments to
+configure, e.g.
+--with-jcov-modules=jdk.compiler,java.desktop.
For more fine-grained control, you can pass arbitrary filters to JCov
+using --with-jcov-filters, and you can specify a specific
+JDK to instrument using --with-jcov-input-jdk.
The JCov report is stored in
build/$BUILD/test-results/jcov-output/report.
Please note that running with JCov reporting can be very memory
diff --git a/doc/testing.md b/doc/testing.md
index 351690c5e60..f6a25457b5e 100644
--- a/doc/testing.md
+++ b/doc/testing.md
@@ -345,6 +345,14 @@ The simplest way to run tests with JCov coverage report is to use the special
target `jcov-test` instead of `test`, e.g. `make jcov-test TEST=jdk_lang`. This
will make sure the JCov image is built, and that JCov reporting is enabled.
+To include JCov coverage for just a subset of all modules, you can use the
+`--with-jcov-modules` arguments to `configure`, e.g.
+`--with-jcov-modules=jdk.compiler,java.desktop`.
+
+For more fine-grained control, you can pass arbitrary filters to JCov using
+`--with-jcov-filters`, and you can specify a specific JDK to instrument
+using `--with-jcov-input-jdk`.
+
The JCov report is stored in `build/$BUILD/test-results/jcov-output/report`.
Please note that running with JCov reporting can be very memory intensive.
diff --git a/make/Bundles.gmk b/make/Bundles.gmk
index 58950b5fb1f..ba8ec0c864b 100644
--- a/make/Bundles.gmk
+++ b/make/Bundles.gmk
@@ -174,9 +174,11 @@ else
JRE_IMAGE_HOMEDIR := $(JRE_IMAGE_DIR)
JDK_BUNDLE_SUBDIR := jdk-$(VERSION_NUMBER)
JRE_BUNDLE_SUBDIR := jre-$(VERSION_NUMBER)
+ STATIC_JDK_BUNDLE_SUBDIR := static-jdk-$(VERSION_NUMBER)
ifneq ($(DEBUG_LEVEL), release)
JDK_BUNDLE_SUBDIR := $(JDK_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
JRE_BUNDLE_SUBDIR := $(JRE_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
+ STATIC_JDK_BUNDLE_SUBDIR := $(STATIC_JDK_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
endif
# In certain situations, the JDK_IMAGE_DIR points to an image without the
# the symbols and demos. If so, the symobls and demos can be found in a
@@ -242,7 +244,10 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
)
JDK_SYMBOLS_BUNDLE_FILES := \
- $(call FindFiles, $(SYMBOLS_IMAGE_DIR))
+ $(filter-out \
+ %.stripped.pdb, \
+ $(call FindFiles, $(SYMBOLS_IMAGE_DIR)) \
+ )
TEST_DEMOS_BUNDLE_FILES := $(filter $(JDK_DEMOS_IMAGE_HOMEDIR)/demo/%, \
$(ALL_JDK_DEMOS_FILES))
@@ -497,6 +502,21 @@ ifneq ($(filter static-libs-graal-bundles, $(MAKECMDGOALS)), )
STATIC_LIBS_GRAAL_TARGETS += $(BUILD_STATIC_LIBS_GRAAL_BUNDLE)
endif
+#################################################################################
+
+ifneq ($(filter static-jdk-bundles, $(MAKECMDGOALS)), )
+ STATIC_JDK_BUNDLE_FILES := $(call FindFiles, $(STATIC_JDK_IMAGE_DIR))
+
+ $(eval $(call SetupBundleFile, BUILD_STATIC_JDK_BUNDLE, \
+ BUNDLE_NAME := $(STATIC_JDK_BUNDLE_NAME), \
+ FILES := $(STATIC_JDK_BUNDLE_FILES), \
+ BASE_DIRS := $(STATIC_JDK_IMAGE_DIR), \
+ SUBDIR := $(STATIC_JDK_BUNDLE_SUBDIR), \
+ ))
+
+ STATIC_JDK_TARGETS += $(BUILD_STATIC_JDK_BUNDLE)
+endif
+
################################################################################
product-bundles: $(PRODUCT_TARGETS)
@@ -507,11 +527,12 @@ docs-javase-bundles: $(DOCS_JAVASE_TARGETS)
docs-reference-bundles: $(DOCS_REFERENCE_TARGETS)
static-libs-bundles: $(STATIC_LIBS_TARGETS)
static-libs-graal-bundles: $(STATIC_LIBS_GRAAL_TARGETS)
+static-jdk-bundles: $(STATIC_JDK_TARGETS)
jcov-bundles: $(JCOV_TARGETS)
.PHONY: product-bundles test-bundles \
docs-jdk-bundles docs-javase-bundles docs-reference-bundles \
- static-libs-bundles static-libs-graal-bundles jcov-bundles
+ static-libs-bundles static-libs-graal-bundles static-jdk-bundles jcov-bundles
################################################################################
diff --git a/make/CompileInterimLangtools.gmk b/make/CompileInterimLangtools.gmk
index c869ea160c7..c7d1c3796f6 100644
--- a/make/CompileInterimLangtools.gmk
+++ b/make/CompileInterimLangtools.gmk
@@ -95,14 +95,16 @@ define SetupInterimModule
SRC := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim \
$$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$1) \
$(TOPDIR)/src/$1/share/classes, \
- EXCLUDES := sun javax/tools/snippet-files, \
+ EXCLUDES := sun, \
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 \
+ $(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/MemoryClassLoader.java \
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/MemoryContext.java \
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/MemoryModuleFinder.java \
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/SourceLauncher.java \
Standard.java, \
+ EXCLUDE_PATTERNS := -files, \
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java \
$($1.interim_EXTRA_FILES), \
COPY := .gif .png .xml .css .svg .js .js.template .txt .woff .woff2 javax.tools.JavaCompilerTool, \
diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk
index b4a193dfade..1e26fb2b529 100644
--- a/make/CompileJavaModules.gmk
+++ b/make/CompileJavaModules.gmk
@@ -113,6 +113,7 @@ $(eval $(call SetupJavaCompilation, $(MODULE), \
DISABLED_WARNINGS := $(DISABLED_WARNINGS_java), \
EXCLUDES := $(EXCLUDES), \
EXCLUDE_FILES := $(EXCLUDE_FILES), \
+ EXCLUDE_PATTERNS := -files, \
KEEP_ALL_TRANSLATIONS := $(KEEP_ALL_TRANSLATIONS), \
JAVAC_FLAGS := \
$(DOCLINT) \
diff --git a/make/Coverage.gmk b/make/Coverage.gmk
index 2fd4e4ec6d4..a375c343185 100644
--- a/make/Coverage.gmk
+++ b/make/Coverage.gmk
@@ -34,21 +34,28 @@ else
JCOV_INPUT_IMAGE_DIR := $(JDK_IMAGE_DIR)
endif
+JCOV_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/jcov
+
#moving instrumented jdk image in and out of jcov_temp because of CODETOOLS-7902299
-JCOV_TEMP := $(SUPPORT_OUTPUTDIR)/jcov_temp
+JCOV_TEMP := $(JCOV_SUPPORT_DIR)/temp
+
+ifneq ($(JCOV_MODULES), )
+ JCOV_MODULES_FILTER := $(foreach m, $(JCOV_MODULES), -include_module $m)
+endif
$(JCOV_IMAGE_DIR)/release: $(JCOV_INPUT_IMAGE_DIR)/release
$(call LogWarn, Creating instrumented jdk image with JCov)
$(call MakeDir, $(JCOV_TEMP) $(IMAGES_OUTPUTDIR))
$(RM) -r $(JCOV_IMAGE_DIR) $(JCOV_TEMP)/*
$(CP) -r $(JCOV_INPUT_IMAGE_DIR) $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR)
- $(JAVA) -Xmx3g -jar $(JCOV_HOME)/lib/jcov.jar JREInstr \
+ $(call ExecuteWithLog, $(JCOV_SUPPORT_DIR)/run-jcov, \
+ $(JAVA) -Xmx3g -jar $(JCOV_HOME)/lib/jcov.jar JREInstr \
-t $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR)/template.xml \
-rt $(JCOV_HOME)/lib/jcov_network_saver.jar \
-exclude 'java.lang.Object' \
-exclude jdk.test.Main -exclude '**\$Proxy*' \
- $(JCOV_FILTERS) \
- $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR)
+ $(JCOV_MODULES_FILTER) $(JCOV_FILTERS) \
+ $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR))
$(MV) $(JCOV_TEMP)/$(JCOV_IMAGE_SUBDIR) $(JCOV_IMAGE_DIR)
$(RMDIR) $(JCOV_TEMP)
diff --git a/make/Docs.gmk b/make/Docs.gmk
index 49c97946f75..9026217fa42 100644
--- a/make/Docs.gmk
+++ b/make/Docs.gmk
@@ -79,6 +79,8 @@ JAVADOC_TAGS := \
-tag see \
-taglet build.tools.taglet.ExtLink \
-taglet build.tools.taglet.Incubating \
+ -taglet build.tools.taglet.PreviewNote \
+ --preview-note-tag previewNote \
-tagletpath $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
$(CUSTOM_JAVADOC_TAGS) \
#
@@ -92,20 +94,16 @@ REFERENCE_TAGS := $(JAVADOC_TAGS)
JAVADOC_DISABLED_DOCLINT_WARNINGS := missing
JAVADOC_DISABLED_DOCLINT_PACKAGES := org.w3c.* javax.smartcardio
-# Allow overriding on the command line
-# (intentionally sharing name with the javac option)
-JAVA_WARNINGS_ARE_ERRORS ?= -Werror
-
# The initial set of options for javadoc
JAVADOC_OPTIONS := -use -keywords -notimestamp \
- -serialwarn -encoding ISO-8859-1 -docencoding UTF-8 -breakiterator \
+ -serialwarn -encoding utf-8 -docencoding utf-8 -breakiterator \
-splitIndex --system none -javafx --expand-requires transitive \
--override-methods=summary
# The reference options must stay stable to allow for comparisons across the
# development cycle.
REFERENCE_OPTIONS := -XDignore.symbol.file=true -use -keywords -notimestamp \
- -serialwarn -encoding ISO-8859-1 -breakiterator -splitIndex --system none \
+ -serialwarn -encoding utf-8 -breakiterator -splitIndex --system none \
-html5 -javafx --expand-requires transitive
# Should we add DRAFT stamps to the generated javadoc?
@@ -264,7 +262,7 @@ define create_overview_file
$$($1_OVERVIEW): $$($1_OVERVIEW_VARDEPS_FILE)
$$(call LogInfo, Creating overview.html for $1)
$$(call MakeDir, $$(@D))
- $$(PRINTF) > $$@ '$$($1_OVERVIEW_TEXT)'
+ $$(PRINTF) "%s" '$$($1_OVERVIEW_TEXT)' > $$@
endef
################################################################################
@@ -322,7 +320,9 @@ define SetupApiDocsGenerationBody
# Ignore the doclint warnings in certain packages
$1_OPTIONS += -Xdoclint/package:$$(call CommaList, $$(addprefix -, \
$$(JAVADOC_DISABLED_DOCLINT_PACKAGES)))
- $1_OPTIONS += $$(JAVA_WARNINGS_ARE_ERRORS)
+ ifeq ($$(JAVA_WARNINGS_AS_ERRORS), true)
+ $1_OPTIONS += -Werror
+ endif
$1_DOC_TITLE := $$($1_LONG_NAME)
Version $$(VERSION_SPECIFICATION) API \
Specification
diff --git a/make/GenerateLinkOptData.gmk b/make/GenerateLinkOptData.gmk
index 5fc745ba223..6f6e1f29b4c 100644
--- a/make/GenerateLinkOptData.gmk
+++ b/make/GenerateLinkOptData.gmk
@@ -76,10 +76,14 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXECUTABLE_SUFFIX) $(CLASSLIST
$(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $(JLI_TRACE_FILE)))
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.raw \
$(CLASSLIST_FILE_VM_OPTS) \
+ -Xlog:aot=off \
+ -Xlog:cds=off \
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
build.tools.classlist.HelloClasslist $(LOG_DEBUG)
$(GREP) -v HelloClasslist $@.raw > $@.interim
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -Xshare:dump \
+ -Xlog:aot=off \
+ -Xlog:cds=off \
-XX:SharedClassListFile=$@.interim -XX:SharedArchiveFile=$@.jsa \
-Xmx128M -Xms128M $(LOG_INFO)
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.raw.2 \
@@ -87,6 +91,8 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXECUTABLE_SUFFIX) $(CLASSLIST
-Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \
$(CLASSLIST_FILE_VM_OPTS) \
--module-path $(SUPPORT_OUTPUTDIR)/classlist.jar \
+ -Xlog:aot=off \
+ -Xlog:cds=off \
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
build.tools.classlist.HelloClasslist \
2> $(LINK_OPT_DIR)/stderr > $(JLI_TRACE_FILE) \
@@ -100,6 +106,8 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXECUTABLE_SUFFIX) $(CLASSLIST
$(GREP) -v HelloClasslist $@.raw.2 > $@.raw.3
$(GREP) -v @cp $@.raw.3 > $@.raw.4
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java \
+ -Xlog:aot=off \
+ -Xlog:cds=off \
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
build.tools.classlist.SortClasslist $@.raw.4 > $@
diff --git a/make/Images.gmk b/make/Images.gmk
index 3f2b34bc9c6..22e3e43cb1f 100644
--- a/make/Images.gmk
+++ b/make/Images.gmk
@@ -162,7 +162,7 @@ define CreateCDSArchive
endif
ifeq ($(DEBUG_CDS_ARCHIVE), true)
- $1_$2_CDS_DUMP_FLAGS += -Xlog:cds+map*=trace:file=$$(JDK_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE).cdsmap:none:filesize=0
+ $1_$2_CDS_DUMP_FLAGS += -Xlog:aot+map*=trace:file=$$(JDK_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE).cdsmap:none:filesize=0
endif
$$(eval $$(call SetupExecute, $1_$2_gen_cds_archive_jdk, \
diff --git a/make/Init.gmk b/make/Init.gmk
index 2a8f6399a18..5dd1a71dd9a 100644
--- a/make/Init.gmk
+++ b/make/Init.gmk
@@ -137,7 +137,7 @@ main: MAKEOVERRIDES :=
main: $(INIT_TARGETS)
ifneq ($(SEQUENTIAL_TARGETS)$(PARALLEL_TARGETS), )
$(call RotateLogFiles)
- $(PRINTF) "Building $(TARGET_DESCRIPTION)\n" $(BUILD_LOG_PIPE_SIMPLE)
+ $(ECHO) "Building $(TARGET_DESCRIPTION)" $(BUILD_LOG_PIPE_SIMPLE)
ifneq ($(SEQUENTIAL_TARGETS), )
# Don't touch build output dir since we might be cleaning. That
# means no log pipe.
@@ -158,7 +158,8 @@ main: $(INIT_TARGETS)
-f make/Main.gmk $(USER_MAKE_VARS) \
$(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \
( exitcode=$$? && \
- $(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" \
+ $(ECHO) "" $(BUILD_LOG_PIPE_SIMPLE) && \
+ $(ECHO) "ERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode)" \
$(BUILD_LOG_PIPE_SIMPLE) && \
cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -j 1 -f make/Init.gmk \
on-failure ; \
@@ -170,7 +171,7 @@ main: $(INIT_TARGETS)
if test -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error ; then \
exit 1 ; \
fi
- $(PRINTF) "Finished building $(TARGET_DESCRIPTION)\n" $(BUILD_LOG_PIPE_SIMPLE)
+ $(ECHO) "Finished building $(TARGET_DESCRIPTION)" $(BUILD_LOG_PIPE_SIMPLE)
$(call ReportProfileTimes)
endif
@@ -181,7 +182,8 @@ on-failure:
$(call PrintFailureReports)
$(call PrintBuildLogFailures)
$(call ReportProfileTimes)
- $(PRINTF) "HELP: Run 'make doctor' to diagnose build problems.\n\n"
+ $(ECHO) "HELP: Run 'make doctor' to diagnose build problems."
+ $(ECHO) ""
ifneq ($(COMPARE_BUILD), )
$(call CleanupCompareBuild)
endif
diff --git a/make/InitSupport.gmk b/make/InitSupport.gmk
index a9af44e4225..809d1128692 100644
--- a/make/InitSupport.gmk
+++ b/make/InitSupport.gmk
@@ -173,9 +173,10 @@ define PrintFailureReports
$(RM) $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log ; \
$(if $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*.log), \
( \
- $(PRINTF) "\n=== Output from failing command(s) repeated here ===\n" ; \
+ $(ECHO) "" ; \
+ $(ECHO) "=== Output from failing command(s) repeated here ===" ; \
$(foreach logfile, $(sort $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*.log)), \
- $(PRINTF) "* For target $(notdir $(basename $(logfile))):\n" ; \
+ $(ECHO) "* For target $(notdir $(basename $(logfile))):" ; \
$(if $(filter all, $(LOG_REPORT)), \
$(GREP) -v -e "^Note: including file:" < $(logfile) || true ; \
, \
@@ -185,8 +186,9 @@ define PrintFailureReports
fi ; \
) \
) \
- $(PRINTF) "\n* All command lines available in $(MAKESUPPORT_OUTPUTDIR)/failure-logs.\n" ; \
- $(PRINTF) "=== End of repeated output ===\n" ; \
+ $(ECHO) "" ; \
+ $(ECHO) "* All command lines available in $(MAKESUPPORT_OUTPUTDIR)/failure-logs." ; \
+ $(ECHO) "=== End of repeated output ===" ; \
) >> $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log \
) \
)
@@ -195,13 +197,16 @@ endef
define PrintBuildLogFailures
$(if $(filter none, $(LOG_REPORT)), , \
if $(GREP) -q "recipe for target .* failed" $(BUILD_LOG) 2> /dev/null; then \
- $(PRINTF) "\n=== Make failed targets repeated here ===\n" ; \
+ $(ECHO) "" ; \
+ $(ECHO) "=== Make failed targets repeated here ===" ; \
$(GREP) "recipe for target .* failed" $(BUILD_LOG) ; \
- $(PRINTF) "=== End of repeated output ===\n" ; \
- $(PRINTF) "\nHELP: Try searching the build log for the name of the first failed target.\n" ; \
+ $(ECHO) "=== End of repeated output ===" ; \
+ $(ECHO) "" ; \
+ $(ECHO) "HELP: Try searching the build log for the name of the first failed target." ; \
else \
- $(PRINTF) "\nNo indication of failed target found.\n" ; \
- $(PRINTF) "HELP: Try searching the build log for '] Error'.\n" ; \
+ $(ECHO) "" ; \
+ $(ECHO) "No indication of failed target found." ; \
+ $(ECHO) "HELP: Try searching the build log for '] Error'." ; \
fi >> $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log ; \
$(CAT) $(MAKESUPPORT_OUTPUTDIR)/failure-summary.log \
)
diff --git a/make/Main.gmk b/make/Main.gmk
index eda3b79265a..3535ad16aae 100644
--- a/make/Main.gmk
+++ b/make/Main.gmk
@@ -875,6 +875,12 @@ $(eval $(call SetupTarget, static-libs-graal-bundles, \
DEPS := static-libs-graal-image, \
))
+$(eval $(call SetupTarget, static-jdk-bundles, \
+ MAKEFILE := Bundles, \
+ TARGET := static-jdk-bundles, \
+ DEPS := static-jdk-image, \
+))
+
ifeq ($(JCOV_ENABLED), true)
$(eval $(call SetupTarget, jcov-bundles, \
MAKEFILE := Bundles, \
diff --git a/make/MainSupport.gmk b/make/MainSupport.gmk
index f7ba4de2d53..d8dc894c1e9 100644
--- a/make/MainSupport.gmk
+++ b/make/MainSupport.gmk
@@ -58,76 +58,76 @@ endef
define CleanDocs
@$(PRINTF) "Cleaning docs ..."
- @$(PRINTF) "\n" $(LOG_DEBUG)
+ @$(ECHO) "" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/docs
$(RM) -r $(SUPPORT_OUTPUTDIR)/javadoc
$(RM) -r $(IMAGES_OUTPUTDIR)/docs
- @$(PRINTF) " done\n"
+ @$(ECHO) " done"
endef
# Cleans the dir given as $1
define CleanDir
- @$(PRINTF) "Cleaning $(strip $1) build artifacts ..."
- @$(PRINTF) "\n" $(LOG_DEBUG)
+ @$(PRINTF) "Cleaning %s build artifacts ..." "$(strip $1)"
+ @$(ECHO) "" $(LOG_DEBUG)
($(CD) $(OUTPUTDIR) && $(RM) -r $1)
- @$(PRINTF) " done\n"
+ @$(ECHO) " done"
endef
define CleanSupportDir
- @$(PRINTF) "Cleaning $(strip $1) build artifacts ..."
- @$(PRINTF) "\n" $(LOG_DEBUG)
+ @$(PRINTF) "Cleaning %s build artifacts ..." "$(strip $1)"
+ @$(ECHO) "" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/$(strip $1)
- @$(PRINTF) " done\n"
+ @$(ECHO) " done"
endef
define CleanMakeSupportDir
- @$(PRINTF) "Cleaning $(strip $1) make support artifacts ..."
- @$(PRINTF) "\n" $(LOG_DEBUG)
+ @$(PRINTF) "Cleaning %s make support artifacts ..." "$(strip $1)"
+ @$(ECHO) "" $(LOG_DEBUG)
$(RM) -r $(MAKESUPPORT_OUTPUTDIR)/$(strip $1)
- @$(PRINTF) " done\n"
+ @$(ECHO) " done"
endef
define CleanTest
- @$(PRINTF) "Cleaning test $(strip $1) ..."
- @$(PRINTF) "\n" $(LOG_DEBUG)
+ @$(PRINTF) "Cleaning test %s ..." "$(strip $1)"
+ @$(ECHO) "" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/test/$(strip $(subst -,/,$1))
# Remove as much of the test directory structure as is empty
$(RMDIR) -p $(dir $(SUPPORT_OUTPUTDIR)/test/$(strip $(subst -,/,$1))) 2> /dev/null || true
- @$(PRINTF) " done\n"
+ @$(ECHO) " done"
endef
define Clean-gensrc
- @$(PRINTF) "Cleaning gensrc $(if $1,for $(strip $1) )..."
- @$(PRINTF) "\n" $(LOG_DEBUG)
+ @$(PRINTF) "Cleaning gensrc %s..." "$(if $1,for $(strip $1) )"
+ @$(ECHO) "" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/gensrc/$(strip $1)
- @$(PRINTF) " done\n"
+ @$(ECHO) " done"
endef
define Clean-java
- @$(PRINTF) "Cleaning java $(if $1,for $(strip $1) )..."
- @$(PRINTF) "\n" $(LOG_DEBUG)
+ @$(PRINTF) "Cleaning java %s..." "$(if $1,for $(strip $1) )"
+ @$(ECHO) "" $(LOG_DEBUG)
$(RM) -r $(JDK_OUTPUTDIR)/modules/$(strip $1)
$(RM) -r $(SUPPORT_OUTPUTDIR)/special_classes/$(strip $1)
- $(PRINTF) " done\n"
- $(PRINTF) "Cleaning headers $(if $1,for $(strip $1)) ..."
+ $(ECHO) " done"
+ $(PRINTF) "Cleaning headers %s..." "$(if $1,for $(strip $1) )"
$(RM) -r $(SUPPORT_OUTPUTDIR)/headers/$(strip $1)
- @$(PRINTF) " done\n"
+ @$(ECHO) " done"
endef
define Clean-native
- @$(PRINTF) "Cleaning native $(if $1,for $(strip $1) )..."
- @$(PRINTF) "\n" $(LOG_DEBUG)
+ @$(PRINTF) "Cleaning native %s..." "$(if $1,for $(strip $1) )"
+ @$(ECHO) "" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/native/$(strip $1)
$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)
$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_cmds/$(strip $1)
- @$(PRINTF) " done\n"
+ @$(ECHO) " done"
endef
define Clean-include
- @$(PRINTF) "Cleaning include $(if $1,for $(strip $1) )..."
- @$(PRINTF) "\n" $(LOG_DEBUG)
+ @$(PRINTF) "Cleaning include %s..." "$(if $1,for $(strip $1) )"
+ @$(ECHO) "" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/modules_include/$(strip $1)
- @$(PRINTF) " done\n"
+ @$(ECHO) " done"
endef
define CleanModule
diff --git a/make/PreInit.gmk b/make/PreInit.gmk
index a01971e845d..bce61ccde5f 100644
--- a/make/PreInit.gmk
+++ b/make/PreInit.gmk
@@ -161,19 +161,19 @@ ifneq ($(SKIP_SPEC), true)
( cd $(TOPDIR) && \
$(foreach spec, $(SPECS), \
$(MAKE) $(MAKE_INIT_ARGS) -j 1 -f $(TOPDIR)/make/Init.gmk \
- SPEC=$(spec) $(MAKE_INIT_MAIN_TARGET_ARGS) \
- main && \
+ SPEC=$(spec) TOPDIR_ALT=$(TOPDIR) \
+ $(MAKE_INIT_MAIN_TARGET_ARGS) main && \
$(if $(and $(COMPARE_BUILD), $(PARALLEL_TARGETS)), \
$(MAKE) $(MAKE_INIT_ARGS) -f $(TOPDIR)/make/Init.gmk \
- SPEC=$(spec) \
+ SPEC=$(spec) TOPDIR_ALT=$(TOPDIR) \
COMPARE_BUILD="$(COMPARE_BUILD)" \
pre-compare-build && \
$(MAKE) $(MAKE_INIT_ARGS) -j 1 -f $(TOPDIR)/make/Init.gmk \
- SPEC=$(spec) $(MAKE_INIT_MAIN_TARGET_ARGS) \
+ SPEC=$(spec) TOPDIR_ALT=$(TOPDIR) \
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" \
- main && \
+ $(MAKE_INIT_MAIN_TARGET_ARGS) main && \
$(MAKE) $(MAKE_INIT_ARGS) -f $(TOPDIR)/make/Init.gmk \
- SPEC=$(spec) \
+ SPEC=$(spec) TOPDIR_ALT=$(TOPDIR) \
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" \
post-compare-build && \
) \
diff --git a/make/PreInitSupport.gmk b/make/PreInitSupport.gmk
index 668363d8725..1d3c3ce9135 100644
--- a/make/PreInitSupport.gmk
+++ b/make/PreInitSupport.gmk
@@ -250,13 +250,14 @@ endef
# Param 1: FORCE = force generation of main-targets.gmk or LAZY = do not force.
# Param 2: The SPEC file to use.
define DefineMainTargets
+ SPEC_FILE := $(strip $2)
# We will start by making sure the main-targets.gmk file is removed, if
# make has not been restarted. By the -include, we will trigger the
# rule for generating the file (which is never there since we removed it),
# thus generating it fresh, and make will restart, incrementing the restart
# count.
- main_targets_file := $$(dir $(strip $2))make-support/main-targets.gmk
+ main_targets_file := $$(dir $$(SPEC_FILE))make-support/main-targets.gmk
ifeq ($$(MAKE_RESTARTS), )
# Only do this if make has not been restarted, and if we do not force it.
@@ -268,10 +269,10 @@ define DefineMainTargets
$$(main_targets_file):
@( cd $$(TOPDIR) && \
$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(TOPDIR)/make/GenerateFindTests.gmk \
- -I $$(TOPDIR)/make/common SPEC=$(strip $2) )
+ -I $$(TOPDIR)/make/common SPEC=$$(SPEC_FILE) TOPDIR_ALT=$$(TOPDIR))
@( cd $$(TOPDIR) && \
$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(TOPDIR)/make/Main.gmk \
- -I $$(TOPDIR)/make/common SPEC=$(strip $2) NO_RECIPES=true \
+ -I $$(TOPDIR)/make/common SPEC=$$(SPEC_FILE) TOPDIR_ALT=$$(TOPDIR) NO_RECIPES=true \
$$(MAKE_LOG_VARS) \
create-main-targets-include )
diff --git a/make/RunTests.gmk b/make/RunTests.gmk
index b9fd3e755d1..95d3dee7013 100644
--- a/make/RunTests.gmk
+++ b/make/RunTests.gmk
@@ -115,6 +115,7 @@ JTREG_COV_OPTIONS :=
ifeq ($(TEST_OPTS_JCOV), true)
JCOV_OUTPUT_DIR := $(TEST_RESULTS_DIR)/jcov-output
+ JCOV_SUPPORT_DIR := $(TEST_SUPPORT_DIR)/jcov-support
JCOV_GRABBER_LOG := $(JCOV_OUTPUT_DIR)/grabber.log
JCOV_RESULT_FILE := $(JCOV_OUTPUT_DIR)/result.xml
JCOV_REPORT := $(JCOV_OUTPUT_DIR)/report
@@ -534,22 +535,21 @@ define SetupRunGtestTestBody
$$(eval $1_PASSED := $$(shell $$(AWK) '/\[ PASSED \] .* tests?./ \
{ print $$$$4 }' $$($1_RESULT_FILE))) \
$$(if $$($1_PASSED), , $$(eval $1_PASSED := 0)) \
- $$(eval $1_SKIPPED := $$(shell $$(AWK) \
- '/YOU HAVE [0-9]+ DISABLED TEST/ { \
- if (match($$$$0, /[0-9]+/, arr)) { \
- print arr[0]; \
- found=1; \
- } \
- } \
- END { if (!found) print 0; }' \
- $$($1_RESULT_FILE))) \
+ $$(eval $1_GTEST_DISABLED := $$(shell $$(AWK) '/YOU HAVE .* DISABLED TEST/ \
+ { print $$$$3 }' $$($1_RESULT_FILE))) \
+ $$(if $$($1_GTEST_DISABLED), , $$(eval $1_GTEST_DISABLED := 0)) \
+ $$(eval $1_GTEST_SKIPPED := $$(shell $$(AWK) '/\[ SKIPPED \] .* tests?.*/ \
+ { print $$$$4 }' $$($1_RESULT_FILE))) \
+ $$(if $$($1_GTEST_SKIPPED), , $$(eval $1_GTEST_SKIPPED := 0)) \
+ $$(eval $1_SKIPPED := $$(shell \
+ $$(EXPR) $$($1_GTEST_DISABLED) + $$($1_GTEST_SKIPPED))) \
$$(eval $1_FAILED := $$(shell $$(AWK) '/\[ FAILED \] .* tests?, \
listed below/ { print $$$$4 }' $$($1_RESULT_FILE))) \
$$(if $$($1_FAILED), , $$(eval $1_FAILED := 0)) \
$$(eval $1_ERROR := $$(shell \
- $$(EXPR) $$($1_RUN) - $$($1_PASSED) - $$($1_FAILED))) \
+ $$(EXPR) $$($1_RUN) - $$($1_PASSED) - $$($1_FAILED) - $$($1_GTEST_SKIPPED))) \
$$(eval $1_TOTAL := $$(shell \
- $$(EXPR) $$($1_RUN) + $$($1_SKIPPED))) \
+ $$(EXPR) $$($1_RUN) + $$($1_GTEST_DISABLED))) \
, \
$$(eval $1_PASSED := 0) \
$$(eval $1_FAILED := 0) \
@@ -754,7 +754,7 @@ define SetupAOTBody
cd $$($1_AOT_JDK_OUTPUT_DIR); \
$(JAR) --extract --file $(TEST_IMAGE_DIR)/setup_aot/TestSetupAOT.jar; \
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/java $$($1_VM_OPTIONS) \
- -Xlog:class+load,cds,cds+class=debug:file=$$($1_AOT_JDK_CONF).log -Xlog:cds*=error \
+ -Xlog:class+load,aot,aot+class=debug:file=$$($1_AOT_JDK_CONF).log -Xlog:cds*=error -Xlog:aot*=error \
-XX:AOTMode=record -XX:AOTConfiguration=$$($1_AOT_JDK_CONF) \
TestSetupAOT $$($1_AOT_JDK_OUTPUT_DIR) > $$($1_AOT_JDK_LOG) \
))
@@ -762,7 +762,7 @@ define SetupAOTBody
$$(call LogWarn, AOT: Generate AOT cache $$($1_AOT_JDK_CACHE) with flags: $$($1_VM_OPTIONS))
$$(call ExecuteWithLog, $$($1_AOT_JDK_OUTPUT_DIR), ( \
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/java \
- $$($1_VM_OPTIONS) -Xlog:cds,cds+class=debug:file=$$($1_AOT_JDK_CACHE).log -Xlog:cds*=error \
+ $$($1_VM_OPTIONS) -Xlog:aot,aot+class=debug:file=$$($1_AOT_JDK_CACHE).log -Xlog:cds*=error -Xlog:aot*=error \
-XX:ExtraSharedClassListFile=$(JDK_UNDER_TEST)/lib/classlist \
-XX:AOTMode=create -XX:AOTConfiguration=$$($1_AOT_JDK_CONF) -XX:AOTCache=$$($1_AOT_JDK_CACHE) \
))
@@ -930,6 +930,11 @@ define SetupRunJtregTestBody
JTREG_AUTO_PROBLEM_LISTS += ProblemList-shenandoah.txt
endif
+ ifneq ($$(findstring --enable-preview, $$(JTREG_ALL_OPTIONS)), )
+ JTREG_AUTO_PROBLEM_LISTS += ProblemList-enable-preview.txt
+ endif
+
+
ifneq ($$(JTREG_EXTRA_PROBLEM_LISTS), )
# Accept both absolute paths as well as relative to the current test root.
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
@@ -1017,7 +1022,8 @@ define SetupRunJtregTestBody
$1_COMMAND_LINE := \
for i in {0..$$(JTREG_RETRY_COUNT)}; do \
if [ "$$$$i" != 0 ]; then \
- $$(PRINTF) "\nRetrying Jtreg run. Attempt: $$$$i\n"; \
+ $$(ECHO) ""; \
+ $$(ECHO) "Retrying Jtreg run. Attempt: $$$$i"; \
fi; \
$$($1_COMMAND_LINE); \
if [ "`$$(CAT) $$($1_EXITCODE)`" = "0" ]; then \
@@ -1030,10 +1036,12 @@ define SetupRunJtregTestBody
ifneq ($$(JTREG_REPEAT_COUNT), 0)
$1_COMMAND_LINE := \
for i in {1..$$(JTREG_REPEAT_COUNT)}; do \
- $$(PRINTF) "\nRepeating Jtreg run: $$$$i out of $$(JTREG_REPEAT_COUNT)\n"; \
+ $$(ECHO) ""; \
+ $$(ECHO) "Repeating Jtreg run: $$$$i out of $$(JTREG_REPEAT_COUNT)"; \
$$($1_COMMAND_LINE); \
if [ "`$$(CAT) $$($1_EXITCODE)`" != "0" ]; then \
- $$(PRINTF) "\nFailures detected, no more repeats.\n"; \
+ $$(ECHO) ""; \
+ $$(ECHO) "Failures detected, no more repeats."; \
break; \
fi; \
done
@@ -1336,12 +1344,14 @@ TARGETS += run-all-tests pre-run-test post-run-test run-test-report run-test
ifeq ($(TEST_OPTS_JCOV), true)
+ JCOV_VM_OPTS := -Xmx4g -Djdk.xml.totalEntitySizeLimit=0 -Djdk.xml.maxGeneralEntitySizeLimit=0
+
jcov-do-start-grabber:
$(call MakeDir, $(JCOV_OUTPUT_DIR))
if $(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -status 1>/dev/null 2>&1 ; then \
$(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -stop -stoptimeout 3600 ; \
fi
- $(JAVA) -Xmx4g -jar $(JCOV_HOME)/lib/jcov.jar Grabber -v -t \
+ $(JAVA) $(JCOV_VM_OPTS) -jar $(JCOV_HOME)/lib/jcov.jar Grabber -v -t \
$(JCOV_IMAGE_DIR)/template.xml -o $(JCOV_RESULT_FILE) \
1>$(JCOV_GRABBER_LOG) 2>&1 &
@@ -1354,6 +1364,10 @@ ifeq ($(TEST_OPTS_JCOV), true)
$(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -stop -stoptimeout 3600
JCOV_REPORT_TITLE := JDK code coverage report
+ ifneq ($(JCOV_MODULES), )
+ JCOV_MODULES_FILTER := $(foreach m, $(JCOV_MODULES), -include_module $m)
+ JCOV_REPORT_TITLE += Included modules: $(JCOV_MODULES)
+ endif
ifneq ($(JCOV_FILTERS), )
JCOV_REPORT_TITLE += Code filters: $(JCOV_FILTERS)
endif
@@ -1361,11 +1375,12 @@ ifeq ($(TEST_OPTS_JCOV), true)
jcov-gen-report: jcov-stop-grabber
$(call LogWarn, Generating JCov report ...)
- $(JAVA) -Xmx4g -jar $(JCOV_HOME)/lib/jcov.jar RepGen -sourcepath \
+ $(call ExecuteWithLog, $(JCOV_SUPPORT_DIR)/run-jcov-repgen, \
+ $(JAVA) $(JCOV_VM_OPTS) -jar $(JCOV_HOME)/lib/jcov.jar RepGen -sourcepath \
`$(ECHO) $(TOPDIR)/src/*/share/classes/ | $(TR) ' ' ':'` -fmt html \
- $(JCOV_FILTERS) \
+ $(JCOV_MODULES_FILTER) $(JCOV_FILTERS) \
-mainReportTitle "$(JCOV_REPORT_TITLE)" \
- -o $(JCOV_REPORT) $(JCOV_RESULT_FILE)
+ -o $(JCOV_REPORT) $(JCOV_RESULT_FILE))
TARGETS += jcov-do-start-grabber jcov-start-grabber jcov-stop-grabber \
jcov-gen-report
@@ -1385,7 +1400,7 @@ ifeq ($(TEST_OPTS_JCOV), true)
jcov-gen-diffcoverage: jcov-stop-grabber
$(call LogWarn, Generating diff coverage with changeset $(TEST_OPTS_JCOV_DIFF_CHANGESET) ... )
$(DIFF_COMMAND)
- $(JAVA) -Xmx4g -jar $(JCOV_HOME)/lib/jcov.jar \
+ $(JAVA) $(JCOV_VM_OPTS) -jar $(JCOV_HOME)/lib/jcov.jar \
DiffCoverage -replaceDiff "src/.*/classes/:" -all \
$(JCOV_RESULT_FILE) $(JCOV_SOURCE_DIFF) > \
$(JCOV_DIFF_COVERAGE_REPORT)
diff --git a/make/RunTestsPrebuilt.gmk b/make/RunTestsPrebuilt.gmk
index ba9731789b0..f5fe1d33830 100644
--- a/make/RunTestsPrebuilt.gmk
+++ b/make/RunTestsPrebuilt.gmk
@@ -217,9 +217,9 @@ else ifeq ($(OPENJDK_TARGET_OS), macosx)
else ifeq ($(OPENJDK_TARGET_OS), windows)
NUM_CORES := $(NUMBER_OF_PROCESSORS)
MEMORY_SIZE := $(shell \
- $(EXPR) `wmic computersystem get totalphysicalmemory -value \
- | $(GREP) = | $(SED) 's/\\r//g' \
- | $(CUT) -d "=" -f 2-` / 1024 / 1024 \
+ $(EXPR) `powershell -Command \
+ "(Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory" \
+ | $(SED) 's/\\r//g' ` / 1024 / 1024 \
)
endif
ifeq ($(NUM_CORES), )
diff --git a/make/SourceRevision.gmk b/make/SourceRevision.gmk
index 285aaae17b5..15399527e6a 100644
--- a/make/SourceRevision.gmk
+++ b/make/SourceRevision.gmk
@@ -55,7 +55,7 @@ ifneq ($(and $(GIT), $(wildcard $(TOPDIR)/.git)), )
SCM_DIR := .git
ID_COMMAND := $(PRINTF) "git:%s%s\n" \
"$$($(GIT) log -n1 --format=%H | cut -c1-12)" \
- "$$(if test -n "$$($(GIT) status --porcelain)"; then printf '+'; fi)"
+ "$$(if test -n "$$($(GIT) status --porcelain)"; then $(PRINTF) '+'; fi)"
endif
ifeq ($(USE_SCM), true)
diff --git a/make/autoconf/basic.m4 b/make/autoconf/basic.m4
index 6daba35547b..0e9470a1cff 100644
--- a/make/autoconf/basic.m4
+++ b/make/autoconf/basic.m4
@@ -134,17 +134,33 @@ AC_DEFUN_ONCE([BASIC_SETUP_BUILD_ENV],
)
AC_SUBST(BUILD_ENV)
+ AC_MSG_CHECKING([for locale to use])
if test "x$LOCALE" != x; then
# Check if we actually have C.UTF-8; if so, use it
if $LOCALE -a | $GREP -q -E "^C\.(utf8|UTF-8)$"; then
LOCALE_USED=C.UTF-8
+ AC_MSG_RESULT([C.UTF-8 (recommended)])
+ elif $LOCALE -a | $GREP -q -E "^en_US\.(utf8|UTF-8)$"; then
+ LOCALE_USED=en_US.UTF-8
+ AC_MSG_RESULT([en_US.UTF-8 (acceptable fallback)])
else
- AC_MSG_WARN([C.UTF-8 locale not found, using C locale])
- LOCALE_USED=C
+ # As a fallback, check if users locale is UTF-8. USER_LOCALE was saved
+ # by the wrapper configure script before autconf messed up LC_ALL.
+ if $ECHO $USER_LOCALE | $GREP -q -E "\.(utf8|UTF-8)$"; then
+ LOCALE_USED=$USER_LOCALE
+ AC_MSG_RESULT([$USER_LOCALE (untested fallback)])
+ AC_MSG_WARN([Could not find C.UTF-8 or en_US.UTF-8 locale. This is not supported, and the build might fail unexpectedly.])
+ else
+ AC_MSG_RESULT([no UTF-8 locale found])
+ AC_MSG_WARN([No UTF-8 locale found. This is not supported. Proceeding with the C locale, but the build might fail unexpectedly.])
+ LOCALE_USED=C
+ fi
+ AC_MSG_NOTICE([The recommended locale is C.UTF-8, but en_US.UTF-8 is also accepted.])
fi
else
- AC_MSG_WARN([locale command not not found, using C locale])
- LOCALE_USED=C
+ LOCALE_USED=C.UTF-8
+ AC_MSG_RESULT([C.UTF-8 (default)])
+ AC_MSG_WARN([locale command not not found, using C.UTF-8 locale])
fi
export LC_ALL=$LOCALE_USED
diff --git a/make/autoconf/basic_tools.m4 b/make/autoconf/basic_tools.m4
index eac14207b1d..5815c55c962 100644
--- a/make/autoconf/basic_tools.m4
+++ b/make/autoconf/basic_tools.m4
@@ -468,7 +468,15 @@ AC_DEFUN_ONCE([BASIC_SETUP_PANDOC],
AC_MSG_CHECKING([if the pandoc smart extension needs to be disabled for markdown])
if $PANDOC --list-extensions | $GREP -q '+smart'; then
AC_MSG_RESULT([yes])
- PANDOC_MARKDOWN_FLAG="markdown-smart"
+ PANDOC_MARKDOWN_FLAG="$PANDOC_MARKDOWN_FLAG-smart"
+ else
+ AC_MSG_RESULT([no])
+ fi
+
+ AC_MSG_CHECKING([if the pandoc tex_math_dollars extension needs to be disabled for markdown])
+ if $PANDOC --list-extensions | $GREP -q '+tex_math_dollars'; then
+ AC_MSG_RESULT([yes])
+ PANDOC_MARKDOWN_FLAG="$PANDOC_MARKDOWN_FLAG-tex_math_dollars"
else
AC_MSG_RESULT([no])
fi
diff --git a/make/autoconf/basic_windows.m4 b/make/autoconf/basic_windows.m4
index fb6fc526bfa..dac6ec15db6 100644
--- a/make/autoconf/basic_windows.m4
+++ b/make/autoconf/basic_windows.m4
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -159,7 +159,7 @@ AC_DEFUN([BASIC_SETUP_PATHS_WINDOWS],
else
WINENV_PREFIX_ARG="$WINENV_PREFIX"
fi
- FIXPATH_ARGS="-e $PATHTOOL -p $WINENV_PREFIX_ARG -r ${WINENV_ROOT//\\/\\\\} -t $WINENV_TEMP_DIR -c $CMD -q"
+ FIXPATH_ARGS="-e $PATHTOOL -p $WINENV_PREFIX_ARG -r ${WINENV_ROOT//\\/\\\\} -t $WINENV_TEMP_DIR -c $CMD"
FIXPATH_BASE="$BASH $FIXPATH_DIR/fixpath.sh $FIXPATH_ARGS"
FIXPATH="$FIXPATH_BASE exec"
@@ -215,7 +215,7 @@ AC_DEFUN([BASIC_WINDOWS_FINALIZE_FIXPATH],
if test "x$OPENJDK_BUILD_OS" = xwindows; then
FIXPATH_CMDLINE=". $TOPDIR/make/scripts/fixpath.sh -e $PATHTOOL \
-p $WINENV_PREFIX_ARG -r ${WINENV_ROOT//\\/\\\\} -t $WINENV_TEMP_DIR \
- -c $CMD -q"
+ -c $CMD"
$ECHO > $OUTPUTDIR/fixpath '#!/bin/bash'
$ECHO >> $OUTPUTDIR/fixpath export PATH='"[$]PATH:'$PATH'"'
$ECHO >> $OUTPUTDIR/fixpath $FIXPATH_CMDLINE '"[$]@"'
diff --git a/make/autoconf/boot-jdk.m4 b/make/autoconf/boot-jdk.m4
index d39e6e75a94..feb16c7d179 100644
--- a/make/autoconf/boot-jdk.m4
+++ b/make/autoconf/boot-jdk.m4
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2025, 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
@@ -180,11 +180,13 @@ AC_DEFUN([BOOTJDK_CHECK_JAVA_HOME],
# Test: Is there a java or javac in the PATH, which is a symlink to the JDK?
AC_DEFUN([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK],
[
- UTIL_LOOKUP_PROGS(JAVAC_CHECK, javac, , NOFIXPATH)
- UTIL_LOOKUP_PROGS(JAVA_CHECK, java, , NOFIXPATH)
- BINARY="$JAVAC_CHECK"
- if test "x$JAVAC_CHECK" = x; then
- BINARY="$JAVA_CHECK"
+ UTIL_LOOKUP_PROGS(JAVAC_CHECK, javac)
+ UTIL_GET_EXECUTABLE(JAVAC_CHECK) # Will setup JAVAC_CHECK_EXECUTABLE
+ UTIL_LOOKUP_PROGS(JAVA_CHECK, java)
+ UTIL_GET_EXECUTABLE(JAVA_CHECK) # Will setup JAVA_CHECK_EXECUTABLE
+ BINARY="$JAVAC_CHECK_EXECUTABLE"
+ if test "x$JAVAC_CHECK_EXECUTABLE" = x; then
+ BINARY="$JAVA_CHECK_EXECUTABLE"
fi
if test "x$BINARY" != x; then
# So there is a java(c) binary, it might be part of a JDK.
diff --git a/make/autoconf/build-performance.m4 b/make/autoconf/build-performance.m4
index 4414ea0d93c..10e86e75199 100644
--- a/make/autoconf/build-performance.m4
+++ b/make/autoconf/build-performance.m4
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2025, 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
@@ -75,7 +75,8 @@ AC_DEFUN([BPERF_CHECK_MEMORY_SIZE],
FOUND_MEM=yes
elif test "x$OPENJDK_BUILD_OS" = xwindows; then
# Windows, but without cygwin
- MEMORY_SIZE=`wmic computersystem get totalphysicalmemory -value | grep = | cut -d "=" -f 2-`
+ MEMORY_SIZE=`powershell -Command \
+ "(Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory" | $SED 's/\\r//g' `
MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024`
FOUND_MEM=yes
fi
diff --git a/make/autoconf/configure b/make/autoconf/configure
index 6fa0aacfbc9..443a37bae77 100644
--- a/make/autoconf/configure
+++ b/make/autoconf/configure
@@ -49,7 +49,9 @@ fi
export CONFIG_SHELL=$BASH
export _as_can_reexec=no
-# Make sure all shell commands are executed with the C locale
+# Save user's current locale, but make sure all future shell commands are
+# executed with the C locale
+export USER_LOCALE=$LC_ALL
export LC_ALL=C
if test "x$CUSTOM_CONFIG_DIR" != x; then
diff --git a/make/autoconf/configure.ac b/make/autoconf/configure.ac
index fffe17daad8..e05b5ae3b90 100644
--- a/make/autoconf/configure.ac
+++ b/make/autoconf/configure.ac
@@ -261,6 +261,7 @@ JDKOPT_ENABLE_DISABLE_CDS_ARCHIVE_COH
JDKOPT_ENABLE_DISABLE_COMPATIBLE_CDS_ALIGNMENT
JDKOPT_SETUP_MACOSX_SIGNING
JDKOPT_SETUP_SIGNING_HOOK
+JDKOPT_SETUP_JAVA_WARNINGS
################################################################################
#
diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4
index 374ee1851a5..eb0e5e20e4c 100644
--- a/make/autoconf/flags-cflags.m4
+++ b/make/autoconf/flags-cflags.m4
@@ -573,12 +573,20 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -fvisibility=hidden -fstack-protector"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
- # The -utf-8 option sets source and execution character sets to UTF-8 to enable correct
- # compilation of all source files regardless of the active code page on Windows.
- TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:inline -Zc:throwingNew -permissive- -utf-8 -MP"
- TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:inline -Zc:throwingNew -permissive- -utf-8 -Zc:wchar_t-"
+ TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:inline -Zc:throwingNew -permissive- -MP"
+ TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:inline -Zc:throwingNew -permissive- -Zc:wchar_t-"
fi
+ # Set character encoding in source
+ if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
+ CHARSET_CFLAGS="-finput-charset=utf-8"
+ elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
+ # The -utf-8 option sets both source and execution character sets
+ CHARSET_CFLAGS="-utf-8 -validate-charset"
+ fi
+ TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM $CHARSET_CFLAGS"
+ TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK $CHARSET_CFLAGS"
+
# CFLAGS C language level for JDK sources (hotspot only uses C++)
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
LANGSTD_CFLAGS="-std=c11"
@@ -721,7 +729,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
$1_CFLAGS_CPU="-fsigned-char -Wno-psabi $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS -DJDK_ARCH_ABI_PROP_NAME='\"\$(JDK_ARCH_ABI_PROP_NAME)\"'"
$1_CFLAGS_CPU_JVM="-DARM"
elif test "x$FLAGS_CPU_ARCH" = xppc; then
- $1_CFLAGS_CPU_JVM="-minsert-sched-nops=regroup_exact -mno-multiple -mno-string"
+ $1_CFLAGS_CPU_JVM="-mno-multiple -mno-string"
if test "x$FLAGS_CPU" = xppc64; then
# -mminimal-toc fixes `relocation truncated to fit' error for gcc 4.1.
# Use ppc64 instructions, but schedule for power5
diff --git a/make/autoconf/help.m4 b/make/autoconf/help.m4
index 400acf11a63..d8c0b2ffaef 100644
--- a/make/autoconf/help.m4
+++ b/make/autoconf/help.m4
@@ -228,19 +228,19 @@ AC_DEFUN_ONCE([HELP_PRINT_ADDITIONAL_HELP_AND_EXIT],
if test "x$CONFIGURE_PRINT_ADDITIONAL_HELP" != x; then
# Print available toolchains
- $PRINTF "The following toolchains are valid as arguments to --with-toolchain-type.\n"
- $PRINTF "Which are available to use depends on the build platform.\n"
+ $ECHO "The following toolchains are valid as arguments to --with-toolchain-type."
+ $ECHO "Which are available to use depends on the build platform."
for toolchain in $VALID_TOOLCHAINS_all; do
# Use indirect variable referencing
toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain
TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
$PRINTF " %-22s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION"
done
- $PRINTF "\n"
+ $ECHO ""
# Print available JVM features
- $PRINTF "The following JVM features are valid as arguments to --with-jvm-features.\n"
- $PRINTF "Which are available to use depends on the environment and JVM variant.\n"
+ $ECHO "The following JVM features are valid as arguments to --with-jvm-features."
+ $ECHO "Which are available to use depends on the environment and JVM variant."
m4_foreach(FEATURE, m4_split(jvm_features_valid), [
# Create an m4 variable containing the description for FEATURE.
m4_define(FEATURE_DESCRIPTION, [jvm_feature_desc_]m4_translit(FEATURE, -, _))
@@ -257,115 +257,117 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
[
# Finally output some useful information to the user
- printf "\n"
- printf "====================================================\n"
+ $ECHO ""
+ $ECHO "===================================================="
if test "x$no_create" != "xyes"; then
if test "x$IS_RECONFIGURE" != "xyes"; then
- printf "A new configuration has been successfully created in\n%s\n" "$OUTPUTDIR"
+ $ECHO "A new configuration has been successfully created in"
+ $ECHO "$OUTPUTDIR"
else
- printf "The existing configuration has been successfully updated in\n%s\n" "$OUTPUTDIR"
+ $ECHO "The existing configuration has been successfully updated in"
+ $ECHO "$OUTPUTDIR"
fi
else
if test "x$IS_RECONFIGURE" != "xyes"; then
- printf "A configuration has been successfully checked but not created\n"
+ $ECHO "A configuration has been successfully checked but not created"
else
- printf "The existing configuration has been successfully checked in\n%s\n" "$OUTPUTDIR"
+ $ECHO "The existing configuration has been successfully checked in"
+ $ECHO "$OUTPUTDIR"
fi
fi
if test "x$CONFIGURE_COMMAND_LINE" != x; then
- printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n"
+ $ECHO "using configure arguments '$CONFIGURE_COMMAND_LINE'."
else
- printf "using default settings.\n"
+ $ECHO "using default settings."
fi
if test "x$REAL_CONFIGURE_COMMAND_EXEC_FULL" != x; then
- printf "\n"
- printf "The original configure invocation was '$REAL_CONFIGURE_COMMAND_EXEC_SHORT $REAL_CONFIGURE_COMMAND_LINE'.\n"
+ $ECHO ""
+ $ECHO "The original configure invocation was '$REAL_CONFIGURE_COMMAND_EXEC_SHORT $REAL_CONFIGURE_COMMAND_LINE'."
fi
- printf "\n"
- printf "Configuration summary:\n"
- printf "* Name: $CONF_NAME\n"
- printf "* Debug level: $DEBUG_LEVEL\n"
- printf "* HS debug level: $HOTSPOT_DEBUG_LEVEL\n"
- printf "* JVM variants: $JVM_VARIANTS\n"
- printf "* JVM features: "
+ $ECHO ""
+ $ECHO "Configuration summary:"
+ $ECHO "* Name: $CONF_NAME"
+ $ECHO "* Debug level: $DEBUG_LEVEL"
+ $ECHO "* HS debug level: $HOTSPOT_DEBUG_LEVEL"
+ $ECHO "* JVM variants: $JVM_VARIANTS"
+ $PRINTF "* JVM features: "
for variant in $JVM_VARIANTS; do
features_var_name=JVM_FEATURES_$variant
JVM_FEATURES_FOR_VARIANT=${!features_var_name}
- printf "$variant: \'$JVM_FEATURES_FOR_VARIANT\' "
+ $PRINTF "%s: \'%s\' " "$variant" "$JVM_FEATURES_FOR_VARIANT"
done
- printf "\n"
+ $ECHO ""
- printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
- printf "* Version string: $VERSION_STRING ($VERSION_SHORT)\n"
+ $ECHO "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS"
+ $ECHO "* Version string: $VERSION_STRING ($VERSION_SHORT)"
if test "x$SOURCE_DATE" != xupdated; then
source_date_info="$SOURCE_DATE ($SOURCE_DATE_ISO_8601)"
else
source_date_info="Determined at build time"
fi
- printf "* Source date: $source_date_info\n"
+ $ECHO "* Source date: $source_date_info"
- printf "\n"
- printf "Tools summary:\n"
+ $ECHO ""
+ $ECHO "Tools summary:"
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
- printf "* Environment: %s version %s; windows version %s; prefix \"%s\"; root \"%s\"\n" \
- "$WINENV_VENDOR" "$WINENV_VERSION" "$WINDOWS_VERSION" "$WINENV_PREFIX" "$WINENV_ROOT"
+ $ECHO "* Environment: $WINENV_VENDOR version $WINENV_VERSION; windows version $WINDOWS_VERSION; prefix \"$WINENV_PREFIX\"; root \"$WINENV_ROOT\""
fi
- printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n"
- printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n"
+ $ECHO "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)"
+ $ECHO "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)"
if test "x$DEVKIT_NAME" != x; then
- printf "* Devkit: $DEVKIT_NAME ($DEVKIT_ROOT)\n"
+ $ECHO "* Devkit: $DEVKIT_NAME ($DEVKIT_ROOT)"
elif test "x$DEVKIT_ROOT" != x; then
- printf "* Devkit: $DEVKIT_ROOT\n"
+ $ECHO "* Devkit: $DEVKIT_ROOT"
elif test "x$SYSROOT" != x; then
- printf "* Sysroot: $SYSROOT\n"
+ $ECHO "* Sysroot: $SYSROOT"
fi
- printf "* C Compiler: Version $CC_VERSION_NUMBER (at ${CC#"$FIXPATH "})\n"
- printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at ${CXX#"$FIXPATH "})\n"
+ $ECHO "* C Compiler: Version $CC_VERSION_NUMBER (at ${CC#"$FIXPATH "})"
+ $ECHO "* C++ Compiler: Version $CXX_VERSION_NUMBER (at ${CXX#"$FIXPATH "})"
- printf "\n"
- printf "Build performance summary:\n"
- printf "* Build jobs: $JOBS\n"
- printf "* Memory limit: $MEMORY_SIZE MB\n"
+ $ECHO ""
+ $ECHO "Build performance summary:"
+ $ECHO "* Build jobs: $JOBS"
+ $ECHO "* Memory limit: $MEMORY_SIZE MB"
if test "x$CCACHE_STATUS" != "x"; then
- printf "* ccache status: $CCACHE_STATUS\n"
+ $ECHO "* ccache status: $CCACHE_STATUS"
fi
- printf "\n"
+ $ECHO ""
if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then
- printf "NOTE: You have requested to build more than one version of the JVM, which\n"
- printf "will result in longer build times.\n"
- printf "\n"
+ $ECHO "NOTE: You have requested to build more than one version of the JVM, which"
+ $ECHO "will result in longer build times."
+ $ECHO ""
fi
if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then
- printf "WARNING: Your build output directory is not on a local disk.\n"
- printf "This will severely degrade build performance!\n"
- printf "It is recommended that you create an output directory on a local disk,\n"
- printf "and run the configure script again from that directory.\n"
- printf "\n"
+ $ECHO "WARNING: Your build output directory is not on a local disk."
+ $ECHO "This will severely degrade build performance!"
+ $ECHO "It is recommended that you create an output directory on a local disk,"
+ $ECHO "and run the configure script again from that directory."
+ $ECHO ""
fi
if test "x$IS_RECONFIGURE" = "xyes" && test "x$no_create" != "xyes"; then
- printf "WARNING: The result of this configuration has overridden an older\n"
- printf "configuration. You *should* run 'make clean' to make sure you get a\n"
- printf "proper build. Failure to do so might result in strange build problems.\n"
- printf "\n"
+ $ECHO "WARNING: The result of this configuration has overridden an older"
+ $ECHO "configuration. You *should* run 'make clean' to make sure you get a"
+ $ECHO "proper build. Failure to do so might result in strange build problems."
+ $ECHO ""
fi
if test "x$IS_RECONFIGURE" != "xyes" && test "x$no_create" = "xyes"; then
- printf "WARNING: The result of this configuration was not saved.\n"
- printf "You should run without '--no-create | -n' to create the configuration.\n"
- printf "\n"
+ $ECHO "WARNING: The result of this configuration was not saved."
+ $ECHO "You should run without '--no-create | -n' to create the configuration."
+ $ECHO ""
fi
if test "x$UNSUPPORTED_TOOLCHAIN_VERSION" = "xyes"; then
- printf "WARNING: The toolchain version used is known to have issues. Please\n"
- printf "consider using a supported version unless you know what you are doing.\n"
- printf "\n"
+ $ECHO "WARNING: The toolchain version used is known to have issues. Please"
+ $ECHO "consider using a supported version unless you know what you are doing."
+ $ECHO ""
fi
])
@@ -381,10 +383,10 @@ AC_DEFUN_ONCE([HELP_REPEAT_WARNINGS],
if test -e "$CONFIG_LOG_PATH/config.log"; then
$GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" > /dev/null 2>&1
if test $? -eq 0; then
- printf "The following warnings were produced. Repeated here for convenience:\n"
+ $ECHO "The following warnings were produced. Repeated here for convenience:"
# We must quote sed expression (using []) to stop m4 from eating the [].
$GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ]
- printf "\n"
+ $ECHO ""
fi
fi
])
diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4
index 72e731e7ffc..289ed935fdf 100644
--- a/make/autoconf/jdk-options.m4
+++ b/make/autoconf/jdk-options.m4
@@ -405,10 +405,19 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
JCOV_FILTERS="$with_jcov_filters"
fi
fi
+
+ UTIL_ARG_WITH(NAME: jcov-modules, TYPE: string,
+ DEFAULT: [], RESULT: JCOV_MODULES_COMMMA_SEPARATED,
+ DESC: [which modules to include in jcov (comma-separated)],
+ OPTIONAL: true)
+
+ # Replace "," with " ".
+ JCOV_MODULES=${JCOV_MODULES_COMMMA_SEPARATED//,/ }
AC_SUBST(JCOV_ENABLED)
AC_SUBST(JCOV_HOME)
AC_SUBST(JCOV_INPUT_JDK)
AC_SUBST(JCOV_FILTERS)
+ AC_SUBST(JCOV_MODULES)
])
################################################################################
@@ -520,8 +529,21 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_UNDEFINED_BEHAVIOR_SANITIZER],
# Silence them for now.
UBSAN_CHECKS="-fsanitize=undefined -fsanitize=float-divide-by-zero -fno-sanitize=shift-base -fno-sanitize=alignment \
$ADDITIONAL_UBSAN_CHECKS"
- UBSAN_CFLAGS="$UBSAN_CHECKS -Wno-stringop-truncation -Wno-format-overflow -Wno-array-bounds -Wno-stringop-overflow -fno-omit-frame-pointer -DUNDEFINED_BEHAVIOR_SANITIZER"
+ UBSAN_CFLAGS="$UBSAN_CHECKS -Wno-array-bounds -fno-omit-frame-pointer -DUNDEFINED_BEHAVIOR_SANITIZER"
+ if test "x$TOOLCHAIN_TYPE" = "xgcc"; then
+ UBSAN_CFLAGS="$UBSAN_CFLAGS -Wno-format-overflow -Wno-stringop-overflow -Wno-stringop-truncation"
+ fi
UBSAN_LDFLAGS="$UBSAN_CHECKS"
+ # On AIX, the llvm_symbolizer is not found out of the box, so we have to provide the
+ # full qualified llvm_symbolizer path in the __ubsan_default_options() function in
+ # make/data/ubsan/ubsan_default_options.c. To get it there we compile our sources
+ # with an additional define LLVM_SYMBOLIZER, which we set here.
+ # To calculate the correct llvm_symbolizer path we can use the location of the compiler, because
+ # their relation is fixed.
+ if test "x$TOOLCHAIN_TYPE" = "xclang" && test "x$OPENJDK_TARGET_OS" = "xaix"; then
+ UBSAN_CFLAGS="$UBSAN_CFLAGS -fno-sanitize=function,vptr -DLLVM_SYMBOLIZER=$(dirname $(dirname $CC))/tools/ibm-llvm-symbolizer"
+ UBSAN_LDFLAGS="$UBSAN_LDFLAGS -fno-sanitize=function,vptr -Wl,-bbigtoc"
+ fi
UTIL_ARG_ENABLE(NAME: ubsan, DEFAULT: false, RESULT: UBSAN_ENABLED,
DESC: [enable UndefinedBehaviorSanitizer],
CHECK_AVAILABLE: [
@@ -988,6 +1010,18 @@ AC_DEFUN([JDKOPT_SETUP_SIGNING_HOOK],
AC_SUBST(SIGNING_HOOK)
])
+################################################################################
+#
+# Setup how javac should handle warnings.
+#
+AC_DEFUN([JDKOPT_SETUP_JAVA_WARNINGS],
+[
+ UTIL_ARG_ENABLE(NAME: java-warnings-as-errors, DEFAULT: true,
+ RESULT: JAVA_WARNINGS_AS_ERRORS,
+ DESC: [consider java warnings to be an error])
+ AC_SUBST(JAVA_WARNINGS_AS_ERRORS)
+])
+
################################################################################
#
# fallback linker
diff --git a/make/autoconf/lib-bundled.m4 b/make/autoconf/lib-bundled.m4
index 091f01cadb5..3246697663c 100644
--- a/make/autoconf/lib-bundled.m4
+++ b/make/autoconf/lib-bundled.m4
@@ -62,19 +62,29 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBJPEG],
if test "x${with_libjpeg}" = "xbundled"; then
USE_EXTERNAL_LIBJPEG=false
+ LIBJPEG_CFLAGS=""
+ LIBJPEG_LIBS=""
elif test "x${with_libjpeg}" = "xsystem"; then
- AC_CHECK_HEADER(jpeglib.h, [],
- [ AC_MSG_ERROR([--with-libjpeg=system specified, but jpeglib.h not found!])])
- AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, [],
- [ AC_MSG_ERROR([--with-libjpeg=system specified, but no libjpeg found])])
+ PKG_CHECK_MODULES(LIBJPEG, libjpeg, [LIBJPEG_FOUND=yes], [LIBJPEG_FOUND=no])
+ if test "x${LIBJPEG_FOUND}" = "xyes"; then
+ # PKG_CHECK_MODULES will set LIBJPEG_CFLAGS and LIBJPEG_LIBS
+ USE_EXTERNAL_LIBJPEG=true
+ else
+ AC_CHECK_HEADER(jpeglib.h, [],
+ [ AC_MSG_ERROR([--with-libjpeg=system specified, but jpeglib.h not found!])])
+ AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, [],
+ [ AC_MSG_ERROR([--with-libjpeg=system specified, but no libjpeg found])])
- USE_EXTERNAL_LIBJPEG=true
- LIBJPEG_LIBS="-ljpeg"
+ USE_EXTERNAL_LIBJPEG=true
+ LIBJPEG_CFLAGS=""
+ LIBJPEG_LIBS="-ljpeg"
+ fi
else
AC_MSG_ERROR([Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled'])
fi
AC_SUBST(USE_EXTERNAL_LIBJPEG)
+ AC_SUBST(LIBJPEG_CFLAGS)
AC_SUBST(LIBJPEG_LIBS)
])
@@ -85,6 +95,10 @@ AC_DEFUN_ONCE([LIB_SETUP_GIFLIB],
[
AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib],
[use giflib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
+ AC_ARG_WITH(giflib-include, [AS_HELP_STRING([--with-giflib-include],
+ [specify directory for the system giflib include files])])
+ AC_ARG_WITH(giflib-lib, [AS_HELP_STRING([--with-giflib-lib],
+ [specify directory for the system giflib library])])
AC_MSG_CHECKING([for which giflib to use])
# default is bundled
@@ -97,11 +111,40 @@ AC_DEFUN_ONCE([LIB_SETUP_GIFLIB],
if test "x${with_giflib}" = "xbundled"; then
USE_EXTERNAL_LIBGIF=false
+ GIFLIB_CFLAGS=""
+ GIFLIB_LIBS=""
elif test "x${with_giflib}" = "xsystem"; then
- AC_CHECK_HEADER(gif_lib.h, [],
- [ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!])])
- AC_CHECK_LIB(gif, DGifGetCode, [],
- [ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])])
+ GIFLIB_H_FOUND=no
+ if test "x${with_giflib_include}" != x; then
+ GIFLIB_CFLAGS="-I${with_giflib_include}"
+ GIFLIB_H_FOUND=yes
+ fi
+ if test "x$GIFLIB_H_FOUND" = xno; then
+ AC_CHECK_HEADER(gif_lib.h,
+ [
+ GIFLIB_CFLAGS=""
+ GIFLIB_H_FOUND=yes
+ ])
+ fi
+ if test "x$GIFLIB_H_FOUND" = xno; then
+ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!])
+ fi
+
+ GIFLIB_LIB_FOUND=no
+ if test "x${with_giflib_lib}" != x; then
+ GIFLIB_LIBS="-L${with_giflib_lib} -lgif"
+ GIFLIB_LIB_FOUND=yes
+ fi
+ if test "x$GIFLIB_LIB_FOUND" = xno; then
+ AC_CHECK_LIB(gif, DGifGetCode,
+ [
+ GIFLIB_LIBS="-lgif"
+ GIFLIB_LIB_FOUND=yes
+ ])
+ fi
+ if test "x$GIFLIB_LIB_FOUND" = xno; then
+ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])
+ fi
USE_EXTERNAL_LIBGIF=true
GIFLIB_LIBS=-lgif
@@ -110,6 +153,7 @@ AC_DEFUN_ONCE([LIB_SETUP_GIFLIB],
fi
AC_SUBST(USE_EXTERNAL_LIBGIF)
+ AC_SUBST(GIFLIB_CFLAGS)
AC_SUBST(GIFLIB_LIBS)
])
diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4
index b946be97d96..bf697928f1b 100644
--- a/make/autoconf/libraries.m4
+++ b/make/autoconf/libraries.m4
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2025, 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
@@ -98,13 +98,7 @@ AC_DEFUN([LIB_SETUP_JVM_LIBS],
# 32-bit platforms needs fallback library for 8-byte atomic ops on Zero
if HOTSPOT_CHECK_JVM_VARIANT(zero); then
if test "x$OPENJDK_$1_OS" = xlinux &&
- (test "x$OPENJDK_$1_CPU" = xarm ||
- test "x$OPENJDK_$1_CPU" = xm68k ||
- test "x$OPENJDK_$1_CPU" = xmips ||
- test "x$OPENJDK_$1_CPU" = xmipsel ||
- test "x$OPENJDK_$1_CPU" = xppc ||
- test "x$OPENJDK_$1_CPU" = xsh ||
- test "x$OPENJDK_$1_CPU" = xriscv32); then
+ test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then
BASIC_JVM_LIBS_$1="$BASIC_JVM_LIBS_$1 -latomic"
fi
fi
diff --git a/make/autoconf/spec.gmk.template b/make/autoconf/spec.gmk.template
index 80c6dfc2ba2..e720916d88a 100644
--- a/make/autoconf/spec.gmk.template
+++ b/make/autoconf/spec.gmk.template
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2025, 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
@@ -454,6 +454,7 @@ JCOV_ENABLED := @JCOV_ENABLED@
JCOV_HOME := @JCOV_HOME@
JCOV_INPUT_JDK := @JCOV_INPUT_JDK@
JCOV_FILTERS := @JCOV_FILTERS@
+JCOV_MODULES := @JCOV_MODULES@
# AddressSanitizer
ASAN_ENABLED := @ASAN_ENABLED@
@@ -517,6 +518,7 @@ DISABLED_WARNINGS_CXX := @DISABLED_WARNINGS_CXX@
# A global flag (true or false) determining if native warnings are considered errors.
WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@
+JAVA_WARNINGS_AS_ERRORS := @JAVA_WARNINGS_AS_ERRORS@
CFLAGS_CCACHE := @CFLAGS_CCACHE@
ADLC_LANGSTD_CXXFLAGS := @ADLC_LANGSTD_CXXFLAGS@
@@ -800,8 +802,10 @@ TAR_SUPPORTS_TRANSFORM := @TAR_SUPPORTS_TRANSFORM@
# Build setup
USE_EXTERNAL_LIBJPEG := @USE_EXTERNAL_LIBJPEG@
+LIBJPEG_CFLAGS := @LIBJPEG_CFLAGS@
LIBJPEG_LIBS := @LIBJPEG_LIBS@
USE_EXTERNAL_LIBGIF := @USE_EXTERNAL_LIBGIF@
+GIFLIB_CFLAGS := @GIFLIB_CFLAGS@
GIFLIB_LIBS := @GIFLIB_LIBS@
USE_EXTERNAL_LIBZ := @USE_EXTERNAL_LIBZ@
LIBZ_CFLAGS := @LIBZ_CFLAGS@
@@ -843,10 +847,12 @@ SVE_CFLAGS := @SVE_CFLAGS@
JDK_IMAGE_SUBDIR := jdk
JRE_IMAGE_SUBDIR := jre
JCOV_IMAGE_SUBDIR := jdk-jcov
+STATIC_JDK_IMAGE_SUBDIR := static-jdk
# Colon left out to be able to override output dir for bootcycle-images
JDK_IMAGE_DIR = $(IMAGES_OUTPUTDIR)/$(JDK_IMAGE_SUBDIR)
JRE_IMAGE_DIR = $(IMAGES_OUTPUTDIR)/$(JRE_IMAGE_SUBDIR)
+STATIC_JDK_IMAGE_DIR = $(IMAGES_OUTPUTDIR)/$(STATIC_JDK_IMAGE_SUBDIR)
JCOV_IMAGE_DIR = $(IMAGES_OUTPUTDIR)/$(JCOV_IMAGE_SUBDIR)
# Test image, as above
@@ -926,6 +932,7 @@ DOCS_JAVASE_BUNDLE_NAME := javase-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
DOCS_REFERENCE_BUNDLE_NAME := jdk-reference-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
STATIC_LIBS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-static-libs$(DEBUG_PART).tar.gz
STATIC_LIBS_GRAAL_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-static-libs-graal$(DEBUG_PART).tar.gz
+STATIC_JDK_BUNDLE_NAME := static-jdk-$(BASE_NAME)_bin$(DEBUG_PART).$(JDK_BUNDLE_EXTENSION)
JCOV_BUNDLE_NAME := jdk-jcov-$(BASE_NAME)_bin$(DEBUG_PART).$(JDK_BUNDLE_EXTENSION)
JDK_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JDK_BUNDLE_NAME)
@@ -936,6 +943,7 @@ TEST_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(TEST_BUNDLE_NAME)
DOCS_JDK_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(DOCS_JDK_BUNDLE_NAME)
DOCS_JAVASE_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(DOCS_JAVASE_BUNDLE_NAME)
DOCS_REFERENCE_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(DOCS_REFERENCE_BUNDLE_NAME)
+STATIC_JDK_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(STATIC_JDK_BUNDLE_NAME)
JCOV_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JCOV_BUNDLE_NAME)
# This macro is called to allow inclusion of closed source counterparts.
diff --git a/make/autoconf/util_paths.m4 b/make/autoconf/util_paths.m4
index 9e3e5472c9e..40864680aad 100644
--- a/make/autoconf/util_paths.m4
+++ b/make/autoconf/util_paths.m4
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2025, 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
@@ -58,21 +58,32 @@ AC_DEFUN([UTIL_PREPEND_TO_PATH],
# 2) The path will be absolute, and it will be in unix-style (on
# cygwin).
# $1: The name of the variable to fix
-# $2: if NOFAIL, errors will be silently ignored
+# $2: if NOFAIL, if the path cannot be resolved then errors will not be
+# reported and an empty path will be set
AC_DEFUN([UTIL_FIXUP_PATH],
[
# Only process if variable expands to non-empty
path="[$]$1"
if test "x$path" != x; then
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
- if test "x$2" = "xNOFAIL"; then
- quiet_option="-q"
+ imported_path=`$FIXPATH_BASE -q import "$path"`
+ if test $? -ne 0 || test ! -e $imported_path; then
+ if test "x$2" != "xNOFAIL"; then
+ AC_MSG_NOTICE([The path of $1, which is given as "$path", can not be properly resolved.])
+ AC_MSG_NOTICE([Please see the section "Special Considerations" in building.md.])
+ AC_MSG_NOTICE([This is the error message given by fixpath:])
+ # Rerun fixpath without -q to get an error message
+ $FIXPATH_BASE import "$path"
+ AC_MSG_ERROR([Cannot continue])
+ else
+ imported_path=""
+ fi
fi
- imported_path=`$FIXPATH_BASE $quiet_option import "$path"`
- $FIXPATH_BASE verify "$imported_path"
+
+ $FIXPATH_BASE -q verify "$imported_path"
if test $? -ne 0; then
if test "x$2" != "xNOFAIL"; then
- AC_MSG_ERROR([The path of $1, which resolves as "$path", could not be imported.])
+ AC_MSG_ERROR([The path of $1, which resolves as "$path", could not be verified.])
else
imported_path=""
fi
@@ -83,7 +94,7 @@ AC_DEFUN([UTIL_FIXUP_PATH],
if test "x$imported_path_lower" != "x$orig_path_lower"; then
$1="$imported_path"
fi
- else
+ else # non-Windows
[ if [[ "$path" =~ " " ]]; then ]
if test "x$2" != "xNOFAIL"; then
AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.])
@@ -186,7 +197,6 @@ AC_DEFUN([UTIL_CHECK_WINENV_EXEC_TYPE],
# it need to be in the PATH.
# $1: The name of the variable to fix
# $2: Where to look for the command (replaces $PATH)
-# $3: set to NOFIXPATH to skip prefixing FIXPATH, even if needed on platform
AC_DEFUN([UTIL_FIXUP_EXECUTABLE],
[
input="[$]$1"
@@ -233,15 +243,19 @@ AC_DEFUN([UTIL_FIXUP_EXECUTABLE],
# This is a path with slashes, don't look at $PATH
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
# fixpath.sh import will do all heavy lifting for us
- new_path=`$FIXPATH_BASE import "$path"`
+ new_path=`$FIXPATH_BASE -q import "$path"`
- if test ! -e $new_path; then
+ if test $? -ne 0 || test ! -e $new_path; then
# It failed, but maybe spaces were part of the path and not separating
# the command and argument. Retry using that assumption.
- new_path=`$FIXPATH_BASE import "$input"`
- if test ! -e $new_path; then
- AC_MSG_NOTICE([The command for $1, which resolves as "$input", can not be found.])
- AC_MSG_ERROR([Cannot locate $input])
+ new_path=`$FIXPATH_BASE -q import "$input"`
+ if test $? -ne 0 || test ! -e $new_path; then
+ AC_MSG_NOTICE([The command for $1, which is given as "$input", can not be properly resolved.])
+ AC_MSG_NOTICE([Please see the section "Special Considerations" in building.md.])
+ AC_MSG_NOTICE([This is the error message given by fixpath:])
+ # Rerun fixpath without -q to get an error message
+ $FIXPATH_BASE import "$input"
+ AC_MSG_ERROR([Cannot continue])
fi
# It worked, clear all "arguments"
arguments=""
@@ -282,10 +296,6 @@ AC_DEFUN([UTIL_FIXUP_EXECUTABLE],
fi
fi
- if test "x$3" = xNOFIXPATH; then
- fixpath_prefix=""
- fi
-
# Now join together the path and the arguments once again
new_complete="$fixpath_prefix$new_path$arguments"
$1="$new_complete"
@@ -353,7 +363,15 @@ AC_DEFUN([UTIL_SETUP_TOOL],
else
# Otherwise we believe it is a complete path. Use it as it is.
if test ! -x "$tool_command" && test ! -x "${tool_command}.exe"; then
- AC_MSG_ERROR([User supplied tool $1="$tool_command" does not exist or is not executable])
+ # Maybe the path had spaces in it; try again with the entire argument
+ if test ! -x "$tool_override" && test ! -x "${tool_override}.exe"; then
+ AC_MSG_ERROR([User supplied tool $1="$tool_override" does not exist or is not executable])
+ else
+ # We successfully located the executable assuming the spaces were part of the path.
+ # We can't combine using paths with spaces and arguments, so assume tool_args is empty.
+ tool_command="$tool_override"
+ tool_args=""
+ fi
fi
if test ! -x "$tool_command"; then
tool_command="${tool_command}.exe"
@@ -379,7 +397,6 @@ AC_DEFUN([UTIL_SETUP_TOOL],
# $1: variable to set
# $2: executable name (or list of names) to look for
# $3: [path]
-# $4: set to NOFIXPATH to skip prefixing FIXPATH, even if needed on platform
AC_DEFUN([UTIL_LOOKUP_PROGS],
[
UTIL_SETUP_TOOL($1, [
@@ -421,10 +438,8 @@ AC_DEFUN([UTIL_LOOKUP_PROGS],
# If we have FIXPATH enabled, strip all instances of it and prepend
# a single one, to avoid double fixpath prefixing.
- if test "x$4" != xNOFIXPATH; then
- [ if [[ $FIXPATH != "" && $result =~ ^"$FIXPATH " ]]; then ]
- result="\$FIXPATH ${result#"$FIXPATH "}"
- fi
+ [ if [[ $FIXPATH != "" && $result =~ ^"$FIXPATH " ]]; then ]
+ result="\$FIXPATH ${result#"$FIXPATH "}"
fi
AC_MSG_RESULT([$result])
break 2;
@@ -515,6 +530,24 @@ AC_DEFUN([UTIL_ADD_FIXPATH],
fi
])
+################################################################################
+# Return a path to the executable binary from a command line, stripping away
+# any FIXPATH prefix or arguments. The resulting value can be checked for
+# existence using "test -e". The result is returned in a variable named
+# "$1_EXECUTABLE".
+#
+# $1: variable describing the command to get the binary for
+AC_DEFUN([UTIL_GET_EXECUTABLE],
+[
+ # Strip the FIXPATH prefix, if any
+ fixpath_stripped="[$]$1"
+ [ if [[ $FIXPATH != "" && $fixpath_stripped =~ ^"$FIXPATH " ]]; then ]
+ fixpath_stripped="${fixpath_stripped#"$FIXPATH "}"
+ fi
+ # Remove any arguments following the binary
+ $1_EXECUTABLE="${fixpath_stripped%% *}"
+])
+
################################################################################
AC_DEFUN([UTIL_REMOVE_SYMBOLIC_LINKS],
[
diff --git a/make/common/FindTests.gmk b/make/common/FindTests.gmk
index 1f3a70b3035..517bb2973f4 100644
--- a/make/common/FindTests.gmk
+++ b/make/common/FindTests.gmk
@@ -58,13 +58,15 @@ ifeq ($(GENERATE_FIND_TESTS_FILE), true)
$(TOPDIR)/test/make/TestMake.gmk
$(call MakeTargetDir)
( $(foreach root, $(JTREG_TESTROOTS), \
- $(PRINTF) "\n$(root)_JTREG_TEST_GROUPS := " ; \
+ $(ECHO) ""; \
+ $(PRINTF) "\n%s_JTREG_TEST_GROUPS := " "$(root)"; \
$(SED) -n -e 's/^\#.*//g' -e 's/\([^ ]*\)\w*=.*/\1/gp' \
$($(root)_JTREG_GROUP_FILES) \
| $(SORT) -u | $(TR) '\n' ' ' ; \
) \
) > $@
- $(PRINTF) "\nMAKE_TEST_TARGETS := " >> $@
+ $(ECHO) "" >> $@
+ $(PRINTF) "MAKE_TEST_TARGETS := " >> $@
$(MAKE) -s --no-print-directory $(MAKE_ARGS) \
SPEC=$(SPEC) -f $(TOPDIR)/test/make/TestMake.gmk print-targets \
TARGETS_FILE=$@
diff --git a/make/common/JarArchive.gmk b/make/common/JarArchive.gmk
index 1f8ed1bc002..26a98f28949 100644
--- a/make/common/JarArchive.gmk
+++ b/make/common/JarArchive.gmk
@@ -256,7 +256,7 @@ define SetupJarArchiveBody
$$(if $$($1_JARMAIN), \
$(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
$$(if $$($1_EXTRA_MANIFEST_ATTR), \
- $(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
+ $(ECHO) "$$($1_EXTRA_MANIFEST_ATTR)" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
$(ECHO) Creating $$($1_NAME) $$(NEWLINE) \
$$($1_JAR_CMD) --create $$($1_JAR_OPTIONS) --file $$@ --manifest $$($1_MANIFEST_FILE) $$(NEWLINE) \
$$($1_SCAPTURE_CONTENTS) \
diff --git a/make/common/JavaCompilation.gmk b/make/common/JavaCompilation.gmk
index f48aefcd517..c5a74413de1 100644
--- a/make/common/JavaCompilation.gmk
+++ b/make/common/JavaCompilation.gmk
@@ -80,15 +80,13 @@ endef
#
# The sed expression does this:
# 1. Add a backslash before any :, = or ! that do not have a backslash already.
-# 2. Apply the file unicode2x.sed which does a whole bunch of \u00XX to \xXX
-# conversions.
-# 3. Delete all lines starting with #.
-# 4. Delete empty lines.
-# 5. Append lines ending with \ with the next line.
-# 6. Remove leading and trailing white space. Note that tabs must be explicit
+# 2. Delete all lines starting with #.
+# 3. Delete empty lines.
+# 4. Append lines ending with \ with the next line.
+# 5. Remove leading and trailing white space. Note that tabs must be explicit
# as sed on macosx does not understand '\t'.
-# 7. Replace the first \= with just =.
-# 8. Finally it's all sorted to create a stable output.
+# 6. Replace the first \= with just =.
+# 7. Finally it's all sorted to create a stable output.
#
# It is assumed that = is the character used for separating names and values.
define add_file_to_clean
@@ -108,7 +106,6 @@ define add_file_to_clean
( $(CAT) $$< && $(ECHO) "" ) \
| $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' \
-e 's/\([^\\]\)!/\1\\!/g' -e 's/^[ ]*#.*/#/g' \
- | $(SED) -f "$$(TOPDIR)/make/common/support/unicode2x.sed" \
| $(SED) -e '/^#/d' -e '/^$$$$/d' \
-e :a -e '/\\$$$$/N; s/\\\n//; ta' \
-e 's/^[ ]*//;s/[ ]*$$$$//' \
@@ -155,6 +152,7 @@ endef
# INCLUDE_FILES "com/sun/SolarisFoobar.java" means only compile this file!
# EXCLUDE_FILES "com/sun/SolarisFoobar.java" means do not compile this particular file!
# "SolarisFoobar.java" means do not compile SolarisFoobar, wherever it is found.
+# EXCLUDE_PATTERNS Exclude files matching any of these substrings
# EXTRA_FILES List of extra source files to include in compilation. Can be used to
# specify files that need to be generated by other rules first.
# HEADERS path to directory where all generated c-headers are written.
@@ -264,14 +262,17 @@ define SetupJavaCompilationBody
$$(error Invalid value for COMPILER in SetupJavaCompilation for $1: '$$($1_COMPILER)')
endif
- # Allow overriding on the command line
- JAVA_WARNINGS_ARE_ERRORS ?= -Werror
-
# Tell javac to do exactly as told and no more
- PARANOIA_FLAGS := -implicit:none -Xprefer:source -XDignore.symbol.file=true -encoding ascii
+ PARANOIA_FLAGS := -implicit:none -Xprefer:source -XDignore.symbol.file=true
- $1_FLAGS += -g -Xlint:all $$($1_TARGET_RELEASE) $$(PARANOIA_FLAGS) $$(JAVA_WARNINGS_ARE_ERRORS)
+ $1_FLAGS += -g -Xlint:all $$($1_TARGET_RELEASE) $$(PARANOIA_FLAGS)
$1_FLAGS += $$($1_JAVAC_FLAGS)
+ # Set character encoding in source
+ $1_FLAGS += -encoding utf-8
+
+ ifeq ($$(JAVA_WARNINGS_AS_ERRORS), true)
+ $1_FLAGS += -Werror
+ endif
ifneq ($$($1_DISABLED_WARNINGS), )
$1_FLAGS += -Xlint:$$(call CommaList, $$(addprefix -, $$($1_DISABLED_WARNINGS)))
@@ -332,6 +333,20 @@ define SetupJavaCompilationBody
$1_INCLUDE_PATTERN += $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$(addsuffix /%, $$($1_INCLUDES))))
endif
+ ifneq ($$($1_EXCLUDE_PATTERNS), )
+ # We must not match the exclude pattern against the src roots, so first
+ # strip the src prefixes from the absolute file paths in SRCS.
+ $1_SRCS_WITHOUT_ROOTS := $$(foreach i, $$($1_SRC), \
+ $$(patsubst $$i/%,%, $$(filter $$i/%, $$($1_SRCS))))
+ $1_EXCLUDE_PATTERNS_WITHOUT_ROOTS := $$(call containing, \
+ $$($1_EXCLUDE_PATTERNS), $$($1_SRCS_WITHOUT_ROOTS))
+ # The add back all possible src prefixes; this will generate more paths
+ # than really exists, but it does not matter since we will use this as
+ # input to filter-out.
+ $1_EXCLUDE_PATTERN += $$(foreach i, $$($1_SRC), $$(addprefix $$i/, \
+ $$($1_EXCLUDE_PATTERNS_WITHOUT_ROOTS)))
+ endif
+
# Apply include/exclude patterns to java sources
ifneq ($$($1_EXCLUDE_PATTERN), )
$1_SRCS := $$(filter-out $$($1_EXCLUDE_PATTERN), $$($1_SRCS))
diff --git a/make/common/JdkNativeCompilation.gmk b/make/common/JdkNativeCompilation.gmk
index 372ad39305c..0285669ffd8 100644
--- a/make/common/JdkNativeCompilation.gmk
+++ b/make/common/JdkNativeCompilation.gmk
@@ -227,6 +227,8 @@ endef
GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/version.rc
+# \xA9 is the copyright symbol in ANSI encoding (Windows-1252), which rc.exe
+# assumes the resource file is in.
JDK_RCFLAGS=$(RCFLAGS) \
-D"JDK_VERSION_STRING=$(VERSION_STRING)" \
-D"JDK_COMPANY=$(JDK_RC_COMPANY_NAME)" \
diff --git a/make/common/MakeFileStart.gmk b/make/common/MakeFileStart.gmk
index f1dd0abb792..f18c623d3e8 100644
--- a/make/common/MakeFileStart.gmk
+++ b/make/common/MakeFileStart.gmk
@@ -47,7 +47,7 @@ endif
# We need spec.gmk to get $(TOPDIR)
include $(SPEC)
-THIS_MAKEFILE := $(patsubst make/%,%,$(patsubst $(TOPDIR)/%,%,$(THIS_MAKEFILE_PATH)))
+THIS_MAKEFILE := $(patsubst make/%,%,$(patsubst $(TOPDIR_ALT)/make/%,%,$(patsubst $(TOPDIR)/%,%,$(THIS_MAKEFILE_PATH))))
ifeq ($(LOG_FLOW), true)
$(info :Enter $(THIS_MAKEFILE))
diff --git a/make/common/MakeIncludeStart.gmk b/make/common/MakeIncludeStart.gmk
index d09f027c1d3..3904633f9f2 100644
--- a/make/common/MakeIncludeStart.gmk
+++ b/make/common/MakeIncludeStart.gmk
@@ -29,7 +29,7 @@
# Get the next to last word (by prepending a padding element)
THIS_INCLUDE_PATH := $(word $(words ${MAKEFILE_LIST}),padding ${MAKEFILE_LIST})
-THIS_INCLUDE := $(patsubst $(TOPDIR)/make/%,%,$(THIS_INCLUDE_PATH))
+THIS_INCLUDE := $(patsubst $(TOPDIR_ALT)/make/%,%,$(patsubst $(TOPDIR)/make/%,%,$(THIS_INCLUDE_PATH)))
# Print an indented message, also counting the top-level makefile as a level
ifneq ($(INCLUDE_GUARD_$(THIS_INCLUDE)), true)
diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk
index f4f815c740d..725424d7618 100644
--- a/make/common/Modules.gmk
+++ b/make/common/Modules.gmk
@@ -180,7 +180,7 @@ ifeq ($(GENERATE_MODULE_DEPS_FILE), true)
$(call MakeTargetDir)
$(RM) $@
$(foreach m, $(MODULE_INFOS), \
- ( $(PRINTF) "DEPS_$(call GetModuleNameFromModuleInfo, $m) := " && \
+ ( $(PRINTF) "DEPS_%s := " "$(call GetModuleNameFromModuleInfo, $m)" && \
$(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) ' \
BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
/^ *requires/ { sub(/;/, ""); \
@@ -194,7 +194,7 @@ ifeq ($(GENERATE_MODULE_DEPS_FILE), true)
gsub(/\r/, ""); \
printf(" %s", $$0) } \
END { printf("\n") }' $m && \
- $(PRINTF) "TRANSITIVE_MODULES_$(call GetModuleNameFromModuleInfo, $m) := " && \
+ $(PRINTF) "TRANSITIVE_MODULES_%s := " "$(call GetModuleNameFromModuleInfo, $m)" && \
$(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) ' \
BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
/^ *requires *transitive/ { \
diff --git a/make/common/modules/GensrcCommon.gmk b/make/common/modules/GensrcCommon.gmk
index 64d1f71d82e..2a94c3f9a42 100644
--- a/make/common/modules/GensrcCommon.gmk
+++ b/make/common/modules/GensrcCommon.gmk
@@ -41,8 +41,8 @@ include $(TOPDIR)/make/ToolsJdk.gmk
define SetupVersionProperties
$(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/$$(strip $2):
$$(call MakeTargetDir)
- $(PRINTF) "jdk=$(VERSION_NUMBER)\nfull=$(VERSION_STRING)\nrelease=$(VERSION_SHORT)\n" \
- > $$@
+ $(PRINTF) "jdk=%s\nfull=%s\nrelease=%s\n" \
+ $(VERSION_NUMBER) $(VERSION_STRING) $(VERSION_SHORT) > $$@
$$(strip $1) += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/$$(strip $2)
endef
diff --git a/make/common/native/Paths.gmk b/make/common/native/Paths.gmk
index ee097b2e134..bdb8828eb32 100644
--- a/make/common/native/Paths.gmk
+++ b/make/common/native/Paths.gmk
@@ -128,10 +128,9 @@ define SetupSourceFiles
# Extract the C/C++ files.
ifneq ($$($1_EXCLUDE_PATTERNS), )
# We must not match the exclude pattern against the src root(s).
- $1_SRCS_WITHOUT_ROOTS := $$($1_SRCS)
- $$(foreach i, $$($1_SRC), $$(eval $1_SRCS_WITHOUT_ROOTS := $$(patsubst \
- $$i/%,%, $$($1_SRCS_WITHOUT_ROOTS))))
- $1_ALL_EXCLUDE_FILES := $$(call containing, $$($1_EXCLUDE_PATTERNS), \
+ $1_SRCS_WITHOUT_ROOTS := $$(foreach i, $$($1_SRC), \
+ $$(patsubst $$i/%,%, $$(filter $$i/%, $$($1_SRCS))))
+ $1_ALL_EXCLUDE_FILES := $$(call containing, $$($1_EXCLUDE_PATTERNS), \
$$($1_SRCS_WITHOUT_ROOTS))
endif
ifneq ($$($1_EXCLUDE_FILES), )
diff --git a/make/common/support/unicode2x.sed b/make/common/support/unicode2x.sed
deleted file mode 100644
index 5188b97fe03..00000000000
--- a/make/common/support/unicode2x.sed
+++ /dev/null
@@ -1,100 +0,0 @@
-s/\\u0020/\x20/g
-s/\\u003A/\x3A/g
-s/\\u006B/\x6B/g
-s/\\u0075/\x75/g
-s/\\u00A0/\xA0/g
-s/\\u00A3/\xA3/g
-s/\\u00B0/\xB0/g
-s/\\u00B7/\xB7/g
-s/\\u00BA/\xBA/g
-s/\\u00BF/\xBF/g
-s/\\u00C0/\xC0/g
-s/\\u00C1/\xC1/g
-s/\\u00C2/\xC2/g
-s/\\u00C4/\xC4/g
-s/\\u00C5/\xC5/g
-s/\\u00C8/\xC8/g
-s/\\u00C9/\xC9/g
-s/\\u00CA/\xCA/g
-s/\\u00CD/\xCD/g
-s/\\u00CE/\xCE/g
-s/\\u00D3/\xD3/g
-s/\\u00D4/\xD4/g
-s/\\u00D6/\xD6/g
-s/\\u00DA/\xDA/g
-s/\\u00DC/\xDC/g
-s/\\u00DD/\xDD/g
-s/\\u00DF/\xDF/g
-s/\\u00E0/\xE0/g
-s/\\u00E1/\xE1/g
-s/\\u00E2/\xE2/g
-s/\\u00E3/\xE3/g
-s/\\u00E4/\xE4/g
-s/\\u00E5/\xE5/g
-s/\\u00E6/\xE6/g
-s/\\u00E7/\xE7/g
-s/\\u00E8/\xE8/g
-s/\\u00E9/\xE9/g
-s/\\u00EA/\xEA/g
-s/\\u00EB/\xEB/g
-s/\\u00EC/\xEC/g
-s/\\u00ED/\xED/g
-s/\\u00EE/\xEE/g
-s/\\u00EF/\xEF/g
-s/\\u00F1/\xF1/g
-s/\\u00F2/\xF2/g
-s/\\u00F3/\xF3/g
-s/\\u00F4/\xF4/g
-s/\\u00F5/\xF5/g
-s/\\u00F6/\xF6/g
-s/\\u00F9/\xF9/g
-s/\\u00FA/\xFA/g
-s/\\u00FC/\xFC/g
-s/\\u0020/\x20/g
-s/\\u003f/\x3f/g
-s/\\u006f/\x6f/g
-s/\\u0075/\x75/g
-s/\\u00a0/\xa0/g
-s/\\u00a3/\xa3/g
-s/\\u00b0/\xb0/g
-s/\\u00ba/\xba/g
-s/\\u00bf/\xbf/g
-s/\\u00c1/\xc1/g
-s/\\u00c4/\xc4/g
-s/\\u00c5/\xc5/g
-s/\\u00c8/\xc8/g
-s/\\u00c9/\xc9/g
-s/\\u00ca/\xca/g
-s/\\u00cd/\xcd/g
-s/\\u00d6/\xd6/g
-s/\\u00dc/\xdc/g
-s/\\u00dd/\xdd/g
-s/\\u00df/\xdf/g
-s/\\u00e0/\xe0/g
-s/\\u00e1/\xe1/g
-s/\\u00e2/\xe2/g
-s/\\u00e3/\xe3/g
-s/\\u00e4/\xe4/g
-s/\\u00e5/\xe5/g
-s/\\u00e7/\xe7/g
-s/\\u00e8/\xe8/g
-s/\\u00e9/\xe9/g
-s/\\u00ea/\xea/g
-s/\\u00eb/\xeb/g
-s/\\u00ec/\xec/g
-s/\\u00ed/\xed/g
-s/\\u00ee/\xee/g
-s/\\u00ef/\xef/g
-s/\\u00f0/\xf0/g
-s/\\u00f1/\xf1/g
-s/\\u00f2/\xf2/g
-s/\\u00f3/\xf3/g
-s/\\u00f4/\xf4/g
-s/\\u00f5/\xf5/g
-s/\\u00f6/\xf6/g
-s/\\u00f7/\xf7/g
-s/\\u00f8/\xf8/g
-s/\\u00f9/\xf9/g
-s/\\u00fa/\xfa/g
-s/\\u00fc/\xfc/g
-s/\\u00ff/\xff/g
diff --git a/make/conf/github-actions.conf b/make/conf/github-actions.conf
index c25e51a48e4..27845ffbd7a 100644
--- a/make/conf/github-actions.conf
+++ b/make/conf/github-actions.conf
@@ -33,8 +33,8 @@ LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk24/1f9ff9062db4449d8
LINUX_X64_BOOT_JDK_SHA256=88b090fa80c6c1d084ec9a755233967458788e2c0777ae2e172230c5c692d7ef
ALPINE_LINUX_X64_BOOT_JDK_EXT=tar.gz
-ALPINE_LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin24-binaries/releases/download/jdk-24%2B36/OpenJDK24U-jdk_aarch64_alpine-linux_hotspot_24_36.tar.gz
-ALPINE_LINUX_X64_BOOT_JDK_SHA256=4a673456aa6e726b86108a095a21868b7ebcdde050a92b3073d50105ff92f07f
+ALPINE_LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin24-binaries/releases/download/jdk-24%2B36/OpenJDK24U-jdk_x64_alpine-linux_hotspot_24_36.tar.gz
+ALPINE_LINUX_X64_BOOT_JDK_SHA256=a642608f0da78344ee6812fb1490b8bc1d7ad5a18064c70994d6f330568c51cb
MACOS_AARCH64_BOOT_JDK_EXT=tar.gz
MACOS_AARCH64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk24/1f9ff9062db4449d8ca828c504ffae90/36/GPL/openjdk-24_macos-aarch64_bin.tar.gz
diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js
index 02474f3dccb..9bedc77cc28 100644
--- a/make/conf/jib-profiles.js
+++ b/make/conf/jib-profiles.js
@@ -241,10 +241,10 @@ var getJibProfilesCommon = function (input, data) {
// List of the main profile names used for iteration
common.main_profile_names = [
- "linux-x64", "linux-x86", "macosx-x64", "macosx-aarch64",
+ "macosx-x64", "macosx-aarch64",
"windows-x64", "windows-aarch64",
- "linux-aarch64", "linux-arm32", "linux-ppc64le", "linux-s390x",
- "linux-riscv64"
+ "linux-x64", "linux-aarch64",
+ "linux-arm32", "linux-ppc64le", "linux-s390x", "linux-riscv64"
];
// These are the base settings for all the main build profiles.
@@ -254,7 +254,6 @@ var getJibProfilesCommon = function (input, data) {
configure_args: concat(
"--with-exclude-translations=es,fr,it,ko,pt_BR,sv,ca,tr,cs,sk,ja_JP_A,ja_JP_HA,ja_JP_HI,ja_JP_I,zh_TW,zh_HK",
"--disable-jvm-feature-shenandoahgc",
- "--disable-cds-archive-coh",
versionArgs(input, common))
};
@@ -283,9 +282,6 @@ var getJibProfilesCommon = function (input, data) {
labels: "open"
};
- common.configure_args_64bit = ["--with-target-bits=64"];
- common.configure_args_32bit = ["--with-target-bits=32"];
-
/**
* Define common artifacts template for all main profiles
* @param o - Object containing data for artifacts
@@ -412,58 +408,34 @@ var getJibProfilesProfiles = function (input, common, data) {
// Main SE profiles
var profiles = {
-
- "linux-x64": {
- target_os: "linux",
- target_cpu: "x64",
- dependencies: ["devkit", "gtest", "build_devkit", "graphviz", "pandoc", "tidy"],
- configure_args: concat(
- (input.build_cpu == "x64" ? common.configure_args_64bit
- : "--openjdk-target=x86_64-linux-gnu"),
- "--with-zlib=system", "--disable-dtrace",
- (isWsl(input) ? [ "--host=x86_64-unknown-linux-gnu",
- "--build=x86_64-unknown-linux-gnu" ] : [])),
- },
-
- "linux-x86": {
- target_os: "linux",
- target_cpu: "x86",
- build_cpu: "x64",
- dependencies: ["devkit", "gtest", "libffi"],
- configure_args: concat(common.configure_args_32bit, [
- "--with-jvm-variants=minimal,server",
- "--with-zlib=system",
- "--with-libffi=" + input.get("libffi", "home_path"),
- "--enable-libffi-bundling",
- "--enable-fallback-linker"
- ])
- },
-
"macosx-x64": {
target_os: "macosx",
target_cpu: "x64",
dependencies: ["devkit", "gtest", "graphviz", "pandoc", "tidy"],
- configure_args: concat(common.configure_args_64bit, "--with-zlib=system",
+ configure_args: [
+ "--with-zlib=system",
"--with-macosx-version-max=11.00.00",
"--enable-compatible-cds-alignment",
// Use system SetFile instead of the one in the devkit as the
// devkit one may not work on Catalina.
- "SETFILE=/usr/bin/SetFile"),
+ "SETFILE=/usr/bin/SetFile"
+ ],
},
"macosx-aarch64": {
target_os: "macosx",
target_cpu: "aarch64",
dependencies: ["devkit", "gtest", "graphviz", "pandoc", "tidy"],
- configure_args: concat(common.configure_args_64bit,
- "--with-macosx-version-max=11.00.00"),
+ configure_args: [
+ "--with-macosx-version-max=11.00.00"
+ ],
},
"windows-x64": {
target_os: "windows",
target_cpu: "x64",
dependencies: ["devkit", "gtest", "pandoc"],
- configure_args: concat(common.configure_args_64bit),
+ configure_args: [],
},
"windows-aarch64": {
@@ -475,7 +447,19 @@ var getJibProfilesProfiles = function (input, common, data) {
],
},
- "linux-aarch64": {
+ "linux-x64": {
+ target_os: "linux",
+ target_cpu: "x64",
+ dependencies: ["devkit", "gtest", "build_devkit", "graphviz", "pandoc", "tidy"],
+ configure_args: concat(
+ "--with-zlib=system",
+ "--disable-dtrace",
+ (cross_compiling ? [ "--openjdk-target=x86_64-linux-gnu" ] : []),
+ (isWsl(input) ? [ "--host=x86_64-unknown-linux-gnu",
+ "--build=x86_64-unknown-linux-gnu" ] : [])),
+ },
+
+ "linux-aarch64": {
target_os: "linux",
target_cpu: "aarch64",
dependencies: ["devkit", "gtest", "build_devkit", "graphviz", "pandoc", "tidy"],
@@ -492,8 +476,10 @@ var getJibProfilesProfiles = function (input, common, data) {
build_cpu: "x64",
dependencies: ["devkit", "gtest", "build_devkit"],
configure_args: [
- "--openjdk-target=arm-linux-gnueabihf", "--with-freetype=bundled",
- "--with-abi-profile=arm-vfp-hflt", "--disable-warnings-as-errors"
+ "--openjdk-target=arm-linux-gnueabihf",
+ "--with-freetype=bundled",
+ "--with-abi-profile=arm-vfp-hflt",
+ "--disable-warnings-as-errors"
],
},
@@ -503,7 +489,8 @@ var getJibProfilesProfiles = function (input, common, data) {
build_cpu: "x64",
dependencies: ["devkit", "gtest", "build_devkit"],
configure_args: [
- "--openjdk-target=ppc64le-linux-gnu", "--with-freetype=bundled",
+ "--openjdk-target=ppc64le-linux-gnu",
+ "--with-freetype=bundled",
"--disable-warnings-as-errors"
],
},
@@ -514,7 +501,8 @@ var getJibProfilesProfiles = function (input, common, data) {
build_cpu: "x64",
dependencies: ["devkit", "gtest", "build_devkit"],
configure_args: [
- "--openjdk-target=s390x-linux-gnu", "--with-freetype=bundled",
+ "--openjdk-target=s390x-linux-gnu",
+ "--with-freetype=bundled",
"--disable-warnings-as-errors"
],
},
@@ -525,7 +513,8 @@ var getJibProfilesProfiles = function (input, common, data) {
build_cpu: "x64",
dependencies: ["devkit", "gtest", "build_devkit"],
configure_args: [
- "--openjdk-target=riscv64-linux-gnu", "--with-freetype=bundled",
+ "--openjdk-target=riscv64-linux-gnu",
+ "--with-freetype=bundled",
"--disable-warnings-as-errors"
],
},
@@ -586,24 +575,24 @@ var getJibProfilesProfiles = function (input, common, data) {
target_os: "linux",
target_cpu: "x64",
dependencies: ["devkit", "gtest", "libffi"],
- configure_args: concat(common.configure_args_64bit, [
+ configure_args: [
"--with-zlib=system",
"--with-jvm-variants=zero",
"--with-libffi=" + input.get("libffi", "home_path"),
"--enable-libffi-bundling",
- ])
+ ]
},
"linux-aarch64-zero": {
target_os: "linux",
target_cpu: "aarch64",
dependencies: ["devkit", "gtest", "libffi"],
- configure_args: concat(common.configure_args_64bit, [
+ configure_args: [
"--with-zlib=system",
"--with-jvm-variants=zero",
"--with-libffi=" + input.get("libffi", "home_path"),
"--enable-libffi-bundling"
- ])
+ ]
},
"linux-x86-zero": {
@@ -611,12 +600,13 @@ var getJibProfilesProfiles = function (input, common, data) {
target_cpu: "x86",
build_cpu: "x64",
dependencies: ["devkit", "gtest", "libffi"],
- configure_args: concat(common.configure_args_32bit, [
+ configure_args: [
+ "--with-target-bits=32",
"--with-zlib=system",
"--with-jvm-variants=zero",
"--with-libffi=" + input.get("libffi", "home_path"),
"--enable-libffi-bundling"
- ])
+ ]
}
}
profiles = concatObjects(profiles, zeroProfiles);
@@ -635,8 +625,10 @@ var getJibProfilesProfiles = function (input, common, data) {
target_os: "linux",
target_cpu: "x64",
dependencies: ["devkit", "gtest"],
- configure_args: concat(common.configure_args_64bit,
- "--with-zlib=system", "--disable-precompiled-headers"),
+ configure_args: [
+ "--with-zlib=system",
+ "--disable-precompiled-headers"
+ ],
},
};
profiles = concatObjects(profiles, noPchProfiles);
@@ -693,9 +685,6 @@ var getJibProfilesProfiles = function (input, common, data) {
"linux-x64": {
platform: "linux-x64",
},
- "linux-x86": {
- platform: "linux-x86",
- },
"macosx-x64": {
platform: "macos-x64",
jdk_subdir: "jdk-" + data.version + ".jdk/Contents/Home",
@@ -872,7 +861,8 @@ var getJibProfilesProfiles = function (input, common, data) {
profiles[cmpBaselineName].configure_args = concat(
profiles[cmpBaselineName].configure_args,
"--with-hotspot-build-time=n/a",
- "--disable-precompiled-headers");
+ "--disable-precompiled-headers",
+ "--with-source-date=version");
// Do not inherit artifact definitions from base profile
delete profiles[cmpBaselineName].artifacts;
});
@@ -1088,14 +1078,14 @@ var getJibProfilesProfiles = function (input, common, data) {
var getJibProfilesDependencies = function (input, common) {
var devkit_platform_revisions = {
- linux_x64: "gcc13.2.0-OL6.4+1.0",
- macosx: "Xcode14.3.1+1.0",
- windows_x64: "VS2022-17.6.5+1.0",
- linux_aarch64: "gcc13.2.0-OL7.6+1.0",
+ linux_x64: "gcc14.2.0-OL6.4+1.0",
+ macosx: "Xcode15.4+1.0",
+ windows_x64: "VS2022-17.13.2+1.0",
+ linux_aarch64: "gcc14.2.0-OL7.6+1.0",
linux_arm: "gcc8.2.0-Fedora27+1.0",
- linux_ppc64le: "gcc13.2.0-Fedora_41+1.0",
- linux_s390x: "gcc13.2.0-Fedora_41+1.0",
- linux_riscv64: "gcc13.2.0-Fedora_41+1.0"
+ linux_ppc64le: "gcc14.2.0-Fedora_41+1.0",
+ linux_s390x: "gcc14.2.0-Fedora_41+1.0",
+ linux_riscv64: "gcc14.2.0-Fedora_41+1.0"
};
var devkit_platform = (input.target_cpu == "x86"
@@ -1161,10 +1151,7 @@ var getJibProfilesDependencies = function (input, common) {
organization: common.organization,
ext: "tar.gz",
module: "devkit-" + devkit_cross_prefix + devkit_platform,
- revision: devkit_platform_revisions[devkit_platform],
- environment: {
- "DEVKIT_HOME": input.get("devkit", "home_path"),
- }
+ revision: devkit_platform_revisions[devkit_platform]
},
build_devkit: {
diff --git a/make/data/cldr/LICENSE b/make/data/cldr/LICENSE
index 9065fe54d8b..ca907d75617 100644
--- a/make/data/cldr/LICENSE
+++ b/make/data/cldr/LICENSE
@@ -1,4 +1,4 @@
-UNICODE LICENSE V3
+UNICODE LICENSE V3
COPYRIGHT AND PERMISSION NOTICE
diff --git a/make/data/ubsan/ubsan_default_options.c b/make/data/ubsan/ubsan_default_options.c
index 011d1a675a9..05e4722e45a 100644
--- a/make/data/ubsan/ubsan_default_options.c
+++ b/make/data/ubsan/ubsan_default_options.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 2025, 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
@@ -43,6 +43,18 @@
#define ATTRIBUTE_USED
#endif
+// On AIX, the llvm_symbolizer is not found out of the box, so we have to provide the
+// full qualified llvm_symbolizer path in the __ubsan_default_options() function.
+// To get it here we compile our sources with an additional define LLVM_SYMBOLIZER
+// containing the path, which we set in make/autoconf/jdk-options.m4.
+#ifdef LLVM_SYMBOLIZER
+#define _LLVM_SYMBOLIZER(X) ",external_symbolizer_path=" X_LLVM_SYMBOLIZER(X)
+#define X_LLVM_SYMBOLIZER(X) #X
+#else
+#define LLVM_SYMBOLIZER
+#define _LLVM_SYMBOLIZER(X)
+#endif
+
// Override weak symbol exposed by UBSan to override default options. This is called by UBSan
// extremely early during library loading, before main is called. We need to override the default
// options because by default UBSan only prints a warning for each occurrence. We want jtreg tests
@@ -50,5 +62,5 @@
// thread so it is easier to track down. You can override these options by setting the environment
// variable UBSAN_OPTIONS.
ATTRIBUTE_DEFAULT_VISIBILITY ATTRIBUTE_USED const char* __ubsan_default_options() {
- return "halt_on_error=1,print_stacktrace=1";
+ return "halt_on_error=1,print_stacktrace=1" _LLVM_SYMBOLIZER(LLVM_SYMBOLIZER);
}
diff --git a/make/devkit/Tools.gmk b/make/devkit/Tools.gmk
index 249eaa66247..1b9240df49c 100644
--- a/make/devkit/Tools.gmk
+++ b/make/devkit/Tools.gmk
@@ -39,6 +39,8 @@
# Fix this...
#
+uppercase = $(shell echo $1 | tr a-z A-Z)
+
$(info TARGET=$(TARGET))
$(info HOST=$(HOST))
$(info BUILD=$(BUILD))
@@ -91,89 +93,28 @@ endif
################################################################################
# Define external dependencies
-# Latest that could be made to work.
-GCC_VER := 13.2.0
-ifeq ($(GCC_VER), 13.2.0)
- gcc_ver := gcc-13.2.0
- binutils_ver := binutils-2.41
- ccache_ver := ccache-3.7.12
- mpfr_ver := mpfr-4.2.0
- gmp_ver := gmp-6.3.0
- mpc_ver := mpc-1.3.1
- gdb_ver := gdb-13.2
- REQUIRED_MIN_MAKE_MAJOR_VERSION := 4
-else ifeq ($(GCC_VER), 11.3.0)
- gcc_ver := gcc-11.3.0
- binutils_ver := binutils-2.39
- ccache_ver := ccache-3.7.12
- mpfr_ver := mpfr-4.1.1
- gmp_ver := gmp-6.2.1
- mpc_ver := mpc-1.2.1
- gdb_ver := gdb-11.2
- REQUIRED_MIN_MAKE_MAJOR_VERSION := 4
-else ifeq ($(GCC_VER), 11.2.0)
- gcc_ver := gcc-11.2.0
- binutils_ver := binutils-2.37
- ccache_ver := ccache-3.7.12
- mpfr_ver := mpfr-4.1.0
- gmp_ver := gmp-6.2.1
- mpc_ver := mpc-1.2.1
- gdb_ver := gdb-11.1
- REQUIRED_MIN_MAKE_MAJOR_VERSION := 4
-else ifeq ($(GCC_VER), 10.3.0)
- gcc_ver := gcc-10.3.0
- binutils_ver := binutils-2.36.1
- ccache_ver := ccache-3.7.11
- mpfr_ver := mpfr-4.1.0
- gmp_ver := gmp-6.2.0
- mpc_ver := mpc-1.1.0
- gdb_ver := gdb-10.1
- REQUIRED_MIN_MAKE_MAJOR_VERSION := 4
-else ifeq ($(GCC_VER), 10.2.0)
- gcc_ver := gcc-10.2.0
- binutils_ver := binutils-2.35
- ccache_ver := ccache-3.7.11
- mpfr_ver := mpfr-4.1.0
- gmp_ver := gmp-6.2.0
- mpc_ver := mpc-1.1.0
- gdb_ver := gdb-9.2
- REQUIRED_MIN_MAKE_MAJOR_VERSION := 4
-else ifeq ($(GCC_VER), 9.2.0)
- gcc_ver := gcc-9.2.0
- binutils_ver := binutils-2.34
- ccache_ver := ccache-3.7.3
- mpfr_ver := mpfr-3.1.5
- gmp_ver := gmp-6.1.2
- mpc_ver := mpc-1.0.3
- gdb_ver := gdb-8.3
-else ifeq ($(GCC_VER), 8.3.0)
- gcc_ver := gcc-8.3.0
- binutils_ver := binutils-2.32
- ccache_ver := ccache-3.7.3
- mpfr_ver := mpfr-3.1.5
- gmp_ver := gmp-6.1.2
- mpc_ver := mpc-1.0.3
- gdb_ver := gdb-8.3
-else ifeq ($(GCC_VER), 7.3.0)
- gcc_ver := gcc-7.3.0
- binutils_ver := binutils-2.30
- ccache_ver := ccache-3.3.6
- mpfr_ver := mpfr-3.1.5
- gmp_ver := gmp-6.1.2
- mpc_ver := mpc-1.0.3
- gdb_ver := gdb-8.1
-else ifeq ($(GCC_VER), 4.9.2)
- gcc_ver := gcc-4.9.2
- binutils_ver := binutils-2.25
- ccache_ver := ccache-3.2.1
- mpfr_ver := mpfr-3.0.1
- gmp_ver := gmp-4.3.2
- mpc_ver := mpc-1.0.1
- gdb_ver := gdb-7.12.1
-else
- $(error Unsupported GCC version)
-endif
+gcc_ver_only := 14.2.0
+binutils_ver_only := 2.43
+ccache_ver_only := 4.10.2
+CCACHE_CMAKE_BASED := 1
+mpfr_ver_only := 4.2.1
+gmp_ver_only := 6.3.0
+mpc_ver_only := 1.3.1
+gdb_ver_only := 15.2
+dependencies := gcc binutils ccache mpfr gmp mpc gdb
+
+$(foreach dep,$(dependencies),$(eval $(dep)_ver := $(dep)-$($(dep)_ver_only)))
+
+GCC := http://ftp.gnu.org/pub/gnu/gcc/$(gcc_ver)/$(gcc_ver).tar.xz
+BINUTILS := http://ftp.gnu.org/pub/gnu/binutils/$(binutils_ver).tar.gz
+CCACHE := https://github.com/ccache/ccache/releases/download/v$(ccache_ver_only)/$(ccache_ver).tar.xz
+MPFR := https://www.mpfr.org/$(mpfr_ver)/$(mpfr_ver).tar.bz2
+GMP := http://ftp.gnu.org/pub/gnu/gmp/$(gmp_ver).tar.bz2
+MPC := http://ftp.gnu.org/pub/gnu/mpc/$(mpc_ver).tar.gz
+GDB := http://ftp.gnu.org/gnu/gdb/$(gdb_ver).tar.xz
+
+REQUIRED_MIN_MAKE_MAJOR_VERSION := 4
ifneq ($(REQUIRED_MIN_MAKE_MAJOR_VERSION),)
MAKE_MAJOR_VERSION := $(word 1,$(subst ., ,$(MAKE_VERSION)))
SUPPORTED_MAKE_VERSION := $(shell [ $(MAKE_MAJOR_VERSION) -ge $(REQUIRED_MIN_MAKE_MAJOR_VERSION) ] && echo true)
@@ -182,17 +123,6 @@ ifneq ($(REQUIRED_MIN_MAKE_MAJOR_VERSION),)
endif
endif
-ccache_ver_only := $(patsubst ccache-%,%,$(ccache_ver))
-
-
-GCC := http://ftp.gnu.org/pub/gnu/gcc/$(gcc_ver)/$(gcc_ver).tar.xz
-BINUTILS := http://ftp.gnu.org/pub/gnu/binutils/$(binutils_ver).tar.gz
-CCACHE := https://github.com/ccache/ccache/releases/download/v$(ccache_ver_only)/$(ccache_ver).tar.xz
-MPFR := https://www.mpfr.org/${mpfr_ver}/${mpfr_ver}.tar.bz2
-GMP := http://ftp.gnu.org/pub/gnu/gmp/${gmp_ver}.tar.bz2
-MPC := http://ftp.gnu.org/pub/gnu/mpc/${mpc_ver}.tar.gz
-GDB := http://ftp.gnu.org/gnu/gdb/${gdb_ver}.tar.xz
-
# RPMs used by all BASE_OS
RPM_LIST := \
$(KERNEL_HEADERS_RPM) \
@@ -262,10 +192,18 @@ define Download
# Allow override
$(1)_DIRNAME ?= $(basename $(basename $(notdir $($(1)))))
$(1)_DIR = $(abspath $(SRCDIR)/$$($(1)_DIRNAME))
- $(1)_CFG = $$($(1)_DIR)/configure
+ ifeq ($$($(1)_CMAKE_BASED),)
+ $(1)_CFG = $$($(1)_DIR)/configure
+ $(1)_SRC_MARKER = $$($(1)_DIR)/configure
+ $(1)_CONFIG = $(CONFIG)
+ else
+ $(1)_CFG = cmake
+ $(1)_SRC_MARKER = $$($(1)_DIR)/CMakeLists.txt
+ $(1)_CONFIG = $$(CMAKE_CONFIG) $$($(1)_DIR)
+ endif
$(1)_FILE = $(DOWNLOAD)/$(notdir $($(1)))
- $$($(1)_CFG) : $$($(1)_FILE)
+ $$($(1)_SRC_MARKER) : $$($(1)_FILE)
mkdir -p $$(SRCDIR)
tar -C $$(SRCDIR) -xf $$<
$$(foreach p,$$(abspath $$(wildcard patches/$$(ARCH)-$$(notdir $$($(1)_DIR)).patch)), \
@@ -279,7 +217,7 @@ define Download
endef
# Download and unpack all source packages
-$(foreach p,GCC BINUTILS CCACHE MPFR GMP MPC GDB,$(eval $(call Download,$(p))))
+$(foreach dep,$(dependencies),$(eval $(call Download,$(call uppercase,$(dep)))))
################################################################################
# Unpack RPMS
@@ -356,7 +294,7 @@ endif
################################################################################
# Define marker files for each source package to be compiled
-$(foreach t,binutils mpfr gmp mpc gcc ccache gdb,$(eval $(t) = $(TARGETDIR)/$($(t)_ver).done))
+$(foreach dep,$(dependencies),$(eval $(dep) = $(TARGETDIR)/$($(dep)_ver).done))
################################################################################
@@ -365,6 +303,8 @@ CONFIG = --target=$(TARGET) \
--host=$(HOST) --build=$(BUILD) \
--prefix=$(PREFIX)
+CMAKE_CONFIG = -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(PREFIX)
+
PATHEXT = $(PREFIX)/bin:
PATHPRE = PATH=$(PATHEXT)$(PATH)
@@ -576,6 +516,8 @@ ifeq ($(HOST), $(TARGET))
$(PATHPRE) $(ENVS) CFLAGS="$(CFLAGS)" $(GDB_CFG) \
$(CONFIG) \
--with-sysroot=$(SYSROOT) \
+ --with-mpfr=$(PREFIX) \
+ --with-gmp=$(PREFIX) \
) > $(@D)/log.config 2>&1
@echo 'done'
@@ -591,13 +533,13 @@ endif
################################################################################
# very straightforward. just build a ccache. it is only for host.
$(BUILDDIR)/$(ccache_ver)/Makefile \
- : $(CCACHE_CFG)
+ : $(CCACHE_SRC_MARKER)
$(info Configuring $@. Log in $(@D)/log.config)
@mkdir -p $(@D)
@( \
cd $(@D) ; \
$(PATHPRE) $(ENVS) $(CCACHE_CFG) \
- $(CONFIG) \
+ $(CCACHE_CONFIG) \
) > $(@D)/log.config 2>&1
@echo 'done'
@@ -699,10 +641,18 @@ ifeq ($(TARGET), $(HOST))
ln -s $(TARGET)-$* $@
missing-links := $(addprefix $(PREFIX)/bin/, \
- addr2line ar as c++ c++filt dwp elfedit g++ gcc gcc-$(GCC_VER) gprof ld ld.bfd \
+ addr2line ar as c++ c++filt dwp elfedit g++ gcc gcc-$(gcc_ver_only) gprof ld ld.bfd \
ld.gold nm objcopy objdump ranlib readelf size strings strip)
endif
+# Add link to work around "plugin needed to handle lto object" (JDK-8344272)
+$(PREFIX)/lib/bfd-plugins/liblto_plugin.so: $(PREFIX)/libexec/gcc/$(TARGET)/$(gcc_ver_only)/liblto_plugin.so
+ @echo 'Creating missing $(@F) soft link'
+ @mkdir -p $(@D)
+ ln -s $$(realpath -s --relative-to=$(@D) $<) $@
+
+missing-links += $(PREFIX)/lib/bfd-plugins/liblto_plugin.so
+
################################################################################
bfdlib : $(bfdlib)
diff --git a/make/devkit/createAutoconfBundle.sh b/make/devkit/createAutoconfBundle.sh
index 7363b9cd8a7..ebe9c427f76 100644
--- a/make/devkit/createAutoconfBundle.sh
+++ b/make/devkit/createAutoconfBundle.sh
@@ -1,6 +1,6 @@
#!/bin/bash -e
#
-# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2018, 2025, 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
@@ -24,10 +24,21 @@
# questions.
#
-# Create a bundle in the current directory, containing what's needed to run
+# Create a bundle in OpenJDK build folder, containing what's needed to run
# the 'autoconf' program by the OpenJDK build. To override TARGET_PLATFORM
# just set the variable before running this script.
+# This script fetches sources from network so make sure your proxy is setup appropriately.
+
+# colored print to highlight some of the logs
+function print_log()
+{
+ Color_Cyan='\033[1;36m' # Cyan
+ Color_Off='\033[0m' # Reset color
+ printf "${Color_Cyan}> $1${Color_Off}\n"
+}
+
+
# Autoconf depends on m4, so download and build that first.
AUTOCONF_VERSION=2.69
M4_VERSION=1.4.18
@@ -58,11 +69,12 @@ MODULE_NAME=autoconf-$TARGET_PLATFORM-$AUTOCONF_VERSION+$PACKAGE_VERSION
BUNDLE_NAME=$MODULE_NAME.tar.gz
SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)"
-OUTPUT_ROOT="${SCRIPT_DIR}/../../build/autoconf"
+BASEDIR="$(cd "$SCRIPT_DIR/../.." > /dev/null && pwd)"
+OUTPUT_ROOT="$BASEDIR/build/autoconf"
-cd $OUTPUT_ROOT
IMAGE_DIR=$OUTPUT_ROOT/$MODULE_NAME
mkdir -p $IMAGE_DIR/usr
+cd $OUTPUT_ROOT
# Download and build m4
@@ -76,7 +88,7 @@ elif test "x$TARGET_PLATFORM" = xcygwin_x86; then
cp /usr/bin/m4 $IMAGE_DIR/usr/bin
elif test "x$TARGET_PLATFORM" = xlinux_x64; then
M4_VERSION=1.4.13-5
- wget http://yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/getPackage/m4-$M4_VERSION.el6.x86_64.rpm
+ wget https://yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/getPackage/m4-$M4_VERSION.el6.x86_64.rpm
cd $IMAGE_DIR
rpm2cpio $OUTPUT_ROOT/m4-$M4_VERSION.el6.x86_64.rpm | cpio -d -i
elif test "x$TARGET_PLATFORM" = xlinux_x86; then
@@ -85,27 +97,38 @@ elif test "x$TARGET_PLATFORM" = xlinux_x86; then
cd $IMAGE_DIR
rpm2cpio $OUTPUT_ROOT/m4-$M4_VERSION.el6.i686.rpm | cpio -d -i
else
+ print_log "m4: download"
wget https://ftp.gnu.org/gnu/m4/m4-$M4_VERSION.tar.gz
- tar xzf m4-$M4_VERSION.tar.gz
+ tar -xzf m4-$M4_VERSION.tar.gz
cd m4-$M4_VERSION
+ print_log "m4: configure"
./configure --prefix=$IMAGE_DIR/usr CFLAGS="-w -Wno-everything"
+ print_log "m4: make"
make
+ print_log "m4: make install"
make install
cd ..
fi
# Download and build autoconf
+print_log "autoconf: download"
wget https://ftp.gnu.org/gnu/autoconf/autoconf-$AUTOCONF_VERSION.tar.gz
-tar xzf autoconf-$AUTOCONF_VERSION.tar.gz
+tar -xzf autoconf-$AUTOCONF_VERSION.tar.gz
cd autoconf-$AUTOCONF_VERSION
+print_log "autoconf: configure"
./configure --prefix=$IMAGE_DIR/usr M4=$IMAGE_DIR/usr/bin/m4
+print_log "autoconf: make"
make
+print_log "autoconf: make install"
make install
cd ..
+# The resulting scripts from installation folder use absolute paths to reference other files within installation folder
+print_log "replace absolue paths from installation files with a relative ."
perl -pi -e "s!$IMAGE_DIR/!./!" $IMAGE_DIR/usr/bin/auto* $IMAGE_DIR/usr/share/autoconf/autom4te.cfg
+print_log "creating $IMAGE_DIR/autoconf wrapper script"
cat > $IMAGE_DIR/autoconf << EOF
#!/bin/bash
# Get an absolute path to this script
@@ -123,6 +146,9 @@ PREPEND_INCLUDE="--prepend-include \$this_script_dir/usr/share/autoconf"
exec \$this_script_dir/usr/bin/autoconf \$PREPEND_INCLUDE "\$@"
EOF
+
chmod +x $IMAGE_DIR/autoconf
+
+print_log "archiving $IMAGE_DIR directory as $OUTPUT_ROOT/$BUNDLE_NAME"
cd $IMAGE_DIR
tar -cvzf $OUTPUT_ROOT/$BUNDLE_NAME *
diff --git a/make/devkit/createWindowsDevkit.sh b/make/devkit/createWindowsDevkit.sh
index 0646cb68ef4..757fb157ad4 100644
--- a/make/devkit/createWindowsDevkit.sh
+++ b/make/devkit/createWindowsDevkit.sh
@@ -56,16 +56,22 @@ BUILD_DIR="${SCRIPT_DIR}/../../build/devkit"
UNAME_SYSTEM=`uname -s`
UNAME_RELEASE=`uname -r`
+UNAME_OS=`uname -o`
# Detect cygwin or WSL
IS_CYGWIN=`echo $UNAME_SYSTEM | grep -i CYGWIN`
IS_WSL=`echo $UNAME_RELEASE | grep Microsoft`
+IS_MSYS=`echo $UNAME_OS | grep -i Msys`
+MSYS2_ARG_CONV_EXCL="*" # make "cmd.exe /c" work for msys2
+CMD_EXE="cmd.exe /c"
if test "x$IS_CYGWIN" != "x"; then
BUILD_ENV="cygwin"
+elif test "x$IS_MSYS" != "x"; then
+ BUILD_ENV="cygwin"
elif test "x$IS_WSL" != "x"; then
BUILD_ENV="wsl"
else
- echo "Unknown environment; only Cygwin and WSL are supported."
+ echo "Unknown environment; only Cygwin/MSYS2/WSL are supported."
exit 1
fi
@@ -76,7 +82,7 @@ elif test "x$BUILD_ENV" = "xwsl"; then
fi
# Work around the insanely named ProgramFiles(x86) env variable
-PROGRAMFILES_X86="$($WINDOWS_PATH_TO_UNIX_PATH "$(cmd.exe /c set | sed -n 's/^ProgramFiles(x86)=//p' | tr -d '\r')")"
+PROGRAMFILES_X86="$($WINDOWS_PATH_TO_UNIX_PATH "$(${CMD_EXE} set | sed -n 's/^ProgramFiles(x86)=//p' | tr -d '\r')")"
PROGRAMFILES="$($WINDOWS_PATH_TO_UNIX_PATH "$PROGRAMFILES")"
case $VS_VERSION in
@@ -99,13 +105,15 @@ esac
# Find Visual Studio installation dir
-VSNNNCOMNTOOLS=`cmd.exe /c echo %VS${VS_VERSION_NUM_NODOT}COMNTOOLS% | tr -d '\r'`
+VSNNNCOMNTOOLS=`${CMD_EXE} echo %VS${VS_VERSION_NUM_NODOT}COMNTOOLS% | tr -d '\r'`
+VSNNNCOMNTOOLS="$($WINDOWS_PATH_TO_UNIX_PATH "$VSNNNCOMNTOOLS")"
if [ -d "$VSNNNCOMNTOOLS" ]; then
- VS_INSTALL_DIR="$($WINDOWS_PATH_TO_UNIX_PATH "$VSNNNCOMNTOOLS/../..")"
+ VS_INSTALL_DIR="$VSNNNCOMNTOOLS/../.."
else
VS_INSTALL_DIR="${MSVC_PROGRAMFILES_DIR}/Microsoft Visual Studio/$VS_VERSION"
VS_INSTALL_DIR="$(ls -d "${VS_INSTALL_DIR}/"{Community,Professional,Enterprise} 2>/dev/null | head -n1)"
fi
+echo "VSNNNCOMNTOOLS: $VSNNNCOMNTOOLS"
echo "VS_INSTALL_DIR: $VS_INSTALL_DIR"
# Extract semantic version
@@ -180,7 +188,11 @@ cp $DEVKIT_ROOT/VC/redist/arm64/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/arm64
################################################################################
# Copy SDK files
-SDK_INSTALL_DIR="$PROGRAMFILES_X86/Windows Kits/$SDK_VERSION"
+SDK_INSTALL_DIR=`${CMD_EXE} echo %WindowsSdkDir% | tr -d '\r'`
+SDK_INSTALL_DIR="$($WINDOWS_PATH_TO_UNIX_PATH "$SDK_INSTALL_DIR")"
+if [ ! -d "$SDK_INSTALL_DIR" ]; then
+ SDK_INSTALL_DIR="$PROGRAMFILES_X86/Windows Kits/$SDK_VERSION"
+fi
echo "SDK_INSTALL_DIR: $SDK_INSTALL_DIR"
SDK_FULL_VERSION="$(ls "$SDK_INSTALL_DIR/bin" | sort -r -n | head -n1)"
diff --git a/make/hotspot/lib/JvmFeatures.gmk b/make/hotspot/lib/JvmFeatures.gmk
index 0a897230f83..ffea9aa3926 100644
--- a/make/hotspot/lib/JvmFeatures.gmk
+++ b/make/hotspot/lib/JvmFeatures.gmk
@@ -125,6 +125,7 @@ endif
ifneq ($(call check-jvm-feature, cds), true)
JVM_CFLAGS_FEATURES += -DINCLUDE_CDS=0
JVM_EXCLUDE_FILES += \
+ aotCodeCache.cpp \
classLoaderDataShared.cpp \
classLoaderExt.cpp \
systemDictionaryShared.cpp
diff --git a/make/jdk/src/classes/build/tools/classlist/HelloClasslist.java b/make/jdk/src/classes/build/tools/classlist/HelloClasslist.java
index 1b930ca7527..fa1b33bb03e 100644
--- a/make/jdk/src/classes/build/tools/classlist/HelloClasslist.java
+++ b/make/jdk/src/classes/build/tools/classlist/HelloClasslist.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2025, 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
@@ -59,6 +59,7 @@ public class HelloClasslist {
private static final Logger LOGGER = Logger.getLogger("Hello");
+ @SuppressWarnings("restricted")
public static void main(String ... args) throws Throwable {
FileSystems.getDefault();
@@ -141,6 +142,7 @@ public class HelloClasslist {
HelloClasslist.class.getMethod("staticMethod_V").invoke(null);
var obj = HelloClasslist.class.getMethod("staticMethod_L_L", Object.class).invoke(null, instance);
HelloClasslist.class.getField("field").get(instance);
+ MethodHandles.Lookup.ClassOption.class.getEnumConstants();
// A selection of trivial and relatively common MH operations
invoke(MethodHandles.identity(double.class), 1.0);
@@ -160,6 +162,9 @@ public class HelloClasslist {
case B b -> b.b;
default -> 17;
};
+ // record run-time methods
+ o.equals(new B(5));
+ o.hashCode();
LOGGER.log(Level.FINE, "Value: " + value);
// The Striped64$Cell is loaded rarely only when there's a contention among
diff --git a/make/jdk/src/classes/build/tools/taglet/PreviewNote.java b/make/jdk/src/classes/build/tools/taglet/PreviewNote.java
new file mode 100644
index 00000000000..ee3f9bea527
--- /dev/null
+++ b/make/jdk/src/classes/build/tools/taglet/PreviewNote.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2025, 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.
+ */
+
+package build.tools.taglet;
+
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Set;
+
+
+import javax.lang.model.element.Element;
+import javax.tools.Diagnostic;
+
+
+import com.sun.source.doctree.DocTree;
+import com.sun.source.doctree.UnknownInlineTagTree;
+import jdk.javadoc.doclet.Doclet;
+import jdk.javadoc.doclet.DocletEnvironment;
+import jdk.javadoc.doclet.Reporter;
+import jdk.javadoc.doclet.StandardDoclet;
+import jdk.javadoc.doclet.Taglet;
+
+import static com.sun.source.doctree.DocTree.Kind.UNKNOWN_INLINE_TAG;
+
+/**
+ * An inline tag to insert a note formatted as preview note.
+ * The tag can be used as follows:
+ *
+ *
+ * {@previewNote jep-number [Preview note heading]}
+ * Preview note content
+ * {@previewNote}
+ *
+ *
+ */
+public class PreviewNote implements Taglet {
+
+ static final String TAG_NAME = "previewNote";
+ Reporter reporter = null;
+
+ @Override
+ public void init(DocletEnvironment env, Doclet doclet) {
+ if (doclet instanceof StandardDoclet stdoclet) {
+ reporter = stdoclet.getReporter();
+ }
+ }
+
+ /**
+ * Returns the set of locations in which the tag may be used.
+ */
+ @Override
+ public Set