mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
Merge branch 'openjdk:master' into awt
This commit is contained in:
commit
909031717a
14
.editorconfig
Normal file
14
.editorconfig
Normal file
@ -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
|
||||
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1,4 +1,5 @@
|
||||
* -text
|
||||
* encoding=utf-8
|
||||
*.java diff=java
|
||||
*.c diff=cpp
|
||||
*.h diff=cpp
|
||||
|
||||
68
.github/actions/build-jtreg/action.yml
vendored
Normal file
68
.github/actions/build-jtreg/action.yml
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
#
|
||||
# Copyright (c) 2023, 2024, 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.
|
||||
#
|
||||
|
||||
name: 'Build JTReg'
|
||||
description: 'Build JTReg'
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: 'Get JTReg version configuration'
|
||||
id: version
|
||||
uses: ./.github/actions/config
|
||||
with:
|
||||
var: JTREG_VERSION
|
||||
|
||||
- name: 'Check cache for already built JTReg'
|
||||
id: get-cached
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: jtreg/installed
|
||||
key: jtreg-${{ steps.version.outputs.value }}
|
||||
|
||||
- name: 'Checkout the JTReg source'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: openjdk/jtreg
|
||||
ref: jtreg-${{ steps.version.outputs.value }}
|
||||
path: jtreg/src
|
||||
if: (steps.get-cached.outputs.cache-hit != 'true')
|
||||
|
||||
- name: 'Build JTReg'
|
||||
run: |
|
||||
# Build JTReg and move files to the proper locations
|
||||
bash make/build.sh --jdk "$JAVA_HOME_17_X64"
|
||||
mkdir ../installed
|
||||
mv build/images/jtreg/* ../installed
|
||||
working-directory: jtreg/src
|
||||
shell: bash
|
||||
if: (steps.get-cached.outputs.cache-hit != 'true')
|
||||
|
||||
- name: 'Upload JTReg artifact'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bundles-jtreg-${{ steps.version.outputs.value }}
|
||||
path: jtreg/installed
|
||||
retention-days: 5
|
||||
2
.github/actions/config/action.yml
vendored
2
.github/actions/config/action.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2024, 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
|
||||
|
||||
4
.github/actions/do-build/action.yml
vendored
4
.github/actions/do-build/action.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 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
|
||||
|
||||
|
||||
2
.github/actions/get-bootjdk/action.yml
vendored
2
.github/actions/get-bootjdk/action.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2024, 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
|
||||
|
||||
39
.github/actions/get-bundles/action.yml
vendored
39
.github/actions/get-bundles/action.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2024, 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
|
||||
@ -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
|
||||
|
||||
4
.github/actions/get-gtest/action.yml
vendored
4
.github/actions/get-gtest/action.yml
vendored
@ -49,6 +49,6 @@ runs:
|
||||
- name: 'Export path to where GTest is installed'
|
||||
id: path-name
|
||||
run: |
|
||||
# Export the path
|
||||
echo 'path=gtest' >> $GITHUB_OUTPUT
|
||||
# Export the absolute path
|
||||
echo "path=`pwd`/gtest" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
38
.github/actions/get-jtreg/action.yml
vendored
38
.github/actions/get-jtreg/action.yml
vendored
@ -24,7 +24,7 @@
|
||||
#
|
||||
|
||||
name: 'Get JTReg'
|
||||
description: 'Download JTReg from cache or source location'
|
||||
description: 'Get JTReg'
|
||||
outputs:
|
||||
path:
|
||||
description: 'Path to the installed JTReg'
|
||||
@ -39,40 +39,16 @@ runs:
|
||||
with:
|
||||
var: JTREG_VERSION
|
||||
|
||||
- name: 'Check cache for JTReg'
|
||||
id: get-cached-jtreg
|
||||
uses: actions/cache@v4
|
||||
- name: 'Download JTReg artifact'
|
||||
id: download-jtreg
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bundles-jtreg-${{ steps.version.outputs.value }}
|
||||
path: jtreg/installed
|
||||
key: jtreg-${{ steps.version.outputs.value }}
|
||||
|
||||
- name: 'Checkout the JTReg source'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: openjdk/jtreg
|
||||
ref: jtreg-${{ steps.version.outputs.value }}
|
||||
path: jtreg/src
|
||||
if: steps.get-cached-jtreg.outputs.cache-hit != 'true'
|
||||
|
||||
- name: 'Build JTReg'
|
||||
run: |
|
||||
# If runner architecture is x64 set JAVA_HOME_17_X64 otherwise set to JAVA_HOME_17_arm64
|
||||
if [[ '${{ runner.arch }}' == 'X64' ]]; then
|
||||
JDK="$JAVA_HOME_17_X64"
|
||||
else
|
||||
JDK="$JAVA_HOME_17_arm64"
|
||||
fi
|
||||
# Build JTReg and move files to the proper locations
|
||||
bash make/build.sh --jdk "$JDK"
|
||||
mkdir ../installed
|
||||
mv build/images/jtreg/* ../installed
|
||||
working-directory: jtreg/src
|
||||
shell: bash
|
||||
if: steps.get-cached-jtreg.outputs.cache-hit != 'true'
|
||||
|
||||
- name: 'Export path to where JTReg is installed'
|
||||
id: path-name
|
||||
run: |
|
||||
# Export the path
|
||||
echo 'path=jtreg/installed' >> $GITHUB_OUTPUT
|
||||
# Export the absolute path
|
||||
echo "path=`pwd`/jtreg/installed" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
10
.github/actions/get-msys2/action.yml
vendored
10
.github/actions/get-msys2/action.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2024, 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
|
||||
@ -30,15 +30,15 @@ runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: 'Install MSYS2'
|
||||
uses: msys2/setup-msys2@v2.22.0
|
||||
id: msys2
|
||||
uses: msys2/setup-msys2@v2.28.0
|
||||
with:
|
||||
install: 'autoconf tar unzip zip make'
|
||||
path-type: minimal
|
||||
location: ${{ runner.tool_cache }}/msys2
|
||||
release: false
|
||||
|
||||
# We can't run bash until this is completed, so stick with pwsh
|
||||
- name: 'Set MSYS2 path'
|
||||
run: |
|
||||
# Prepend msys2/msys64/usr/bin to the PATH
|
||||
echo "$env:RUNNER_TOOL_CACHE/msys2/msys64/usr/bin" >> $env:GITHUB_PATH
|
||||
echo "${{ steps.msys2.outputs.msys2-location }}/usr/bin" >> $env:GITHUB_PATH
|
||||
shell: pwsh
|
||||
|
||||
20
.github/actions/upload-bundles/action.yml
vendored
20
.github/actions/upload-bundles/action.yml
vendored
@ -32,6 +32,12 @@ inputs:
|
||||
debug-suffix:
|
||||
description: 'File name suffix denoting debug level, possibly empty'
|
||||
required: false
|
||||
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
|
||||
@ -43,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)"
|
||||
@ -55,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
|
||||
@ -65,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
|
||||
@ -75,7 +89,7 @@ runs:
|
||||
- name: 'Upload bundles artifact'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}
|
||||
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.static-suffix }}${{ inputs.bundle-suffix }}
|
||||
path: bundles
|
||||
retention-days: 1
|
||||
retention-days: 5
|
||||
if: steps.bundles.outputs.bundles-found == 'true'
|
||||
|
||||
4
.github/scripts/gen-build-failure-report.sh
vendored
4
.github/scripts/gen-build-failure-report.sh
vendored
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2024, 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
|
||||
@ -25,7 +25,7 @@
|
||||
#
|
||||
|
||||
# Import common utils
|
||||
. report-utils.sh
|
||||
. .github/scripts/report-utils.sh
|
||||
|
||||
GITHUB_STEP_SUMMARY="$1"
|
||||
BUILD_DIR="$(ls -d build/*)"
|
||||
|
||||
2
.github/scripts/gen-test-results.sh
vendored
2
.github/scripts/gen-test-results.sh
vendored
@ -25,7 +25,7 @@
|
||||
#
|
||||
|
||||
# Import common utils
|
||||
. report-utils.sh
|
||||
. .github/scripts/report-utils.sh
|
||||
|
||||
GITHUB_STEP_SUMMARY="$1"
|
||||
|
||||
|
||||
2
.github/scripts/gen-test-summary.sh
vendored
2
.github/scripts/gen-test-summary.sh
vendored
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2024, 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
|
||||
|
||||
6
.github/workflows/build-alpine-linux.yml
vendored
6
.github/workflows/build-alpine-linux.yml
vendored
@ -51,6 +51,10 @@ on:
|
||||
make-arguments:
|
||||
required: false
|
||||
type: string
|
||||
dry-run:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
@ -104,9 +108,11 @@ jobs:
|
||||
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
- name: 'Upload bundles'
|
||||
uses: ./.github/actions/upload-bundles
|
||||
with:
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
20
.github/workflows/build-cross-compile.yml
vendored
20
.github/workflows/build-cross-compile.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2024, 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
|
||||
@ -40,6 +40,10 @@ on:
|
||||
make-arguments:
|
||||
required: false
|
||||
type: string
|
||||
dry-run:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build-cross-compile:
|
||||
@ -60,33 +64,33 @@ jobs:
|
||||
gnu-arch: aarch64
|
||||
debian-arch: arm64
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
debian-version: trixie
|
||||
tolerate-sysroot-errors: false
|
||||
- target-cpu: arm
|
||||
gnu-arch: arm
|
||||
debian-arch: armhf
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
debian-version: trixie
|
||||
tolerate-sysroot-errors: false
|
||||
gnu-abi: eabihf
|
||||
- target-cpu: s390x
|
||||
gnu-arch: s390x
|
||||
debian-arch: s390x
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
debian-version: trixie
|
||||
tolerate-sysroot-errors: false
|
||||
- target-cpu: ppc64le
|
||||
gnu-arch: powerpc64le
|
||||
debian-arch: ppc64el
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
debian-version: trixie
|
||||
tolerate-sysroot-errors: false
|
||||
- target-cpu: riscv64
|
||||
gnu-arch: riscv64
|
||||
debian-arch: riscv64
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: sid
|
||||
tolerate-sysroot-errors: true
|
||||
debian-version: trixie
|
||||
tolerate-sysroot-errors: false
|
||||
|
||||
steps:
|
||||
- name: 'Checkout the JDK source'
|
||||
@ -189,4 +193,4 @@ jobs:
|
||||
with:
|
||||
make-target: 'hotspot ${{ inputs.make-arguments }}'
|
||||
platform: linux-${{ matrix.target-cpu }}
|
||||
if: steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true'
|
||||
if: ((steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true') && inputs.dry-run == false)
|
||||
|
||||
30
.github/workflows/build-linux.yml
vendored
30
.github/workflows/build-linux.yml
vendored
@ -61,6 +61,16 @@ on:
|
||||
make-arguments:
|
||||
required: false
|
||||
type: string
|
||||
dry-run:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
bundle-suffix:
|
||||
required: false
|
||||
type: string
|
||||
static-suffix:
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
@ -71,10 +81,6 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
debug-level: ${{ fromJSON(inputs.debug-levels) }}
|
||||
include:
|
||||
- debug-level: debug
|
||||
flags: --with-debug-level=fastdebug
|
||||
suffix: -debug
|
||||
|
||||
steps:
|
||||
- name: 'Checkout the JDK source'
|
||||
@ -118,7 +124,7 @@ jobs:
|
||||
run: >
|
||||
bash configure
|
||||
--with-conf-name=${{ inputs.platform }}
|
||||
${{ matrix.flags }}
|
||||
${{ matrix.debug-level == 'debug' && '--with-debug-level=fastdebug' || '' }}
|
||||
--with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
|
||||
--with-boot-jdk=${{ steps.bootjdk.outputs.path }}
|
||||
--with-jtreg=${{ steps.jtreg.outputs.path }}
|
||||
@ -133,17 +139,17 @@ jobs:
|
||||
- name: 'Build'
|
||||
id: build
|
||||
uses: ./.github/actions/do-build
|
||||
env:
|
||||
# Only build static-libs-bundles for release builds.
|
||||
# For debug builds, building static-libs often exceeds disk space.
|
||||
STATIC_LIBS: ${{ matrix.debug-level == 'release' && 'static-libs-bundles' }}
|
||||
with:
|
||||
make-target: '${{ inputs.make-target }} ${STATIC_LIBS} ${{ inputs.make-arguments }}'
|
||||
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
debug-suffix: "${{ matrix.debug-level == 'debug' && '-debug' || '' }}"
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
- name: 'Upload bundles'
|
||||
uses: ./.github/actions/upload-bundles
|
||||
with:
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
debug-suffix: "${{ matrix.debug-level == 'debug' && '-debug' || '' }}"
|
||||
bundle-suffix: ${{ inputs.bundle-suffix }}
|
||||
static-suffix: ${{ inputs.static-suffix }}
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
6
.github/workflows/build-macos.yml
vendored
6
.github/workflows/build-macos.yml
vendored
@ -54,6 +54,10 @@ on:
|
||||
make-arguments:
|
||||
required: false
|
||||
type: string
|
||||
dry-run:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build-macos:
|
||||
@ -118,9 +122,11 @@ jobs:
|
||||
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
- name: 'Upload bundles'
|
||||
uses: ./.github/actions/upload-bundles
|
||||
with:
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
13
.github/workflows/build-windows.yml
vendored
13
.github/workflows/build-windows.yml
vendored
@ -54,6 +54,10 @@ on:
|
||||
make-arguments:
|
||||
required: false
|
||||
type: string
|
||||
dry-run:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
env:
|
||||
# These are needed to make the MSYS2 bash work properly
|
||||
@ -63,7 +67,7 @@ env:
|
||||
jobs:
|
||||
build-windows:
|
||||
name: build
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2025
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
@ -102,7 +106,7 @@ jobs:
|
||||
id: toolchain-check
|
||||
run: |
|
||||
set +e
|
||||
'/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/vc/auxiliary/build/vcvars64.bat' -vcvars_ver=${{ inputs.msvc-toolset-version }}
|
||||
'/c/Program Files/Microsoft Visual Studio/2022/Enterprise/vc/auxiliary/build/vcvars64.bat' -vcvars_ver=${{ inputs.msvc-toolset-version }}
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Toolchain is already installed"
|
||||
echo "toolchain-installed=true" >> $GITHUB_OUTPUT
|
||||
@ -115,7 +119,7 @@ jobs:
|
||||
run: |
|
||||
# Run Visual Studio Installer
|
||||
'/c/Program Files (x86)/Microsoft Visual Studio/Installer/vs_installer.exe' \
|
||||
modify --quiet --installPath 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise' \
|
||||
modify --quiet --installPath 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise' \
|
||||
--add Microsoft.VisualStudio.Component.VC.${{ inputs.msvc-toolset-version }}.${{ inputs.msvc-toolset-architecture }}
|
||||
if: steps.toolchain-check.outputs.toolchain-installed != 'true'
|
||||
|
||||
@ -139,6 +143,7 @@ jobs:
|
||||
# Set PATH to "", so just GITHUB_PATH is included
|
||||
PATH: ''
|
||||
shell: env /usr/bin/bash --login -eo pipefail {0}
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
- name: 'Build'
|
||||
id: build
|
||||
@ -147,9 +152,11 @@ jobs:
|
||||
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
- name: 'Upload bundles'
|
||||
uses: ./.github/actions/upload-bundles
|
||||
with:
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: '${{ matrix.suffix }}'
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
253
.github/workflows/main.yml
vendored
253
.github/workflows/main.yml
vendored
@ -28,21 +28,22 @@ name: 'OpenJDK GHA Sanity Checks'
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- master
|
||||
- pr/*
|
||||
- jdk*
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
platforms:
|
||||
description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")'
|
||||
required: true
|
||||
default: 'linux-x64, linux-x86-hs, linux-x64-variants, linux-cross-compile, alpine-linux-x64, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
|
||||
default: 'linux-x64, linux-x64-variants, linux-cross-compile, alpine-linux-x64, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
|
||||
configure-arguments:
|
||||
description: 'Additional configure arguments'
|
||||
required: false
|
||||
make-arguments:
|
||||
description: 'Additional make arguments'
|
||||
required: false
|
||||
dry-run:
|
||||
description: 'Dry run: skip actual builds and tests'
|
||||
required: false
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@ -54,15 +55,14 @@ jobs:
|
||||
### Determine platforms to include
|
||||
###
|
||||
|
||||
select:
|
||||
name: 'Select platforms'
|
||||
prepare:
|
||||
name: 'Prepare the run'
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
# List of platforms to exclude by default
|
||||
EXCLUDED_PLATFORMS: 'alpine-linux-x64'
|
||||
outputs:
|
||||
linux-x64: ${{ steps.include.outputs.linux-x64 }}
|
||||
linux-x86-hs: ${{ steps.include.outputs.linux-x86-hs }}
|
||||
linux-x64-variants: ${{ steps.include.outputs.linux-x64-variants }}
|
||||
linux-cross-compile: ${{ steps.include.outputs.linux-cross-compile }}
|
||||
alpine-linux-x64: ${{ steps.include.outputs.alpine-linux-x64 }}
|
||||
@ -71,9 +71,22 @@ jobs:
|
||||
windows-x64: ${{ steps.include.outputs.windows-x64 }}
|
||||
windows-aarch64: ${{ steps.include.outputs.windows-aarch64 }}
|
||||
docs: ${{ steps.include.outputs.docs }}
|
||||
dry-run: ${{ steps.include.outputs.dry-run }}
|
||||
|
||||
steps:
|
||||
# This function must be inlined in main.yml, or we'd be forced to checkout the repo
|
||||
- name: 'Checkout the scripts'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
sparse-checkout: |
|
||||
.github
|
||||
make/conf/github-actions.conf
|
||||
|
||||
- name: 'Build JTReg'
|
||||
id: jtreg
|
||||
uses: ./.github/actions/build-jtreg
|
||||
|
||||
# TODO: Now that we are checking out the repo scripts, we can put the following code
|
||||
# into a separate file
|
||||
- name: 'Check what jobs to run'
|
||||
id: include
|
||||
run: |
|
||||
@ -132,8 +145,36 @@ jobs:
|
||||
echo 'false'
|
||||
}
|
||||
|
||||
function check_dry_run() {
|
||||
if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
|
||||
# Take the user-specified one.
|
||||
echo '${{ github.event.inputs.dry-run }}'
|
||||
return
|
||||
elif [[ $GITHUB_EVENT_NAME == push ]]; then
|
||||
# Cut out the real branch name
|
||||
BRANCH=${GITHUB_REF##*/}
|
||||
|
||||
# Dry run rebuilds the caches in current branch, so they can be reused
|
||||
# for any child PR branches. Because of this, we want to trigger this
|
||||
# workflow in master branch, so that actual PR branches can use the cache.
|
||||
# This workflow would trigger every time contributors sync their master
|
||||
# branches in their personal forks.
|
||||
if [[ $BRANCH == "master" ]]; then
|
||||
echo 'true'
|
||||
return
|
||||
fi
|
||||
|
||||
# ...same for stabilization branches
|
||||
if [[ $BRANCH =~ "jdk(.*)" ]]; then
|
||||
echo 'true'
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
echo 'false'
|
||||
}
|
||||
|
||||
echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT
|
||||
echo "linux-x86-hs=$(check_platform linux-x86-hs linux x86)" >> $GITHUB_OUTPUT
|
||||
echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
|
||||
echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT
|
||||
echo "alpine-linux-x64=$(check_platform alpine-linux-x64 alpine-linux x64)" >> $GITHUB_OUTPUT
|
||||
@ -142,6 +183,7 @@ jobs:
|
||||
echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT
|
||||
echo "windows-aarch64=$(check_platform windows-aarch64 windows aarch64)" >> $GITHUB_OUTPUT
|
||||
echo "docs=$(check_platform docs)" >> $GITHUB_OUTPUT
|
||||
echo "dry-run=$(check_dry_run)" >> $GITHUB_OUTPUT
|
||||
|
||||
###
|
||||
### Build jobs
|
||||
@ -149,36 +191,19 @@ jobs:
|
||||
|
||||
build-linux-x64:
|
||||
name: linux-x64
|
||||
needs: select
|
||||
needs: prepare
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
gcc-major-version: '10'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-x64 == 'true'
|
||||
|
||||
build-linux-x86-hs:
|
||||
name: linux-x86-hs
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x86
|
||||
make-target: 'hotspot'
|
||||
gcc-major-version: '10'
|
||||
gcc-package-suffix: '-multilib'
|
||||
apt-architecture: 'i386'
|
||||
# Some multilib libraries do not have proper inter-dependencies, so we have to
|
||||
# install their dependencies manually.
|
||||
apt-extra-packages: 'libfreetype-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libffi-dev:i386'
|
||||
extra-conf-options: '--with-target-bits=32 --enable-fallback-linker --enable-libffi-bundling'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-x86-hs == 'true'
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.linux-x64 == 'true'
|
||||
|
||||
build-linux-x64-hs-nopch:
|
||||
name: linux-x64-hs-nopch
|
||||
needs: select
|
||||
needs: prepare
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
@ -188,11 +213,12 @@ jobs:
|
||||
extra-conf-options: '--disable-precompiled-headers'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-x64-variants == 'true'
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.linux-x64-variants == 'true'
|
||||
|
||||
build-linux-x64-hs-zero:
|
||||
name: linux-x64-hs-zero
|
||||
needs: select
|
||||
needs: prepare
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
@ -202,11 +228,12 @@ jobs:
|
||||
extra-conf-options: '--with-jvm-variants=zero --disable-precompiled-headers'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-x64-variants == 'true'
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.linux-x64-variants == 'true'
|
||||
|
||||
build-linux-x64-hs-minimal:
|
||||
name: linux-x64-hs-minimal
|
||||
needs: select
|
||||
needs: prepare
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
@ -216,11 +243,12 @@ jobs:
|
||||
extra-conf-options: '--with-jvm-variants=minimal --disable-precompiled-headers'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-x64-variants == 'true'
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.linux-x64-variants == 'true'
|
||||
|
||||
build-linux-x64-hs-optimized:
|
||||
name: linux-x64-hs-optimized
|
||||
needs: select
|
||||
needs: prepare
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
@ -231,32 +259,71 @@ jobs:
|
||||
extra-conf-options: '--with-debug-level=optimized --disable-precompiled-headers'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-x64-variants == 'true'
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.linux-x64-variants == 'true'
|
||||
|
||||
build-linux-x64-static:
|
||||
name: linux-x64-static
|
||||
needs: prepare
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
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 }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
static-suffix: "-static"
|
||||
if: needs.prepare.outputs.linux-x64 == 'true'
|
||||
|
||||
build-linux-x64-static-libs:
|
||||
name: linux-x64-static-libs
|
||||
needs: prepare
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
make-target: 'static-libs-bundles'
|
||||
# Only build static-libs-bundles for release builds.
|
||||
# For debug builds, building static-libs often exceeds disk space.
|
||||
debug-levels: '[ "release" ]'
|
||||
gcc-major-version: '10'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
# Upload static libs bundles separately to avoid interference with normal linux-x64 bundle.
|
||||
# This bundle is not used by testing jobs, but downstreams use it to check that
|
||||
# dependent projects, e.g. libgraal, builds fine.
|
||||
bundle-suffix: "-static-libs"
|
||||
if: needs.prepare.outputs.linux-x64-variants == 'true'
|
||||
|
||||
build-linux-cross-compile:
|
||||
name: linux-cross-compile
|
||||
needs:
|
||||
- select
|
||||
needs: prepare
|
||||
uses: ./.github/workflows/build-cross-compile.yml
|
||||
with:
|
||||
gcc-major-version: '10'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-cross-compile == 'true'
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.linux-cross-compile == 'true'
|
||||
|
||||
build-alpine-linux-x64:
|
||||
name: alpine-linux-x64
|
||||
needs: select
|
||||
needs: prepare
|
||||
uses: ./.github/workflows/build-alpine-linux.yml
|
||||
with:
|
||||
platform: alpine-linux-x64
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.alpine-linux-x64 == 'true'
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.alpine-linux-x64 == 'true'
|
||||
|
||||
build-macos-x64:
|
||||
name: macos-x64
|
||||
needs: select
|
||||
needs: prepare
|
||||
uses: ./.github/workflows/build-macos.yml
|
||||
with:
|
||||
platform: macos-x64
|
||||
@ -264,49 +331,53 @@ jobs:
|
||||
xcode-toolset-version: '14.3.1'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.macos-x64 == 'true'
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.macos-x64 == 'true'
|
||||
|
||||
build-macos-aarch64:
|
||||
name: macos-aarch64
|
||||
needs: select
|
||||
needs: prepare
|
||||
uses: ./.github/workflows/build-macos.yml
|
||||
with:
|
||||
platform: macos-aarch64
|
||||
runs-on: 'macos-14'
|
||||
xcode-toolset-version: '14.3.1'
|
||||
xcode-toolset-version: '15.4'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.macos-aarch64 == 'true'
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.macos-aarch64 == 'true'
|
||||
|
||||
build-windows-x64:
|
||||
name: windows-x64
|
||||
needs: select
|
||||
needs: prepare
|
||||
uses: ./.github/workflows/build-windows.yml
|
||||
with:
|
||||
platform: windows-x64
|
||||
msvc-toolset-version: '14.29'
|
||||
msvc-toolset-version: '14.44'
|
||||
msvc-toolset-architecture: 'x86.x64'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.windows-x64 == 'true'
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.windows-x64 == 'true'
|
||||
|
||||
build-windows-aarch64:
|
||||
name: windows-aarch64
|
||||
needs: select
|
||||
needs: prepare
|
||||
uses: ./.github/workflows/build-windows.yml
|
||||
with:
|
||||
platform: windows-aarch64
|
||||
msvc-toolset-version: '14.29'
|
||||
msvc-toolset-version: '14.44'
|
||||
msvc-toolset-architecture: 'arm64'
|
||||
make-target: 'hotspot'
|
||||
extra-conf-options: '--openjdk-target=aarch64-unknown-cygwin'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.windows-aarch64 == 'true'
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.windows-aarch64 == 'true'
|
||||
|
||||
build-docs:
|
||||
name: docs
|
||||
needs: select
|
||||
needs: prepare
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
@ -318,7 +389,8 @@ jobs:
|
||||
gcc-major-version: '10'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.docs == 'true'
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
if: needs.prepare.outputs.docs == 'true'
|
||||
|
||||
###
|
||||
### Test jobs
|
||||
@ -327,84 +399,53 @@ jobs:
|
||||
test-linux-x64:
|
||||
name: linux-x64
|
||||
needs:
|
||||
- prepare
|
||||
- build-linux-x64
|
||||
uses: ./.github/workflows/test.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
bootjdk-platform: linux-x64
|
||||
runs-on: ubuntu-22.04
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
debug-suffix: -debug
|
||||
|
||||
test-macos-x64:
|
||||
name: macos-x64
|
||||
test-linux-x64-static:
|
||||
name: linux-x64-static
|
||||
needs:
|
||||
- build-macos-x64
|
||||
- prepare
|
||||
- build-linux-x64
|
||||
- build-linux-x64-static
|
||||
uses: ./.github/workflows/test.yml
|
||||
with:
|
||||
platform: macos-x64
|
||||
bootjdk-platform: macos-x64
|
||||
runs-on: macos-13
|
||||
platform: linux-x64
|
||||
bootjdk-platform: linux-x64
|
||||
runs-on: ubuntu-22.04
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
static-suffix: "-static"
|
||||
|
||||
test-macos-aarch64:
|
||||
name: macos-aarch64
|
||||
needs:
|
||||
- prepare
|
||||
- build-macos-aarch64
|
||||
uses: ./.github/workflows/test.yml
|
||||
with:
|
||||
platform: macos-aarch64
|
||||
bootjdk-platform: macos-aarch64
|
||||
runs-on: macos-14
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
xcode-toolset-version: '15.4'
|
||||
debug-suffix: -debug
|
||||
|
||||
test-windows-x64:
|
||||
name: windows-x64
|
||||
needs:
|
||||
- prepare
|
||||
- build-windows-x64
|
||||
uses: ./.github/workflows/test.yml
|
||||
with:
|
||||
platform: windows-x64
|
||||
bootjdk-platform: windows-x64
|
||||
runs-on: windows-2019
|
||||
|
||||
# Remove bundles so they are not misconstrued as binary distributions from the JDK project
|
||||
remove-bundles:
|
||||
name: 'Remove bundle artifacts'
|
||||
runs-on: ubuntu-22.04
|
||||
if: always()
|
||||
needs:
|
||||
- build-linux-x64
|
||||
- build-linux-x86-hs
|
||||
- build-linux-x64-hs-nopch
|
||||
- build-linux-x64-hs-zero
|
||||
- build-linux-x64-hs-minimal
|
||||
- build-linux-x64-hs-optimized
|
||||
- build-linux-cross-compile
|
||||
- build-alpine-linux-x64
|
||||
- build-macos-x64
|
||||
- build-macos-aarch64
|
||||
- build-windows-x64
|
||||
- build-windows-aarch64
|
||||
- test-linux-x64
|
||||
- test-macos-x64
|
||||
- test-macos-aarch64
|
||||
- test-windows-x64
|
||||
|
||||
steps:
|
||||
- name: 'Remove bundle artifacts'
|
||||
run: |
|
||||
# Find and remove all bundle artifacts
|
||||
# See: https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28
|
||||
ALL_ARTIFACT_IDS="$(curl -sL \
|
||||
-H 'Accept: application/vnd.github+json' \
|
||||
-H 'Authorization: Bearer ${{ github.token }}' \
|
||||
-H 'X-GitHub-Api-Version: 2022-11-28' \
|
||||
'${{ github.api_url }}/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts?per_page=100')"
|
||||
BUNDLE_ARTIFACT_IDS="$(echo "$ALL_ARTIFACT_IDS" | jq -r -c '.artifacts | map(select(.name|startswith("bundles-"))) | .[].id')"
|
||||
for id in $BUNDLE_ARTIFACT_IDS; do
|
||||
echo "Removing $id"
|
||||
curl -sL \
|
||||
-X DELETE \
|
||||
-H 'Accept: application/vnd.github+json' \
|
||||
-H 'Authorization: Bearer ${{ github.token }}' \
|
||||
-H 'X-GitHub-Api-Version: 2022-11-28' \
|
||||
"${{ github.api_url }}/repos/${{ github.repository }}/actions/artifacts/$id" \
|
||||
|| echo "Failed to remove bundle"
|
||||
done
|
||||
runs-on: windows-2025
|
||||
dry-run: ${{ needs.prepare.outputs.dry-run == 'true' }}
|
||||
debug-suffix: -debug
|
||||
|
||||
62
.github/workflows/test.yml
vendored
62
.github/workflows/test.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -37,6 +37,19 @@ on:
|
||||
runs-on:
|
||||
required: true
|
||||
type: string
|
||||
xcode-toolset-version:
|
||||
required: false
|
||||
type: string
|
||||
dry-run:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
debug-suffix:
|
||||
required: false
|
||||
type: string
|
||||
static-suffix:
|
||||
required: false
|
||||
type: string
|
||||
|
||||
env:
|
||||
# These are needed to make the MSYS2 bash work properly
|
||||
@ -63,7 +76,6 @@ jobs:
|
||||
- 'hs/tier1 compiler part 1'
|
||||
- 'hs/tier1 compiler part 2'
|
||||
- 'hs/tier1 compiler part 3'
|
||||
- 'hs/tier1 compiler not-xcomp'
|
||||
- 'hs/tier1 gc'
|
||||
- 'hs/tier1 runtime'
|
||||
- 'hs/tier1 serviceability'
|
||||
@ -84,39 +96,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
|
||||
|
||||
- test-name: 'hs/tier1 compiler not-xcomp'
|
||||
test-suite: 'test/hotspot/jtreg/:tier1_compiler_not_xcomp'
|
||||
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'
|
||||
@ -142,12 +150,14 @@ jobs:
|
||||
with:
|
||||
platform: ${{ inputs.platform }}
|
||||
debug-suffix: ${{ matrix.debug-suffix }}
|
||||
static-suffix: ${{ inputs.static-suffix }}
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
- name: 'Install dependencies'
|
||||
run: |
|
||||
# On macOS we need to install some dependencies for testing
|
||||
brew install make
|
||||
sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer
|
||||
sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode-toolset-version }}.app/Contents/Developer
|
||||
# This will make GNU make available as 'make' and not only as 'gmake'
|
||||
echo '/usr/local/opt/make/libexec/gnubin' >> $GITHUB_PATH
|
||||
if: runner.os == 'macOS'
|
||||
@ -162,6 +172,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
|
||||
@ -173,10 +198,13 @@ 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 }}
|
||||
if: ${{ inputs.dry-run == false }}
|
||||
|
||||
# This is a separate step, since if the markdown from a step gets bigger than
|
||||
# 1024 kB it is skipped, but then the short summary above is still generated
|
||||
@ -206,7 +234,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()
|
||||
|
||||
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@ -20,3 +20,8 @@ NashornProfile.txt
|
||||
/.settings/
|
||||
/compile_commands.json
|
||||
/.cache
|
||||
/.gdbinit
|
||||
/.lldbinit
|
||||
**/core.[0-9]*
|
||||
*.rej
|
||||
*.orig
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
[general]
|
||||
project=jdk
|
||||
jbs=JDK
|
||||
version=24
|
||||
version=26
|
||||
|
||||
[checks]
|
||||
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
|
||||
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists,copyright
|
||||
warning=issuestitle,binary
|
||||
|
||||
[repository]
|
||||
@ -34,3 +34,8 @@ pattern=^([124-8][0-9]{6}): (\S.*)$
|
||||
|
||||
[checks "problemlists"]
|
||||
dirs=test/jdk|test/langtools|test/lib-test|test/hotspot/jtreg|test/jaxp
|
||||
|
||||
[checks "copyright"]
|
||||
files=^(?!LICENSE|license\.txt|.*\.bin|.*\.gif|.*\.jpg|.*\.png|.*\.icon|.*\.tiff|.*\.dat|.*\.patch|.*\.wav|.*\.class|.*-header|.*\.jar).*
|
||||
oracle_locator=.*Copyright \(c\)(.*)Oracle and/or its affiliates\. All rights reserved\.
|
||||
oracle_validator=.*Copyright \(c\) (\d{4})(?:, (\d{4}))?, Oracle and/or its affiliates\. All rights reserved\.
|
||||
|
||||
@ -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/).
|
||||
|
||||
13
Makefile
13
Makefile
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 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,8 +24,9 @@
|
||||
#
|
||||
|
||||
###
|
||||
### This file is just a very small wrapper needed to run the real make/Init.gmk.
|
||||
### It also performs some sanity checks on make.
|
||||
### This file is just a very small wrapper which will include make/PreInit.gmk,
|
||||
### where the real work is done. This wrapper also performs some sanity checks
|
||||
### on make that must be done before we can include another file.
|
||||
###
|
||||
|
||||
# The shell code below will be executed on /usr/bin/make on Solaris, but not in GNU Make.
|
||||
@ -58,7 +59,7 @@ ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))),)
|
||||
else
|
||||
makefile_path := $(lastword $(MAKEFILE_LIST))
|
||||
endif
|
||||
topdir := $(strip $(patsubst %/, %, $(dir $(makefile_path))))
|
||||
TOPDIR := $(strip $(patsubst %/, %, $(dir $(makefile_path))))
|
||||
|
||||
# ... and then we can include the real makefile
|
||||
include $(topdir)/make/Init.gmk
|
||||
# ... and then we can include the real makefile to bootstrap the build
|
||||
include $(TOPDIR)/make/PreInit.gmk
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2009, 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
|
||||
@ -99,7 +99,7 @@ if [ "$VERBOSE" = "true" ] ; then
|
||||
echo "idea template dir: $IDEA_TEMPLATE"
|
||||
fi
|
||||
|
||||
cd $TOP ; make -f "$IDEA_MAKE/idea.gmk" -I $MAKE_DIR/.. idea MAKEOVERRIDES= OUT=$IDEA_OUTPUT/env.cfg MODULES="$*" $CONF_ARG || exit 1
|
||||
cd $TOP ; make idea-gen-config ALLOW=IDEA_OUTPUT,MODULES IDEA_OUTPUT=$IDEA_OUTPUT MODULES="$*" $CONF_ARG || exit 1
|
||||
cd $SCRIPT_DIR
|
||||
|
||||
. $IDEA_OUTPUT/env.cfg
|
||||
@ -125,7 +125,8 @@ if [ -d "$TOPLEVEL_DIR/.hg" ] ; then
|
||||
VCS_TYPE="hg4idea"
|
||||
fi
|
||||
|
||||
if [ -d "$TOPLEVEL_DIR/.git" ] ; then
|
||||
# Git worktrees use a '.git' file rather than directory, so test both.
|
||||
if [ -d "$TOPLEVEL_DIR/.git" -o -f "$TOPLEVEL_DIR/.git" ] ; then
|
||||
VCS_TYPE="Git"
|
||||
fi
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 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
|
||||
@ -78,7 +78,6 @@ src/jdk.jdi : jdk/src/jdk.jdi
|
||||
src/jdk.jdwp.agent : jdk/src/jdk.jdwp.agent
|
||||
src/jdk.jlink : jdk/src/jdk.jlink
|
||||
src/jdk.jshell : langtools/src/jdk.jshell
|
||||
src/jdk.jsobject : jdk/src/jdk.jsobject
|
||||
src/jdk.jstatd : jdk/src/jdk.jstatd
|
||||
src/jdk.localedata : jdk/src/jdk.localedata
|
||||
src/jdk.management : jdk/src/jdk.management
|
||||
|
||||
@ -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.</p></li>
|
||||
<li><p>On Windows, if using <a href="#cygwin">Cygwin</a>, extra care
|
||||
must be taken to make sure the environment is consistent. It is
|
||||
recommended that you follow this procedure:</p>
|
||||
<li><p>UTF-8 support is needed to compile the JDK. On Unix systems, this
|
||||
typically means that the <code>C.UTF-8</code> or
|
||||
<code>en_US.UTF-8</code> locale needs to be available. For Windows
|
||||
users, please see the section on <a href="#locale-requirements">Locale
|
||||
Requirements</a> below.</p></li>
|
||||
<li><p>On Windows, extra care must be taken to have a smooth building
|
||||
experience:</p>
|
||||
<ul>
|
||||
<li><p>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: <code>fsutil 8dot3name query</code>. 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
|
||||
<code>dir /X</code> 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
|
||||
<code>fsutil 8dot3name set <drive letter>: 0</code> (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
|
||||
<code>fsutil file setShortName <path> <short name></code>.</p></li>
|
||||
<li><p>If using <a href="#cygwin">Cygwin</a>, you must make sure the
|
||||
file permissions and attributes between Windows and Cygwin are
|
||||
consistent. It is recommended that you follow this procedure:</p>
|
||||
<ul>
|
||||
<li><p>Create the directory that is going to contain the top directory
|
||||
of the JDK clone by using the <code>mkdir</code> command in the Cygwin
|
||||
@ -294,6 +319,9 @@ it's children will inherit those attributes.</p></li>
|
||||
<li><p>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.</p></li>
|
||||
</ul>
|
||||
<p>Failure to follow these procedures might result in hard-to-debug
|
||||
build problems.</p></li>
|
||||
<li><p>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.</p>
|
||||
@ -311,9 +339,7 @@ It does work well with the Skara CLI tooling, however. To alleviate the
|
||||
line ending problems, make sure you set <code>core.autocrlf</code> to
|
||||
<code>false</code> (this is asked during installation).</p></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<p>Failure to follow this procedure might result in hard-to-debug build
|
||||
problems.</p></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h2 id="build-hardware-requirements">Build Hardware Requirements</h2>
|
||||
<p>The JDK is a massive project, and require machines ranging from
|
||||
@ -329,8 +355,8 @@ GB of free disk space is required.</p>
|
||||
<p>Even for 32-bit builds, it is recommended to use a 64-bit build
|
||||
machine, and instead create a 32-bit target using
|
||||
<code>--with-target-bits=32</code>.</p>
|
||||
<p>Note: The Windows 32-bit x86 port is deprecated and may be removed in
|
||||
a future release.</p>
|
||||
<p>Note: The 32-bit x86 port is deprecated and may be removed in a
|
||||
future release.</p>
|
||||
<h3 id="building-on-aarch64">Building on aarch64</h3>
|
||||
<p>At a minimum, a machine with 8 cores is advisable, as well as 8 GB of
|
||||
RAM. (The more cores to use, the more memory you need.) At least 6 GB of
|
||||
@ -376,7 +402,7 @@ to date at the time of writing.</p>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>macOS</td>
|
||||
<td>macOS 13.x (Ventura)</td>
|
||||
<td>macOS 14.x</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>Windows</td>
|
||||
@ -393,8 +419,7 @@ Build Platforms</a>. From time to time, this is updated by contributors
|
||||
to list successes or failures of building on different platforms.</p>
|
||||
<h3 id="windows">Windows</h3>
|
||||
<p>Windows XP is not a supported platform, but all newer Windows should
|
||||
be able to build the JDK. (Note: The Windows 32-bit x86 port is
|
||||
deprecated and may be removed in a future release.)</p>
|
||||
be able to build the JDK.</p>
|
||||
<p>On Windows, it is important that you pay attention to the
|
||||
instructions in the <a href="#special-considerations">Special
|
||||
Considerations</a>.</p>
|
||||
@ -514,8 +539,8 @@ this makes it difficult for a project such as the JDK to keep pace with
|
||||
a continuously updated machine running macOS. See the section on <a
|
||||
href="#apple-xcode">Apple Xcode</a> on some strategies to deal with
|
||||
this.</p>
|
||||
<p>It is recommended that you use at least macOS 13 (Ventura) and Xcode
|
||||
14, but earlier versions may also work.</p>
|
||||
<p>It is recommended that you use at least macOS 14 and Xcode 15.4, but
|
||||
earlier versions may also work.</p>
|
||||
<p>The standard macOS environment contains the basic tooling needed to
|
||||
build, but for external libraries a package manager is recommended. The
|
||||
JDK uses <a href="https://brew.sh/">homebrew</a> in the examples, but
|
||||
@ -587,15 +612,15 @@ to compile successfully without issues.</p>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>Linux</td>
|
||||
<td>gcc 13.2.0</td>
|
||||
<td>gcc 14.2.0</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>macOS</td>
|
||||
<td>Apple Xcode 14.3.1 (using clang 14.0.3)</td>
|
||||
<td>Apple Xcode 15.4 (using clang 15.0.0)</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>Windows</td>
|
||||
<td>Microsoft Visual Studio 2022 version 17.6.5</td>
|
||||
<td>Microsoft Visual Studio 2022 version 17.13.2</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -605,7 +630,7 @@ standard for C, and C++14 for C++.</p>
|
||||
<p>The minimum accepted version of gcc is 10.0. Older versions will not
|
||||
be accepted by <code>configure</code>.</p>
|
||||
<p>The JDK is currently known to compile successfully with gcc version
|
||||
13.2 or newer.</p>
|
||||
14.2 or newer.</p>
|
||||
<p>In general, any version between these two should be usable.</p>
|
||||
<h3 id="clang">clang</h3>
|
||||
<p>The minimum accepted version of clang is 13. Older versions will not
|
||||
@ -864,12 +889,12 @@ href="https://www.gnu.org/software/bash">GNU Bash</a>. No other shells
|
||||
are supported.</p>
|
||||
<p>At least version 3.2 of GNU Bash must be used.</p>
|
||||
<h3 id="graphviz-and-pandoc">Graphviz and Pandoc</h3>
|
||||
<p>In order to build the full docs (see the
|
||||
<p>In order to build man pages and the full docs (see the
|
||||
<code>--enable-full-docs</code> configure option) <a
|
||||
href="https://www.graphviz.org">Graphviz</a> and <a
|
||||
href="https://pandoc.org">Pandoc</a> are required. Any recent versions
|
||||
should work. For reference, and subject to change, Oracle builds use
|
||||
Graphviz 9.0.0 and Pandoc 2.19.2.</p>
|
||||
href="https://pandoc.org">Pandoc</a> is required. For full docs also <a
|
||||
href="https://www.graphviz.org">Graphviz</a> is required. Any recent
|
||||
versions should work. For reference, and subject to change, Oracle
|
||||
builds use Graphviz 9.0.0 and Pandoc 2.19.2.</p>
|
||||
<h2 id="running-configure">Running Configure</h2>
|
||||
<p>To build the JDK, you need a "configuration", which consists of a
|
||||
directory where to store the build output, coupled with information
|
||||
@ -1426,10 +1451,10 @@ of a cross-compiling toolchain and a sysroot environment which can
|
||||
easily be used together with the <code>--with-devkit</code> configure
|
||||
option to cross compile the JDK. On Linux/x86_64, the following
|
||||
command:</p>
|
||||
<pre><code>bash configure --with-devkit=<devkit-path> --openjdk-target=ppc64-linux-gnu && make</code></pre>
|
||||
<p>will configure and build the JDK for Linux/ppc64 assuming that
|
||||
<code><devkit-path></code> points to a Linux/x86_64 to Linux/ppc64
|
||||
devkit.</p>
|
||||
<pre><code>bash configure --with-devkit=<devkit-path> --openjdk-target=ppc64le-linux-gnu && make</code></pre>
|
||||
<p>will configure and build the JDK for Linux/ppc64le assuming that
|
||||
<code><devkit-path></code> points to a Linux/x86_64 to
|
||||
Linux/ppc64le devkit.</p>
|
||||
<p>Devkits can be created from the <code>make/devkit</code> directory by
|
||||
executing:</p>
|
||||
<pre><code>make [ TARGETS="<TARGET_TRIPLET>+" ] [ BASE_OS=<OS> ] [ BASE_OS_VERSION=<VER> ]</code></pre>
|
||||
@ -1456,22 +1481,22 @@ following targets are known to work:</p>
|
||||
<td>arm-linux-gnueabihf</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>ppc64-linux-gnu</td>
|
||||
<td>ppc64le-linux-gnu</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>ppc64le-linux-gnu</td>
|
||||
<td>riscv64-linux-gnu</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>s390x-linux-gnu</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><code>BASE_OS</code> must be one of "OEL6" for Oracle Enterprise
|
||||
Linux 6 or "Fedora" (if not specified "OEL6" will be the default). If
|
||||
the base OS is "Fedora" the corresponding Fedora release can be
|
||||
specified with the help of the <code>BASE_OS_VERSION</code> option (with
|
||||
"27" as default version). If the build is successful, the new devkits
|
||||
can be found in the <code>build/devkit/result</code> subdirectory:</p>
|
||||
<p><code>BASE_OS</code> must be one of <code>OL</code> for Oracle
|
||||
Enterprise Linux or <code>Fedora</code>. If the base OS is
|
||||
<code>Fedora</code> the corresponding Fedora release can be specified
|
||||
with the help of the <code>BASE_OS_VERSION</code> option. If the build
|
||||
is successful, the new devkits can be found in the
|
||||
<code>build/devkit/result</code> subdirectory:</p>
|
||||
<pre><code>cd make/devkit
|
||||
make TARGETS="ppc64le-linux-gnu aarch64-linux-gnu" BASE_OS=Fedora BASE_OS_VERSION=21
|
||||
ls -1 ../../build/devkit/result/
|
||||
@ -1723,6 +1748,20 @@ packages in the sysroot, configure the build with
|
||||
--with-devkit=$DEVKIT \
|
||||
--with-sysroot=$SYSROOT</code></pre>
|
||||
<p>and run <code>make</code> normally.</p>
|
||||
<h4 id="building-for-windows-aarch64">Building for Windows AArch64</h4>
|
||||
<p>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:</p>
|
||||
<pre><code>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</code></pre>
|
||||
<p>To generate Windows AArch64 builds using Cygwin on a Windows x64
|
||||
machine, you must set the proper target platform by adding
|
||||
<code>--openjdk-target=aarch64-unknown-cygwin</code> to your configure
|
||||
command line.</p>
|
||||
<h2 id="build-performance">Build Performance</h2>
|
||||
<p>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
|
||||
@ -2016,10 +2055,18 @@ some directory names have spaces. Usually, it assumes those directories
|
||||
have <a
|
||||
href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-8dot3name">short
|
||||
paths</a>. You can run <code>fsutil file setshortname</code> in
|
||||
<code>cmd</code> on certain directories, such as
|
||||
<code>Microsoft Visual Studio</code> or <code>Windows Kits</code>, to
|
||||
assign arbitrary short paths so <code>configure</code> can access
|
||||
them.</p>
|
||||
<code>cmd</code> on directories to assign arbitrary short paths so
|
||||
<code>configure</code> can access them. If the result says "Access
|
||||
denied", it may be that there are processes running in that directory;
|
||||
in this case, you can reboot Windows in safe mode and run the command on
|
||||
those directories again.</p>
|
||||
<p>The only directories required to have short paths are
|
||||
<code>Microsoft Visual Studio</code> and <code>Windows Kits</code>; the
|
||||
rest of the "contains space" warnings from <code>configure</code>, such
|
||||
as <code>IntelliJ IDEA</code>, can be ignored. You can choose any short
|
||||
name; once it is set, <code>configure</code>'s tools like
|
||||
<code>cygpath</code> can convert the directory with spaces to your
|
||||
chosen short name and pass it to the build system.</p>
|
||||
<h3 id="getting-help">Getting Help</h3>
|
||||
<p>If none of the suggestions in this document helps you, or if you find
|
||||
what you believe is a bug in the build system, please contact the Build
|
||||
|
||||
128
doc/building.md
128
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 <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](#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 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.
|
||||
|
||||
* 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.
|
||||
@ -113,9 +138,6 @@ on where and how to check out the source code.
|
||||
make sure you set `core.autocrlf` to `false` (this is asked during
|
||||
installation).
|
||||
|
||||
Failure to follow this procedure might result in hard-to-debug build
|
||||
problems.
|
||||
|
||||
## Build Hardware Requirements
|
||||
|
||||
The JDK is a massive project, and require machines ranging from decent to
|
||||
@ -134,8 +156,7 @@ space is required.
|
||||
Even for 32-bit builds, it is recommended to use a 64-bit build machine, and
|
||||
instead create a 32-bit target using `--with-target-bits=32`.
|
||||
|
||||
Note: The Windows 32-bit x86 port is deprecated and may be removed in a future
|
||||
release.
|
||||
Note: The 32-bit x86 port is deprecated and may be removed in a future release.
|
||||
|
||||
### Building on aarch64
|
||||
|
||||
@ -176,7 +197,7 @@ time of writing.
|
||||
| ----------------- | ---------------------------------- |
|
||||
| Linux/x64 | Oracle Enterprise Linux 6.4 / 8.x |
|
||||
| Linux/aarch64 | Oracle Enterprise Linux 7.6 / 8.x |
|
||||
| macOS | macOS 13.x (Ventura) |
|
||||
| macOS | macOS 14.x |
|
||||
| Windows | Windows Server 2016 |
|
||||
|
||||
The double version numbers for Linux are due to the hybrid model used at
|
||||
@ -191,8 +212,7 @@ on different platforms.
|
||||
### Windows
|
||||
|
||||
Windows XP is not a supported platform, but all newer Windows should be able to
|
||||
build the JDK. (Note: The Windows 32-bit x86 port is deprecated and may be
|
||||
removed in a future release.)
|
||||
build the JDK.
|
||||
|
||||
On Windows, it is important that you pay attention to the instructions in the
|
||||
[Special Considerations](#special-considerations).
|
||||
@ -329,7 +349,7 @@ difficult for a project such as the JDK to keep pace with a continuously
|
||||
updated machine running macOS. See the section on [Apple Xcode](#apple-xcode)
|
||||
on some strategies to deal with this.
|
||||
|
||||
It is recommended that you use at least macOS 13 (Ventura) and Xcode 14, but
|
||||
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
|
||||
@ -392,11 +412,11 @@ possible to compile the JDK with both older and newer versions, but the closer
|
||||
you stay to this list, the more likely you are to compile successfully without
|
||||
issues.
|
||||
|
||||
| Operating system | Toolchain version |
|
||||
| ------------------ | ------------------------------------------- |
|
||||
| Linux | gcc 13.2.0 |
|
||||
| macOS | Apple Xcode 14.3.1 (using clang 14.0.3) |
|
||||
| Windows | Microsoft Visual Studio 2022 version 17.6.5 |
|
||||
| Operating system | Toolchain version |
|
||||
| ------------------ | -------------------------------------------- |
|
||||
| Linux | gcc 14.2.0 |
|
||||
| macOS | Apple Xcode 15.4 (using clang 15.0.0) |
|
||||
| Windows | Microsoft Visual Studio 2022 version 17.13.2 |
|
||||
|
||||
All compilers are expected to be able to handle the C11 language standard for
|
||||
C, and C++14 for C++.
|
||||
@ -406,7 +426,7 @@ C, and C++14 for C++.
|
||||
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
|
||||
The JDK is currently known to compile successfully with gcc version 14.2 or
|
||||
newer.
|
||||
|
||||
In general, any version between these two should be usable.
|
||||
@ -682,9 +702,9 @@ At least version 3.2 of GNU Bash must be used.
|
||||
|
||||
### Graphviz and Pandoc
|
||||
|
||||
In order to build the full docs (see the `--enable-full-docs`
|
||||
configure option) [Graphviz](https://www.graphviz.org) and
|
||||
[Pandoc](https://pandoc.org) are required. Any recent versions should
|
||||
In order to build man pages and the full docs (see the `--enable-full-docs`
|
||||
configure option) [Pandoc](https://pandoc.org) is required. For full docs also
|
||||
[Graphviz](https://www.graphviz.org) is required. Any recent versions should
|
||||
work. For reference, and subject to change, Oracle builds use Graphviz
|
||||
9.0.0 and Pandoc 2.19.2.
|
||||
|
||||
@ -1238,11 +1258,11 @@ toolchain and a sysroot environment which can easily be used together with the
|
||||
following command:
|
||||
|
||||
```
|
||||
bash configure --with-devkit=<devkit-path> --openjdk-target=ppc64-linux-gnu && make
|
||||
bash configure --with-devkit=<devkit-path> --openjdk-target=ppc64le-linux-gnu && make
|
||||
```
|
||||
|
||||
will configure and build the JDK for Linux/ppc64 assuming that `<devkit-path>`
|
||||
points to a Linux/x86_64 to Linux/ppc64 devkit.
|
||||
will configure and build the JDK for Linux/ppc64le assuming that `<devkit-path>`
|
||||
points to a Linux/x86_64 to Linux/ppc64le devkit.
|
||||
|
||||
Devkits can be created from the `make/devkit` directory by executing:
|
||||
|
||||
@ -1261,16 +1281,14 @@ at least the following targets are known to work:
|
||||
| x86_64-linux-gnu |
|
||||
| aarch64-linux-gnu |
|
||||
| arm-linux-gnueabihf |
|
||||
| ppc64-linux-gnu |
|
||||
| ppc64le-linux-gnu |
|
||||
| riscv64-linux-gnu |
|
||||
| s390x-linux-gnu |
|
||||
|
||||
`BASE_OS` must be one of "OEL6" for Oracle Enterprise Linux 6 or "Fedora" (if
|
||||
not specified "OEL6" will be the default). If the base OS is "Fedora" the
|
||||
corresponding Fedora release can be specified with the help of the
|
||||
`BASE_OS_VERSION` option (with "27" as default version). If the build is
|
||||
successful, the new devkits can be found in the `build/devkit/result`
|
||||
subdirectory:
|
||||
`BASE_OS` must be one of `OL` for Oracle Enterprise Linux or `Fedora`. If the
|
||||
base OS is `Fedora` the corresponding Fedora release can be specified with the
|
||||
help of the `BASE_OS_VERSION` option. If the build is successful, the new
|
||||
devkits can be found in the `build/devkit/result` subdirectory:
|
||||
|
||||
```
|
||||
cd make/devkit
|
||||
@ -1459,6 +1477,24 @@ sh ./configure --with-jvm-variants=server \
|
||||
|
||||
and run `make` normally.
|
||||
|
||||
#### Building for Windows AArch64
|
||||
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.
|
||||
|
||||
## Build Performance
|
||||
|
||||
Building the JDK requires a lot of horsepower. Some of the build tools can be
|
||||
@ -1800,9 +1836,17 @@ temporarily.
|
||||
On Windows, when configuring, `fixpath.sh` may report that some directory names
|
||||
have spaces. Usually, it assumes those directories have [short
|
||||
paths](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-8dot3name).
|
||||
You can run `fsutil file setshortname` in `cmd` on certain directories, such as
|
||||
`Microsoft Visual Studio` or `Windows Kits`, to assign arbitrary short paths so
|
||||
`configure` can access them.
|
||||
You can run `fsutil file setshortname` in `cmd` on directories to assign
|
||||
arbitrary short paths so `configure` can access them. If the result says "Access
|
||||
denied", it may be that there are processes running in that directory; in this
|
||||
case, you can reboot Windows in safe mode and run the command on those directories
|
||||
again.
|
||||
|
||||
The only directories required to have short paths are `Microsoft Visual Studio`
|
||||
and `Windows Kits`; the rest of the "contains space" warnings from `configure`,
|
||||
such as `IntelliJ IDEA`, can be ignored. You can choose any short name; once it
|
||||
is set, `configure`'s tools like `cygpath` can convert the directory with spaces
|
||||
to your chosen short name and pass it to the build system.
|
||||
|
||||
### Getting Help
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -8,6 +8,24 @@ HotSpot code, making it easier to read and maintain. Failure to
|
||||
follow these guidelines may lead to discussion during code reviews, if
|
||||
not outright rejection of a change.
|
||||
|
||||
### Changing this Document
|
||||
|
||||
Proposed changes should be discussed on the
|
||||
[HotSpot Developers](mailto:hotspot-dev@openjdk.org) 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](https://www.rfc-editor.org/rfc/rfc7282.html) of
|
||||
the [HotSpot Group](https://openjdk.org/census#hotspot) 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.
|
||||
|
||||
### Why Care About Style?
|
||||
|
||||
Some programmers seem to have lexers and even C preprocessors
|
||||
@ -38,7 +56,7 @@ reformatting the whole thing. Also consider separating changes that
|
||||
make extensive stylistic updates from those which make functional
|
||||
changes.
|
||||
|
||||
### Counterexamples and Updates
|
||||
### Counterexamples
|
||||
|
||||
Many of the guidelines mentioned here have (sometimes widespread)
|
||||
counterexamples in the HotSpot code base. Finding a counterexample is
|
||||
@ -54,22 +72,6 @@ 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](mailto:hotspot-dev@openjdk.org) 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](https://www.rfc-editor.org/rfc/rfc7282.html) of
|
||||
the [HotSpot Group](https://openjdk.org/census#hotspot) 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.
|
||||
|
||||
## Structure and Formatting
|
||||
|
||||
### Factoring and Class Design
|
||||
@ -133,11 +135,34 @@ lines of code. Name what you must repeat.
|
||||
change should be done with a "setter" accessor matched to the simple
|
||||
"getter".
|
||||
|
||||
#### Conventions for Lock-free Code
|
||||
|
||||
Sometimes variables are accessed concurrently without appropriate synchronization
|
||||
context, such as a held mutex or at a safepoint. In such cases the variable should
|
||||
be declared `volatile` and it should NOT be accessed as a normal C++ lvalue. Rather,
|
||||
access should be performed via functions from `Atomic`, such as `Atomic::load`,
|
||||
`Atomic::store`, etc.
|
||||
|
||||
This special formulation makes it more clear to maintainers that the variable is
|
||||
accessed concurrently in a lock-free manner.
|
||||
|
||||
### Source Files
|
||||
|
||||
* All source files must have a globally unique basename. The build
|
||||
* All source files must have a globally unique basename. The build
|
||||
system depends on this uniqueness.
|
||||
|
||||
* Keep the include lines within a section alphabetically sorted by their
|
||||
lowercase value. If an include must be out of order for correctness,
|
||||
suffix with it a comment such as `// do not reorder`. Source code
|
||||
processing tools can also use this hint.
|
||||
|
||||
* Put conditional inclusions (`#if ...`) at the end of the section of HotSpot
|
||||
include lines. This also applies to macro-expanded includes of platform
|
||||
dependent files.
|
||||
|
||||
* Put system includes in a section after the HotSpot include lines with a blank
|
||||
line separating the two sections.
|
||||
|
||||
* Do not put non-trivial function implementations in .hpp files. If
|
||||
the implementation depends on other .hpp files, put it in a .cpp or
|
||||
a .inline.hpp file.
|
||||
@ -146,18 +171,22 @@ a .inline.hpp file.
|
||||
files.
|
||||
|
||||
* All .inline.hpp files should include their corresponding .hpp file as
|
||||
the first include line. Declarations needed by other files should be put
|
||||
in the .hpp file, and not in the .inline.hpp file. This rule exists to
|
||||
resolve problems with circular dependencies between .inline.hpp files.
|
||||
the first include line with a blank line separating it from the rest of the
|
||||
include lines. Declarations needed by other files should be put in the .hpp
|
||||
file, and not in the .inline.hpp file. This rule exists to resolve problems
|
||||
with circular dependencies between .inline.hpp files.
|
||||
|
||||
* All .cpp files include precompiled.hpp as the first include line.
|
||||
* Do not include a .hpp file if the corresponding .inline.hpp file is included.
|
||||
|
||||
* precompiled.hpp is just a build time optimization, so don't rely on
|
||||
it to resolve include problems.
|
||||
* Use include guards for .hpp and .inline.hpp files. The name of the defined
|
||||
guard should be derived from the full search path of the file relative to the
|
||||
hotspot source directory. The guard should be all upper case with all paths
|
||||
separators and periods replaced by underscores.
|
||||
|
||||
* Keep the include lines alphabetically sorted.
|
||||
|
||||
* Put conditional inclusions (`#if ...`) at the end of the include list.
|
||||
* Some build configurations use precompiled headers to speed up the
|
||||
build times. The precompiled headers are included in the precompiled.hpp
|
||||
file. Note that precompiled.hpp is just a build time optimization, so
|
||||
don't rely on it to resolve include problems.
|
||||
|
||||
### JTReg Tests
|
||||
|
||||
@ -348,20 +377,22 @@ adjust new lines horizontally to be consistent with that
|
||||
organization. (E.g., trailing backslashes on long macro definitions
|
||||
often align.)
|
||||
|
||||
### Avoid implicit conversions to bool
|
||||
|
||||
* Use `bool` for boolean values.
|
||||
* Do not use ints or pointers as (implicit) booleans with `&&`, `||`,
|
||||
`if`, `while`. Instead, compare explicitly, i.e. `if (x != 0)` or
|
||||
`if (ptr != nullptr)`, etc.
|
||||
* Do not use non-boolean declarations in _condition_ forms, i.e. don't use
|
||||
`if (T v = value) { ... }`. But see
|
||||
[Enhanced selection statements](#enhanced-selection-statements).
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
* Use the [Resource Acquisition Is Initialization][RAII] (RAII)
|
||||
design pattern to manage bracketed critical
|
||||
sections. See class `ResourceMark` for an example.
|
||||
|
||||
* Avoid implicit conversions to `bool`.
|
||||
* Use `bool` for boolean values.
|
||||
* Do not use ints or pointers as (implicit) booleans with `&&`, `||`,
|
||||
`if`, `while`. Instead, compare explicitly, i.e. `if (x != 0)` or
|
||||
`if (ptr != nullptr)`, etc.
|
||||
* Do not use declarations in _condition_ forms, i.e. don't use
|
||||
`if (T v = value) { ... }`.
|
||||
|
||||
* Use functions from globalDefinitions.hpp and related files when
|
||||
performing bitwise
|
||||
operations on integers. Do not code directly as C operators, unless
|
||||
@ -373,18 +404,17 @@ they are extremely simple. (Examples: `align_up`, `is_power_of_2`,
|
||||
* Always enumerate all cases in a switch statement or provide a default
|
||||
case. It is ok to have an empty default with comment.
|
||||
|
||||
|
||||
## Use of C++ Features
|
||||
|
||||
HotSpot was originally written in a subset of the C++98/03 language.
|
||||
More recently, support for C++14 is provided, though again,
|
||||
More recently, support for C++17 is provided, though again,
|
||||
HotSpot only uses a subset. (Backports to JDK versions lacking
|
||||
support for more recent Standards must of course stick with the
|
||||
original C++98/03 subset.)
|
||||
|
||||
This section describes that subset. Features from the C++98/03
|
||||
language may be used unless explicitly excluded here. Features from
|
||||
C++11 and C++14 may be explicitly permitted or explicitly excluded,
|
||||
C++11, C++14, and C++17 may be explicitly permitted or explicitly excluded,
|
||||
and discussed accordingly here. There is a third category, undecided
|
||||
features, about which HotSpot developers have not yet reached a
|
||||
consensus, or perhaps have not discussed at all. Use of these
|
||||
@ -399,9 +429,9 @@ more extensive discussion or rationale for limitations. Features that
|
||||
don't have their own subsection are listed in omnibus feature sections
|
||||
for permitted, excluded, and undecided features.
|
||||
|
||||
Lists of new features for C++11 and C++14, along with links to their
|
||||
Lists of new features for C++11, C++14, and C++17, along with links to their
|
||||
descriptions, can be found in the online documentation for some of the
|
||||
compilers and libraries. The C++14 Standard is the definitive
|
||||
compilers and libraries. The C++17 Standard is the definitive
|
||||
description.
|
||||
|
||||
* [C++ Standards Support in GCC](https://gcc.gnu.org/projects/cxx-status.html)
|
||||
@ -606,13 +636,40 @@ For local variables, this can be used to make the code clearer by
|
||||
eliminating type information that is obvious or irrelevant. Excessive
|
||||
use can make code much harder to understand.
|
||||
|
||||
* `auto` for non-type template parameters
|
||||
([p0127r2](http://wg21.link/p0127r2))<br>
|
||||
`auto` may be used as a placeholder for the type of a non-type template
|
||||
parameter. The type is deduced from the value provided in a template
|
||||
instantiation.
|
||||
|
||||
* Function return type deduction
|
||||
([n3638](https://isocpp.org/files/papers/N3638.html))<br>
|
||||
Only use if the function body has a very small number of `return`
|
||||
statements, and generally relatively little other code.
|
||||
|
||||
* Class template argument deduction
|
||||
([n3602](http://wg21.link/n3602), [p0091r3](http://wg21.link/p0091r3))<br>
|
||||
The template arguments of a class template may be deduced from the arguments
|
||||
to a constructor. This is similar to ordinary function argument deduction,
|
||||
though partial deduction with only _some_ template arguments explicitly
|
||||
provided is not permitted for class template argument deduction. Deduction
|
||||
guides may be used to provide additional control over the deduction. As with
|
||||
`auto` variable declarations, excessive use can make code harder to
|
||||
understand, because explicit type information is lacking. But it can also
|
||||
remove the need to be explicit about types that are either obvious, or that
|
||||
are very hard to write. For example, these allow the addition of a scope-guard
|
||||
mechanism with nice syntax; something like this
|
||||
```
|
||||
ScopeGuard guard{[&]{ ... cleanup code ... }};
|
||||
```
|
||||
|
||||
* Also see [lambda expressions](#lambdaexpressions).
|
||||
|
||||
* `decltype(auto)` should be avoided, whether for variables, for non-type
|
||||
template parameters, or for function return types. There are subtle and
|
||||
complex differences between this placeholder type and `auto`. Any use would
|
||||
need very careful explanation.
|
||||
|
||||
### Expression SFINAE
|
||||
|
||||
[Substitution Failure Is Not An Error][SFINAE] (SFINAE)
|
||||
@ -634,6 +691,16 @@ Here are a few closely related example bugs:<br>
|
||||
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95468><br>
|
||||
<https://developercommunity.visualstudio.com/content/problem/396562/sizeof-deduced-type-is-sometimes-not-a-constant-ex.html>
|
||||
|
||||
### Non-type template parameter values
|
||||
|
||||
C++17 extended the arguments permitted for non-type template parameters
|
||||
([n4268](http://wg21.link/n4268)). The kinds of values (the parameter types)
|
||||
aren't changed. However, the values can now be the result of arbitrary
|
||||
constant expressions (with a few restrictions on the result), rather than a
|
||||
much more limited and restrictive set of expressions. In particular, the
|
||||
argument for a pointer or reference type parameter can now be the result of a
|
||||
constexpr function.
|
||||
|
||||
### enum
|
||||
|
||||
Where appropriate, _scoped-enums_ should be used.
|
||||
@ -752,6 +819,58 @@ ordering, which may differ from (may be stronger than) sequentially
|
||||
consistent. There are algorithms in HotSpot that are believed to rely
|
||||
on that ordering.
|
||||
|
||||
### Inline Variables
|
||||
|
||||
Variables with static storage duration may be declared `inline`
|
||||
([p0386r2](https://wg21.link/p0386r2)). This has similar effects as for
|
||||
declaring a function inline: it can be defined, identically, in multiple
|
||||
translation units, must be defined in every translation unit in which it is
|
||||
[ODR used][ODR], and the behavior of the program is as if there is exactly one
|
||||
variable.
|
||||
|
||||
Declaring a variable inline allows the complete definition to be in a header
|
||||
file, rather than having a declaration in a header and the definition in a
|
||||
.cpp file. The guidance on
|
||||
[initialization](#initializing-variables-with-static-storage-duration) of such
|
||||
variables still applies. Inline variables with dynamic initializations can
|
||||
make initialization order problems worse. The few ordering constraints
|
||||
that exist for non-inline variables don't apply, as there isn't a single
|
||||
program-designated translation unit containing the definition.
|
||||
|
||||
A `constexpr` static data member is implicitly `inline`. As a consequence, an
|
||||
[ODR use][ODR] of such a variable doesn't require a definition in some .cpp
|
||||
file. (This is a change from pre-C++17. Beginning with C++17, such a
|
||||
definition is considered a duplicate definition, and is deprecated.)
|
||||
|
||||
Declaring a `thread_local` variable `inline` is forbidden for HotSpot code.
|
||||
[The use of `thread_local`](#thread_local) is already heavily restricted.
|
||||
|
||||
### Initializing variables with static storage duration
|
||||
|
||||
Variables with static storage duration and _dynamic initialization_
|
||||
[C++14 3.6.2](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf)).
|
||||
should be avoided, unless an implementation is permitted to perform the
|
||||
initialization as a static initialization. The order in which dynamic
|
||||
initializations occur is incompletely specified. Initialization order
|
||||
problems can be difficult to deal with and lead to surprises.
|
||||
|
||||
Variables with static storage duration and non-trivial destructors should be
|
||||
avoided. HotSpot doesn't generally try to cleanup on exit, and running
|
||||
destructors at exit can lead to problems.
|
||||
|
||||
Some of the approaches used in HotSpot to avoid dynamic initialization
|
||||
include:
|
||||
|
||||
* Use the `Deferred<T>` class template. Add a call to its initialization
|
||||
function at an appropriate place during VM initialization. The underlying
|
||||
object is never destroyed.
|
||||
|
||||
* For objects of class type, use a variable whose value is a pointer to the
|
||||
class, initialized to `nullptr`. Provide an initialization function that sets
|
||||
the variable to a dynamically allocated object. Add a call to that function at
|
||||
an appropriate place during VM initialization. Such objects are usually never
|
||||
destroyed.
|
||||
|
||||
### Uniform Initialization
|
||||
|
||||
The use of _uniform initialization_
|
||||
@ -769,6 +888,53 @@ Some relevant sections from cppreference.com:
|
||||
Although related, the use of `std::initializer_list` remains forbidden, as
|
||||
part of the avoidance of the C++ Standard Library in HotSpot code.
|
||||
|
||||
### Mandatory Copy Elision
|
||||
|
||||
[Copy elision](https://en.wikipedia.org/wiki/Copy_elision)
|
||||
(or [here](https://cn.cppreference.com/w/cpp/language/copy_elision.html))
|
||||
is a compiler optimization used to avoid potentially expensive copies in
|
||||
certain situations. It is critical to making practical the performance of
|
||||
return by value or pass by value. It is also unusual in not following the
|
||||
as-if rule for optimizations - copy elision can be applied even if doing so
|
||||
bypasses side-effects of copying/moving the object. The C++ standard
|
||||
explicitly permits this.
|
||||
|
||||
However, because it's an optional optimization, the relevant copy/move
|
||||
constructor must be available and accessible, in case the compiler chooses to
|
||||
not apply the optimization even in a situation where permitted.
|
||||
|
||||
C++17 changed some cases of copy elision so that there is never a copy/move in
|
||||
these cases ([p0135r1](http://wg21.link/p0135r1)). The interesting cases
|
||||
involve a function that returns an unnamed temporary object, and constructors.
|
||||
In such cases the object being initialized from the temporary is always direct
|
||||
initialized, with no copy/move ever involved; see [RVO] and more specifically
|
||||
[URVO].
|
||||
|
||||
Since this is now standard behavior it can't be avoided in the covered
|
||||
situations. This could change the behavior of code that relied on side effects
|
||||
by constructors, but that's both uncommon and was already problematic because
|
||||
of the previous optional copy elision. But HotSpot code can, and should,
|
||||
explicitly take advantage of this newly required behavior where it makes sense
|
||||
to do so.
|
||||
|
||||
For example, it may be beneficial to delay construction of the result of a
|
||||
function until the return statement, rather than having a local variable that
|
||||
is modified into the desired state and then returned. (Though [NRVO] may apply
|
||||
in that case.)
|
||||
|
||||
It is also now possible to define a factory function for a class that is
|
||||
neither movable nor copyable, if it can be written in a way that makes use of
|
||||
this feature.
|
||||
|
||||
[RVO]: https://en.wikipedia.org/wiki/Copy_elision#RVO
|
||||
"Return Value Optimization"
|
||||
|
||||
[NRVO]: https://en.wikipedia.org/wiki/Copy_elision#NRVO
|
||||
"Named Return Value Optimization"
|
||||
|
||||
[URVO]: https://cn.cppreference.com/w/cpp/language/copy_elision.html
|
||||
"Unnamed Return Value Optimization"
|
||||
|
||||
### Local Function Objects
|
||||
|
||||
* Local function objects, including lambda expressions, may be used.
|
||||
@ -837,6 +1003,12 @@ Another use for local functions is [partial application][PARTIALAPP]. Again
|
||||
here, lambdas are typically much simpler and less verbose than function
|
||||
object classes.
|
||||
|
||||
A lambda is a constexpr function if either the parameter declaration clause is
|
||||
followed by `constexpr`, or it satisfies the requirements for a constexpr
|
||||
function ([p0170r1]). Thus, using a lambda to package up some computation
|
||||
doesn't incur unnecessary overhead or prevent use in a context required to be
|
||||
compile-time evaluated (such as an array size).
|
||||
|
||||
Because of these benefits, lambda expressions are permitted in HotSpot code,
|
||||
with some restrictions and usage guidance. An anonymous lambda is one which
|
||||
is passed directly as an argument. A named lambda is the value of a
|
||||
@ -888,6 +1060,17 @@ the most part they don't apply to HotSpot code, given other usage restrictions.
|
||||
applies to captured auto variables, not member variables, and is
|
||||
inconsistent with referential transparency.
|
||||
|
||||
* By-value capture of `this` (using a capture list like `[*this]` ([p0018r3]))
|
||||
is also not permitted. One of the motivating use-cases is when the lifetime of
|
||||
the lambda exceeds the lifetime of the object for the containing member
|
||||
function. That is, we have an upward lambda that is capturing `this` of the
|
||||
enclosing method. But again, that use-case doesn't apply if only downward
|
||||
lambdas are used.
|
||||
Another use-case is when we simply want the lambda to be operating on a copy
|
||||
of `this` for some reason. This is sufficiently uncommon that it can be
|
||||
handled by manual copying, so readers don't need to understand this rare
|
||||
syntax.
|
||||
|
||||
* Non-capturing lambdas (with an empty capture list - `[]`) have limited
|
||||
utility. There are cases where no captures are required (pure functions,
|
||||
for example), but if the function is small and simple then that's obvious
|
||||
@ -897,7 +1080,7 @@ anyway.
|
||||
Capture initializers inherently increase the complexity of the capture list,
|
||||
and provide little benefit over an additional in-scope local variable.
|
||||
|
||||
The use of `mutable` lambda expressions is forbidden because there don't
|
||||
* The use of `mutable` lambda expressions is forbidden because there don't
|
||||
seem to be many, if any, good use-cases for them in HotSpot. A lambda
|
||||
expression needs to be mutable in order to modify a by-value captured value.
|
||||
But with only downward lambdas, such usage seems likely to be rare and
|
||||
@ -1044,21 +1227,12 @@ Do not use _inheriting constructors_
|
||||
C++11 provides simple syntax allowing a class to inherit the constructors of a
|
||||
base class. Unfortunately there are a number of problems with the original
|
||||
specification, and C++17 contains significant revisions ([p0136r1] opens with
|
||||
a list of 8 Core Issues). Since HotSpot doesn't support use of C++17, use of
|
||||
inherited constructors could run into those problems. Such uses might also
|
||||
change behavior in a future HotSpot update to use C++17 or later, potentially
|
||||
in subtle ways that could lead to hard to diagnose problems. Because of this,
|
||||
HotSpot code must not use inherited constructors.
|
||||
a list of 8 Core Issues). Although those issues have been addressed, the
|
||||
benefits from this feature are small compared to the complexity. Because of
|
||||
this, HotSpot code must not use inherited constructors.
|
||||
|
||||
Note that gcc7 provides the `-fnew-inheriting-ctors` option to use the
|
||||
[p0136r1] semantics. This is enabled by default when using C++17 or later.
|
||||
It is also enabled by default for `fabi-version=11` (introduced by gcc7) or
|
||||
higher when using C++11/14, as the change is considered a Defect Report that
|
||||
applies to those versions. Earlier versions of gcc don't have that option,
|
||||
and other supported compilers may not have anything similar.
|
||||
|
||||
[p0136r1]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0136r1.html
|
||||
"p0136r1"
|
||||
[p0136r1]: http:/wg21.link/p0136r1 "p0136r1"
|
||||
[p0195r0](http://wg21.link/p0195r0)
|
||||
|
||||
### Attributes
|
||||
|
||||
@ -1077,15 +1251,160 @@ preferred location.
|
||||
function's declaration, rather than between the function name and the parameter
|
||||
list.
|
||||
|
||||
[p0068r0](http://wg21.link/p0068r0) is the initial proposal for the attributes
|
||||
added by C++17.)
|
||||
|
||||
Only the following attributes are permitted:
|
||||
|
||||
* `[[noreturn]]`
|
||||
* `[[nodiscard]]` ([p0189r1](http://wg21.link/p0189r1))
|
||||
* `[[maybe_unused]]` ([p0212r1](http://wg21.link/p0212r1))
|
||||
* `[[fallthrough]]` ([p0188r1](http://wg21.link/p0188))
|
||||
|
||||
The following attributes are expressly forbidden:
|
||||
|
||||
* `[[carries_dependency]]` - Related to `memory_order_consume`.
|
||||
* `[[deprecated]]` - Not relevant in HotSpot code.
|
||||
|
||||
Direct use of non-standard (and presumably scoped) attributes in shared code
|
||||
is also forbidden. Using such would depend on the C++17 feature that an
|
||||
attribute not recognized by the implementation is ignored
|
||||
([p0283r2](http://wg21.link/p0283r2)). If such an attribute is needed in
|
||||
shared code, the well-established technique of providing an `ATTRIBUTE_XXX`
|
||||
macro with per-compiler definitions (sometimes empty) should be
|
||||
used. Compilers may warn about unrecognized attributes (whether by name or by
|
||||
location), in order to report typos or misuse. Disabling such warnings
|
||||
globally would not be desirable.
|
||||
|
||||
The use of `using` directives in attribute lists is also forbidden.
|
||||
([p0028r0](http://wg21.link/p0028r0))
|
||||
([p0028r4](http://wg21.link/p0028r4))
|
||||
We don't generally use scoped attributes in attribute lists with other
|
||||
attributes. Rather, uses of scoped attributes (which are implementation
|
||||
defined) are generally hidden behind a portability macro that includes the
|
||||
surrounding brackets.
|
||||
|
||||
### noexcept
|
||||
|
||||
Use of `noexcept` exception specifications
|
||||
([n3050](http://wg21.link/n3050))
|
||||
are permitted with restrictions described below.
|
||||
|
||||
* Only the argument-less form of `noexcept` exception specifications are
|
||||
permitted.
|
||||
* Allocation functions that may return `nullptr` to indicate allocation
|
||||
failure must be declared `noexcept`.
|
||||
* All other uses of `noexcept` exception specifications are forbidden.
|
||||
* `noexcept` expressions are forbidden.
|
||||
* Dynamic exception specifications are forbidden.
|
||||
|
||||
HotSpot is built with exceptions disabled, e.g. compile with `-fno-exceptions`
|
||||
(gcc, clang) or no `/EH` option (MSVC++). So why do we need to consider
|
||||
`noexcept` at all? It's because `noexcept` exception specifications serve two
|
||||
distinct purposes.
|
||||
|
||||
The first is to allow the compiler to avoid generating code or data in support
|
||||
of exceptions being thrown by a function. But this is unnecessary, because
|
||||
exceptions are disabled.
|
||||
|
||||
The second is to allow the compiler and library code to choose different
|
||||
algorithms, depending on whether some function may throw exceptions. This is
|
||||
only relevant to a certain set of functions.
|
||||
|
||||
* Some allocation functions (`operator new` and `operator new[]`) return
|
||||
`nullptr` to indicate allocation failure. If a `new` expression calls such an
|
||||
allocation function, it must check for and handle that possibility. Declaring
|
||||
such a function `noexcept` informs the compiler that `nullptr` is a possible
|
||||
result. If an allocation function is not declared `noexcept` then the compiler
|
||||
may elide that checking and handling for a `new` expression calling that
|
||||
function.
|
||||
|
||||
* Certain Standard Library facilities (notably containers) provide different
|
||||
guarantees for some operations (and may choose different algorithms to
|
||||
implement those operations), depending on whether certain functions
|
||||
(constructors, copy/move operations, swap) are nothrow or not. They detect
|
||||
this using type traits that test whether a function is declared `noexcept`.
|
||||
This can have a significant performance impact if, for example, copying is
|
||||
chosen over a potentially throwing move. But this isn't relevant, since
|
||||
HotSpot forbids the use of most Standard Library facilities.
|
||||
|
||||
HotSpot code can assume no exceptions will ever be thrown, even from functions
|
||||
not declared `noexcept`. So HotSpot code doesn't ever need to check, either
|
||||
with conditional exception specifications or with `noexcept` expressions.
|
||||
|
||||
The exception specification is part of the type of a function
|
||||
([p0012r1](http://wg21.link/p0012r1). This likely has little impact on HotSpot
|
||||
code, since the use of `noexcept` is expected to be rare.
|
||||
|
||||
Dynamic exception specifications were deprecated in C++11. C++17 removed all
|
||||
but `throw()`, with that remaining a deprecated equivalent to `noexcept`.
|
||||
|
||||
### Enhanced selection statements
|
||||
|
||||
C++17 modified the _condition_ part of `if` and `switch` statements, permitting
|
||||
an _init-statement_ to be included
|
||||
([p0305r1](http://wg21.link/p0305r1)).
|
||||
|
||||
Use of this feature is permitted. (However, complex uses may interfere with
|
||||
readability.) Limiting the scope of a variable involved in the condition,
|
||||
while also making the value available to the statement's body, can improve
|
||||
readability. The alternative method of scope-limiting by introducing a nested
|
||||
scope isn't very popular and is rarely used.
|
||||
|
||||
This new syntax is in addition to the _condition_ being a declaration with a
|
||||
_brace-or-equal-initializer_. For an `if` statement this new sytax gains that
|
||||
benefit without violating the long-standing guidance against using
|
||||
[implicit conversions to `bool`](#avoid-implicit-conversions-to-bool),
|
||||
which still stands.
|
||||
|
||||
For example, uses of Unified Logging sometimes explicitly check whether a
|
||||
`LogTarget` is enabled. Instead of
|
||||
```
|
||||
LogTarget(...) lt;
|
||||
if (lt.is_enabled()) {
|
||||
LogStream log(lt);
|
||||
... use log ...
|
||||
}
|
||||
... lt is accessible but probably not needed here ...
|
||||
```
|
||||
using this feature one could write
|
||||
```
|
||||
if (LogTarget(...) lt; lt.is_enabled()) {
|
||||
LogStream log(lt);
|
||||
... use log ...
|
||||
}
|
||||
```
|
||||
|
||||
C++17 also added compile-time `if` statements
|
||||
([p0292r2](http://wg21.link/p0292r2)). Use of `if constexpr` is
|
||||
permitted. This feature can replace and (sometimes vastly) simplify many uses
|
||||
of [SFINAE]. The same declaration and initialization guidance for the
|
||||
_condition_ part apply here as for ordinary `if` statements.
|
||||
|
||||
### Expression Evaluation Order
|
||||
|
||||
C++17 tightened up the evaluation order for some kinds of subexpressions
|
||||
([p0138r2](http://wg21.link/p0138r2)). Note, however, that the Alternate
|
||||
Evaluation Order for Function Calls alternative in that paper was adopted,
|
||||
rather than the strict left to right order of evaluation for function call
|
||||
arguments that was proposed in the main body of the paper.
|
||||
|
||||
The primary purpose of this change seems to be to make certain kinds of call
|
||||
chaining well defined. That's not a style widely used in HotSpot. In general
|
||||
it is better to continue to avoid questions in this area by isolating
|
||||
operations with side effects from other statements. In particular, continue to
|
||||
avoid modifying a value in an expression where it is also used.
|
||||
|
||||
### Compatibility with C11
|
||||
|
||||
C++17 refers to C11 rather than C99. This means that C11 libraries and
|
||||
functions may be used in HotSpot. There may be limitations because of
|
||||
differing levels of compatibility among various compilers and versions of
|
||||
those compilers.
|
||||
|
||||
Note that the C parts of the JDK have been built with C11 selected for some
|
||||
time ([JDK-8292008](https://bugs.openjdk.org/browse/JDK-8292008)).
|
||||
|
||||
### Additional Permitted Features
|
||||
|
||||
* `alignof`
|
||||
@ -1103,7 +1422,10 @@ The following attributes are expressly forbidden:
|
||||
([n2555](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf))
|
||||
|
||||
* Static assertions
|
||||
([n1720](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html))
|
||||
([n1720](http://wg21.link/n1720))
|
||||
([n3928](http://wg21.link/n3928))<br>
|
||||
Both the original (C++11) two-argument form and the new (C++17)
|
||||
single-argument form are permitted.
|
||||
|
||||
* `decltype`
|
||||
([n2343](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf))
|
||||
@ -1150,7 +1472,72 @@ The following attributes are expressly forbidden:
|
||||
* Unrestricted Unions
|
||||
([n2544](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf))
|
||||
|
||||
### Excluded Features
|
||||
* Preprocessor Condition `__has_include`
|
||||
([p0061r0](http://wg21.link/p0061r0))
|
||||
([p0061r1](http://wg21.link/p0061r1))
|
||||
|
||||
* Hexadecimal Floating-Point Literals
|
||||
([p0245r1](http://wg21.link/p0245r1))
|
||||
|
||||
* Construction Rules for `enum class` Values
|
||||
([p0138r2](http://wg21.link/p0138r2))
|
||||
|
||||
* Allow `typename` in template template parameter
|
||||
([n4051](http://wg21.link/n4051)) — template template parameters are
|
||||
barely used (if at all) in HotSpot, but there's no reason to artificially
|
||||
disallow this syntactic regularization in any such uses.
|
||||
|
||||
## Excluded Features
|
||||
|
||||
### Structured Bindings
|
||||
|
||||
The use of structured bindings [p0217r3](http://wg21.link/p0217r3) is
|
||||
forbidden. Preferred approaches for handling functions with multiple return
|
||||
values include
|
||||
|
||||
* Return a named class/struct intended for that purpose, with named and typed
|
||||
members/accessors.
|
||||
|
||||
* Return a value along with out parameters (usually pointers, sometimes
|
||||
references).
|
||||
|
||||
* Designate a sentinel "failure" value in the normal return value type, with
|
||||
some out of band location for additional information. For example, this is
|
||||
the model typically used with `errno`, where a function returns a normal
|
||||
result, or -1 to indicate an error, with additional error information in
|
||||
`errno`.
|
||||
|
||||
There is a strong preference for names and explicit types, as opposed to
|
||||
offsets and implicit types. For example, there are folks who strongly dislike
|
||||
that some of the Standard Library functions return `std::pair` because `first`
|
||||
and `second` members don't carry any useful information.
|
||||
|
||||
### File System Library
|
||||
|
||||
The use of the File System library is forbidden. HotSpot doesn't do very much
|
||||
with files, and already has adequate mechanisms for its needs. Rewriting in
|
||||
terms of this new library doesn't provide any obviously significant
|
||||
benefits. Having a mix of the existing usage and uses of this new library
|
||||
would be confusing.
|
||||
|
||||
[n4100](http://wg21.link/n4100)
|
||||
[p0218r0](http://wg21.link/p0218r0)
|
||||
[p0219r1](http://wg21.link/p0219r1)
|
||||
[p0317r1](http://wg21.link/p0317r1)
|
||||
[p0392r0](http://wg21.link/p0392r0)
|
||||
[p0430r2](http://wg21.link/p0430r2)
|
||||
[p0492r2](http://wg21.link/p0492r2)
|
||||
[p1164r1](http://wg21.link/p1164r1)
|
||||
|
||||
### Aggregate Extensions
|
||||
|
||||
Aggregates with base classes are forbidden. C++17 allows aggregate
|
||||
initialization for classes with base classes
|
||||
([p0017r1](https://wg21.link/p0017r1)). HotSpot makes very little use of
|
||||
aggregate classes, preferring explicit constructors even for very simple
|
||||
classes.
|
||||
|
||||
### Additional Excluded Features
|
||||
|
||||
* New string and character literals
|
||||
* New character types
|
||||
@ -1181,39 +1568,286 @@ namespace std;` to avoid needing to qualify Standard Library names.
|
||||
([n2179](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html)) —
|
||||
HotSpot does not permit the use of exceptions, so this feature isn't useful.
|
||||
|
||||
* Avoid non-local variables with non-constexpr initialization.
|
||||
In particular, avoid variables with types requiring non-trivial
|
||||
initialization or destruction. Initialization order problems can be
|
||||
difficult to deal with and lead to surprises, as can destruction
|
||||
ordering. HotSpot doesn't generally try to cleanup on exit, and
|
||||
running destructors at exit can also lead to problems.
|
||||
|
||||
* Avoid most operator overloading, preferring named functions. When
|
||||
operator overloading is used, ensure the semantics conform to the
|
||||
normal expected behavior of the operation.
|
||||
|
||||
* Avoid most implicit conversion constructors and (implicit or explicit)
|
||||
conversion operators. (Note that conversion to `bool` isn't needed
|
||||
in HotSpot code because of the "no implicit boolean" guideline.)
|
||||
conversion operators. Conversion to `bool` operators aren't needed
|
||||
because of the
|
||||
[no implicit boolean](#avoid-implicit-conversions-to-bool)
|
||||
guideline.)
|
||||
|
||||
* Avoid `goto` statements.
|
||||
|
||||
### Undecided Features
|
||||
* Attributes for namespaces and enumerators
|
||||
([n4266](http://wg21.link/n4266) —
|
||||
The only applicable attribute is [`[[deprecated]]`](#attributes), which is
|
||||
forbidden.
|
||||
|
||||
* Variadic `using` declarations
|
||||
([p0195r2](http://wg21.link/p0195r2))
|
||||
|
||||
* `std::variant<>`
|
||||
([p0088r3](http://wg21.link/p0088r3)) —
|
||||
Even if more of the C++ Standard Library is permitted, this class will remain
|
||||
forbidded. Invalid accesses are indicated by throwing exceptions.
|
||||
|
||||
* `std::any`
|
||||
([p0220r1](http://wg21.link/p0220r1)) —
|
||||
Even if more of the C++ Standard Library is permitted, this class will remain
|
||||
forbidden. It may require allocation, and always uses the standard
|
||||
allocator. It requires [RTTI].
|
||||
|
||||
* `std::as_const()`
|
||||
([p0007r1](http://wg21.link/p0007r1)) —
|
||||
If sufficiently useful, HotSpot could add such a function. It would likely be
|
||||
added to globalDefinitions.hpp, where there are already some similar small
|
||||
utilities.
|
||||
|
||||
* `std::clamp()`
|
||||
([p002501](http://wg21.link/p002501)) —
|
||||
This function is already provided in globalDefinitions.hpp.
|
||||
|
||||
* Parallel STL Algorithms
|
||||
([p0024r2](http://wg21.link/p0024r2)) —
|
||||
Even if more of the C++ Standard Library is permitted, these will remain
|
||||
forbidden. They are built on the standard C++ threading mechanisms. HotSpot
|
||||
doesn't use those mechanisms, instead providing and using its own.
|
||||
|
||||
* Cache Line Sizes
|
||||
[p0154r1](http://wg21.link/p0154r1) —
|
||||
HotSpot has its own mechanisms for this, using values like
|
||||
`DEFAULT_CACHE_LINE_SIZE`. The platform-specific implementation of the HotSpot
|
||||
mechanisms might use these library functions, but there is no reason to move
|
||||
away from the current approach. Quoting from [JOSUTTIS]: "... if you know better,
|
||||
use specific values, but using these values is better than any assumed fixed
|
||||
size for code supporting multiple platforms."
|
||||
|
||||
* `register` storage class removal
|
||||
[p0001r1](http://wg21.link/p0001r1) —
|
||||
The `register` storage class has been removed. `register` is still a keyword,
|
||||
so still can't be used for normal purposes. Also, this doesn't affect the use
|
||||
of `register` for gcc-style extended asm code; that's a different syntactic
|
||||
element with a different meaning.
|
||||
|
||||
* Value of `__cplusplus` —
|
||||
Testing whether `__cplusplus` is defined or not is permitted, and indeed
|
||||
required. But the value should not need to be examined. The value is changed
|
||||
with each revision of the Standard. But we build HotSpot and (most of) the
|
||||
rest of the JDK with a specifically selected version of the Standard. The
|
||||
value of `__cplusplus` should be known and unchanging until we change the
|
||||
project's build configuration again. So examining the value shouldn't ever be
|
||||
necessary.
|
||||
|
||||
* Removal of `++` for `bool`
|
||||
([p0003r1](http://wg21.link/p0003r1))
|
||||
|
||||
* Removal of trigraphs
|
||||
([n4086](http://wg21.link/n4086))
|
||||
|
||||
## Undecided Features
|
||||
|
||||
This list is incomplete; it serves to explicitly call out some
|
||||
features that have not yet been discussed.
|
||||
|
||||
Some features are undecided (so implicitly forbidden) because we don't expect
|
||||
to use them at all. This might be reconsidered if someone finds a good use
|
||||
case.
|
||||
|
||||
Some Standard Library features are undecided (so implicitly forbidden)
|
||||
because, while this Style Guide forbids the use of such, they may be
|
||||
sufficiently useful that we want to permit them anyway. Doing so may require
|
||||
some idiomatic mechanism for addressing things like `assert` incompatibility,
|
||||
incompatibility with HotSpot's `FORBID_C_FUNCTION` mechanism, and the like.
|
||||
|
||||
### std::optional<>
|
||||
|
||||
It is undecided whether to permit the use of `std::optional<>`
|
||||
([p0220r1](http://wg21.link/p0220r1)). It may be sufficiently useful that it
|
||||
should be permitted despite the usual prohibition against using Standard
|
||||
Library facilities. Use of the `value()` member function must be forbidden, as
|
||||
it reports an invalid access by throwing an exception.
|
||||
|
||||
### std::byte
|
||||
|
||||
It is undecided whether to permit the use of the `std::byte` type
|
||||
([p0298r3](http://wg21.link/p0298r3)). It may be sufficiently useful that it
|
||||
should be permitted despite the usual prohibition against using Standard
|
||||
Library facilities.
|
||||
|
||||
It has been suggested that changing the HotSpot `address` type to use
|
||||
`std::byte` has some benefits. That is, replace
|
||||
```
|
||||
typedef u_char* address;
|
||||
typedef const u_char* const_address;
|
||||
```
|
||||
```
|
||||
using address = std::byte*;
|
||||
using const_address = const std::byte*;
|
||||
```
|
||||
in globalDefinitions.hpp.
|
||||
|
||||
A specific benefit that was mentioned is that it might improve the horrible
|
||||
way that gdb handles our current definition of the `address` type.
|
||||
```
|
||||
#include <cstddef>
|
||||
|
||||
typedef unsigned char* address;
|
||||
typedef std::byte* address_b;
|
||||
|
||||
int main() {
|
||||
|
||||
char* mem;
|
||||
|
||||
address addr = (address)mem;
|
||||
address_b addr_b = (address_b)mem;
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
(gdb) p addr
|
||||
$1 = (address) 0x7ffff7fe4fa0 <dl_main> "\363\017\036\372Uf\017\357\300H\211\345AWI\211\377AVAUATSH\201\354\210\002"
|
||||
(gdb) p addr_b
|
||||
$2 = (address_b) 0x7ffff7fe4fa0 <dl_main>
|
||||
```
|
||||
|
||||
This needs to be explored. Some folks have said they will do so.
|
||||
|
||||
### String Views
|
||||
|
||||
It is undecided whether to permit the use of `std::string_view`
|
||||
([p0220r1](http://wg21.link/p0220r1)).
|
||||
|
||||
HotSpot doesn't use `std::string`, but uses `char*` strings a lot. Wrapping
|
||||
such in a `std::string_view` to enable the use of various algorithms could be
|
||||
useful. But since HotSpot also doesn't permit use of `<algorithm>` and the
|
||||
like, that only gets the limited set of algorithms provided by the view class
|
||||
directly.
|
||||
|
||||
There is also the issue of `NUL` termination; string views are not necessarily
|
||||
`NUL` terminated. Moreover, if one goes to the work of making one that is
|
||||
`NUL` terminated, that terminator is included in the size.
|
||||
|
||||
There are other caveats. Permitting use of string views would require
|
||||
discussion of those.
|
||||
|
||||
### Substring and Subsequence Searching
|
||||
|
||||
In addition to simple substring searching, the Standard Library now includes
|
||||
Boyer-Moore and Boyer-Moore-Horspool searchers, in case someone wants to
|
||||
search really large texts. That seems an unlikely use-case for HotSpot. See
|
||||
[p0220r1](http://wg21.link/p0220r1).
|
||||
|
||||
### `new` and `delete` with Over-Aligned Data
|
||||
|
||||
It is undecided whether to permit the use of dynamic allocation of overaligned
|
||||
types ([n3396](http://wg21.link/n3396)).
|
||||
|
||||
HotSpot currently only has a couple of over-aligned types that are dynamically
|
||||
allocated. These are handled manually, not going through `new` expressions, as
|
||||
that couldn't work before C++17.
|
||||
|
||||
One of the ways an over-aligned type might arise is by aligning a data member.
|
||||
This might be done to avoid destructive interference for concurrent accesses.
|
||||
But HotSpot uses a different approach, using explicit padding. Again, this is
|
||||
in part because `new` and `delete` of overaligned types didn't work. But we
|
||||
might prefer to continue this approach.
|
||||
|
||||
We would need to add `operator new` overloads to `CHeapObj<>` and possibly in
|
||||
other places in order to support this. However, it has been suggested that
|
||||
implementing it (efficiently) on top of NMT might be difficult. Note that
|
||||
`posix_memalign` / `_aligned_malloc` don't help here, because of NMT's use of
|
||||
malloc headers.
|
||||
|
||||
If we don't support it we may want to add `operator new` overloads that are
|
||||
deleted, to prevent attempted uses.
|
||||
|
||||
Alignment usage in non-HotSpot parts of the OpenJDK:
|
||||
|
||||
* `alignas` used once in harfbuzz, to align a variable.
|
||||
|
||||
* libpipewire has `#define SPA_ALIGNED` macro using gcc `aligned` attribute,
|
||||
but doesn't use it.
|
||||
|
||||
* libsleef has `#define ALIGNED` macro using gcc `aligned` attribute. It is
|
||||
not used for class or member declarations.
|
||||
|
||||
### `std::to_chars()` and `std::from_chars`
|
||||
|
||||
It is undecided whether to permit the use of `std::to_chars()` and
|
||||
`std::from_chars()` ([p0067r5](http://wg21.link/p0067r5)).
|
||||
|
||||
These functions provide low-level conversions between character sequences and
|
||||
numeric values. This seems like a good candidate for use in HotSpot,
|
||||
potentially replacing various clumsy or less performant alternatives. There is
|
||||
no memory allocation. Parsing failures are indicated via error codes rather
|
||||
than exceptions. Various other nice for HotSpot properties.
|
||||
|
||||
Note that the published C++17 Standard puts these in `<utility>`, but a defect
|
||||
report moved them to `<charconv>`. This also needs `<system_error>`.
|
||||
|
||||
This would require upgrading the minimum gcc version to 11.1 for floating
|
||||
point conversion support. The minimum Visual Studio version is already
|
||||
sufficient. The minimum clang version requirement hasn't been determined yet.
|
||||
|
||||
### `std::launder()`
|
||||
|
||||
It is undecided whether to permit the use of `std::launder()`
|
||||
([p0137r1](http://wg21.link/p0137r1)).
|
||||
|
||||
Change to permitted if we discover a place where we need it. Or maybe we
|
||||
should just permit it, but hope we don't need it.
|
||||
|
||||
Also, C++20 revised the relevant part of Object Lifetime in a way that seems
|
||||
more permissive and with less need of laundering. We don't know if
|
||||
implementations of prior versions take advantage of the difference.
|
||||
|
||||
See Object Lifetime: C++17 6.8/8, C++20 6.7.3/8
|
||||
|
||||
### Additional Undecided Features
|
||||
|
||||
* Trailing return type syntax for functions
|
||||
([n2541](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm))
|
||||
|
||||
* Variable templates
|
||||
([n3651](https://isocpp.org/files/papers/N3651.pdf))
|
||||
([n3651](https://isocpp.org/files/papers/N3651.pdf),
|
||||
[p0127r2](http://wg21.link/p0127r2))
|
||||
|
||||
* Member initializers and aggregates
|
||||
([n3653](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html))
|
||||
|
||||
* Rvalue references and move semantics
|
||||
|
||||
* Shorthand for nested namespaces
|
||||
([n4230](http://wg21.link/n4230)) —
|
||||
HotSpot makes very little use of namespaces, so this seemingly innocuous
|
||||
feature probably isn't useful to us.
|
||||
|
||||
* Direct list initialization with `auto`
|
||||
([n3681](http://wg21.link/n3681)) —
|
||||
This change fixed some issues with direct list initialization and `auto`. But
|
||||
we don't use that feature much, if at all. And perhaps shouldn't be using it.
|
||||
|
||||
* UTF-8 Character Literals
|
||||
([n4267](http://wg21.link/n4267)) —
|
||||
Do we have a use-case for this?
|
||||
|
||||
* Fold Expressions
|
||||
([n4295](http://wg21.link/n4295)) —
|
||||
Provides a simple way to apply operators to a parameter pack. HotSpot doesn't
|
||||
use variadic templates very much. That makes it questionable that developers
|
||||
should need to know about this feature. But if someone does come up with a
|
||||
good use-case, it's likely that the alternatives are significantly worse,
|
||||
because pack manipulation without this can be complicated.
|
||||
|
||||
* `std::invoke<>()`
|
||||
([n4169](http://wg21.link/n4169))
|
||||
|
||||
|
||||
|
||||
[ADL]: https://en.cppreference.com/w/cpp/language/adl
|
||||
"Argument Dependent Lookup"
|
||||
|
||||
@ -1231,3 +1865,6 @@ features that have not yet been discussed.
|
||||
|
||||
[PARTIALAPP]: https://en.wikipedia.org/wiki/Partial_application
|
||||
"Partial Application"
|
||||
|
||||
[JOSUTTIS]: https://www.cppstd17.com
|
||||
"C++17: The Complete Guide"
|
||||
|
||||
@ -189,7 +189,7 @@ wants to find) and design tests using those models.</p>
|
||||
<p>Prefer having checks inside test code.</p>
|
||||
<p>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.</p>
|
||||
@ -198,7 +198,7 @@ the closer a check to a test, the better.</p>
|
||||
<p>Prefer <code>EXPECT</code> over <code>ASSERT</code> if possible.</p>
|
||||
<p>This is related to the <a href="#informativeness">informativeness</a>
|
||||
property of tests, information for other checks can help to better
|
||||
localize a defect’s root-cause. One should use <code>ASSERT</code> if it
|
||||
localize a defect's root-cause. One should use <code>ASSERT</code> if it
|
||||
is impossible to continue test execution or if it does not make much
|
||||
sense. Later in the text, <code>EXPECT</code> forms will be used to
|
||||
refer to both <code>ASSERT/EXPECT</code>.</p>
|
||||
@ -235,7 +235,7 @@ which checks that the absolute value of the difference between
|
||||
<code>eps</code>.</p>
|
||||
<h3 id="c-string-comparison">C string comparison</h3>
|
||||
<p>Use string special macros for C strings comparisons.</p>
|
||||
<p><code>EXPECT_EQ</code> just compares pointers’ values, which is
|
||||
<p><code>EXPECT_EQ</code> just compares pointers' values, which is
|
||||
hardly what one wants comparing C strings. GoogleTest provides
|
||||
<code>EXPECT_STREQ</code> and <code>EXPECT_STRNE</code> macros to
|
||||
compare C string contents. There are also case-insensitive versions
|
||||
@ -245,7 +245,7 @@ compare C string contents. There are also case-insensitive versions
|
||||
<p>All GoogleTest asserts print compared expressions and their values,
|
||||
so there is no need to have them in error messages. Asserts print only
|
||||
compared values, they do not print any of interim variables, e.g.
|
||||
<code>ASSERT_TRUE((val1 == val2 && isFail(foo(8)) || i == 18)</code>
|
||||
<code>ASSERT_TRUE((val1 == val2 && isFail(foo(8))) || i == 18)</code>
|
||||
prints only one value. If you use some complex predicates, please
|
||||
consider <code>EXPECT_PRED*</code> or <code>EXPECT_FORMAT_PRED</code>
|
||||
assertions family, they check that a predicate returns true/success and
|
||||
@ -293,7 +293,7 @@ subsystem, etc.</p>
|
||||
<p>This naming scheme helps to find tests, filter them and simplifies
|
||||
test failure analysis. For example, class <code>Foo</code> - test group
|
||||
<code>Foo</code>, compiler logging subsystem - test group
|
||||
<code>CompilerLogging</code>, G1 GC — test group <code>G1GC</code>, and
|
||||
<code>CompilerLogging</code>, G1 GC - test group <code>G1GC</code>, and
|
||||
so forth.</p>
|
||||
<h3 id="filename">Filename</h3>
|
||||
<p>A test file must have <code>test_</code> prefix and <code>.cpp</code>
|
||||
@ -345,7 +345,7 @@ name starts or ends with an underscore are enough to be safe.</p>
|
||||
<h3 id="friend-classes">Friend classes</h3>
|
||||
<p>All test purpose friends should have either <code>Test</code> or
|
||||
<code>Testable</code> suffix.</p>
|
||||
<p>It greatly simplifies understanding of friendship’s purpose and
|
||||
<p>It greatly simplifies understanding of friendship's purpose and
|
||||
allows statically check that private members are not exposed
|
||||
unexpectedly. Having <code>FooTest</code> as a friend of
|
||||
<code>Foo</code> without any comments will be understood as a necessary
|
||||
@ -435,7 +435,7 @@ inapplicable tests.</p>
|
||||
<h3 id="flag-restoring">Flag restoring</h3>
|
||||
<p>Restore changed flags.</p>
|
||||
<p>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 <code>SetUp</code> and
|
||||
<code>TearDown</code> 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.</p>
|
||||
<p>Caveats:</p>
|
||||
<ul>
|
||||
<li><p>Changing a flag’s value could break the invariants between flags'
|
||||
<li><p>Changing a flag's value could break the invariants between flags'
|
||||
values and hence could lead to unexpected/unsupported JVM
|
||||
state.</p></li>
|
||||
<li><p><code>FLAG_SET_*</code> macros can change more than one flag (in
|
||||
|
||||
@ -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`.
|
||||
@ -172,7 +172,7 @@ Provide informative, but not too verbose error messages.
|
||||
All GoogleTest asserts print compared expressions and their values, so
|
||||
there is no need to have them in error messages. Asserts print only
|
||||
compared values, they do not print any of interim variables, e.g.
|
||||
`ASSERT_TRUE((val1 == val2 && isFail(foo(8)) || i == 18)` prints only
|
||||
`ASSERT_TRUE((val1 == val2 && isFail(foo(8))) || i == 18)` prints only
|
||||
one value. If you use some complex predicates, please consider
|
||||
`EXPECT_PRED*` or `EXPECT_FORMAT_PRED` assertions family, they check that
|
||||
a predicate returns true/success and print out all parameters values.
|
||||
@ -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
|
||||
|
||||
124
doc/starting-next-release.html
Normal file
124
doc/starting-next-release.html
Normal file
@ -0,0 +1,124 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Explanation of start of release changes</title>
|
||||
<style>
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
||||
div.column{flex: auto; overflow-x: auto;}
|
||||
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||||
ul.task-list{list-style: none;}
|
||||
ul.task-list li input[type="checkbox"] {
|
||||
width: 0.8em;
|
||||
margin: 0 0.8em 0.2em -1.6em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="../make/data/docs-resources/resources/jdk-default.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<header id="title-block-header">
|
||||
<h1 class="title">Explanation of start of release changes</h1>
|
||||
</header>
|
||||
<nav id="TOC" role="doc-toc">
|
||||
<ul>
|
||||
<li><a href="#overview" id="toc-overview">Overview</a></li>
|
||||
<li><a href="#details-and-file-updates"
|
||||
id="toc-details-and-file-updates">Details and file updates</a>
|
||||
<ul>
|
||||
<li><a href="#meta-data-files" id="toc-meta-data-files">Meta-data
|
||||
files</a></li>
|
||||
<li><a href="#src-files" id="toc-src-files"><code>src</code>
|
||||
files</a></li>
|
||||
<li><a href="#test-files" id="toc-test-files"><code>test</code>
|
||||
files</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<h2 id="overview">Overview</h2>
|
||||
<p>The start of release changes, the changes that turn JDK <em>N</em>
|
||||
into JDK (<em>N</em>+1), are primarily small updates to various files
|
||||
along with new files to store symbol information to allow
|
||||
<code>javac --release N ...</code> to run on JDK (<em>N</em>+1).</p>
|
||||
<p>The updates include changes to files holding meta-data about the
|
||||
release, files under the <code>src</code> directory for API and tooling
|
||||
updates, and incidental updates under the <code>test</code>
|
||||
directory.</p>
|
||||
<h2 id="details-and-file-updates">Details and file updates</h2>
|
||||
<p>As a matter of policy, there are a number of semantically distinct
|
||||
concepts which get incremented separately at the start of a new
|
||||
release:</p>
|
||||
<ul>
|
||||
<li>Feature value of <code>Runtime.version()</code></li>
|
||||
<li>Highest source version modeled by
|
||||
<code>javax.lang.model.SourceVersion</code></li>
|
||||
<li>Highest class file format major version recognized by the
|
||||
platform</li>
|
||||
<li>Highest
|
||||
<code>-source</code>/<code>-target</code>/<code>--release</code>
|
||||
argument recognized by <code>javac</code> and related tools</li>
|
||||
</ul>
|
||||
<p>The expected file updates are listed below. Additional files may need
|
||||
to be updated for a particular release.</p>
|
||||
<h3 id="meta-data-files">Meta-data files</h3>
|
||||
<ul>
|
||||
<li><code>jcheck/conf</code>: update meta-data used by
|
||||
<code>jcheck</code> and the Skara tooling</li>
|
||||
<li><code>make/conf/version-numbers.conf</code>: update to meta-data
|
||||
used in the build</li>
|
||||
</ul>
|
||||
<h3 id="src-files"><code>src</code> files</h3>
|
||||
<ul>
|
||||
<li><code>src/hotspot/share/classfile/classFileParser.cpp</code>: add a
|
||||
<code>#define</code> for the new version</li>
|
||||
<li><code>src/java.base/share/classes/java/lang/classfile/ClassFile.java</code>:
|
||||
add a constant for the new class file format version</li>
|
||||
<li><code>src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java</code>:
|
||||
add an <code>enum</code> constant for the new class file format
|
||||
version</li>
|
||||
<li><code>src/java.compiler/share/classes/javax/lang/model/SourceVersion.java</code>:
|
||||
add an <code>enum</code> constant for the new source version</li>
|
||||
<li><code>src/java.compiler/share/classes/javax/lang/model/util/*</code>
|
||||
visitors: Update <code>@SupportedSourceVersion</code> annotations to
|
||||
latest value. Note this update is done in lieu of introducing another
|
||||
set of visitors for each Java SE release.</li>
|
||||
<li><code>src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java</code>:
|
||||
add an <code>enum</code> constant for the new source version internal to
|
||||
<code>javac</code></li>
|
||||
<li><code>src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java</code>:
|
||||
add an <code>enum</code> constant for the new class file format version
|
||||
internal to <code>javac</code></li>
|
||||
<li><code>src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java</code>:
|
||||
add an <code>enum</code> constant for the new target version internal to
|
||||
<code>javac</code></li>
|
||||
<li><code>src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java</code>
|
||||
update printing processor to support the new source version</li>
|
||||
<li>The symbol information for <code>--release</code> is stored as new
|
||||
text files in the <code>src/jdk.compiler/share/data/symbols</code>
|
||||
directory, one file per module. The README file in that directory
|
||||
contains directions on how to create the files.</li>
|
||||
</ul>
|
||||
<h3 id="test-files"><code>test</code> files</h3>
|
||||
<ul>
|
||||
<li><code>test/langtools/tools/javac/api/TestGetSourceVersions.java</code>:
|
||||
add new <code>SourceVersion</code> constant to test matrix.</li>
|
||||
<li><code>test/langtools/tools/javac/classfiles/ClassVersionChecker.java</code>:
|
||||
add new enum constant for the new class file version</li>
|
||||
<li><code>test/langtools/tools/javac/lib/JavacTestingAbstractProcessor.java</code>
|
||||
update annotation processor extended by <code>javac</code> tests to
|
||||
cover the new source version</li>
|
||||
<li><code>test/langtools/tools/javac/preview/classReaderTest/Client.nopreview.out</code>
|
||||
and
|
||||
<code>test/langtools/tools/javac/preview/classReaderTest/Client.preview.out</code>:
|
||||
update expected messages for preview errors and warnings</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
68
doc/starting-next-release.md
Normal file
68
doc/starting-next-release.md
Normal file
@ -0,0 +1,68 @@
|
||||
% Explanation of start of release changes
|
||||
|
||||
## Overview
|
||||
|
||||
The start of release changes, the changes that turn JDK _N_ into JDK
|
||||
(_N_+1), are primarily small updates to various files along with new files to
|
||||
store symbol information to allow `javac --release N ...` to run on
|
||||
JDK (_N_+1).
|
||||
|
||||
The updates include changes to files holding meta-data about the
|
||||
release, files under the `src` directory for API and tooling updates,
|
||||
and incidental updates under the `test` directory.
|
||||
|
||||
## Details and file updates
|
||||
|
||||
As a matter of policy, there are a number of semantically distinct
|
||||
concepts which get incremented separately at the start of a new
|
||||
release:
|
||||
|
||||
* Feature value of `Runtime.version()`
|
||||
* Highest source version modeled by `javax.lang.model.SourceVersion`
|
||||
* Highest class file format major version recognized by the platform
|
||||
* Highest `-source`/`-target`/`--release` argument recognized by
|
||||
`javac` and related tools
|
||||
|
||||
The expected file updates are listed below. Additional files may need
|
||||
to be updated for a particular release.
|
||||
|
||||
### Meta-data files
|
||||
|
||||
* `jcheck/conf`: update meta-data used by `jcheck` and the Skara tooling
|
||||
* `make/conf/version-numbers.conf`: update to meta-data used in the build
|
||||
|
||||
### `src` files
|
||||
|
||||
* `src/hotspot/share/classfile/classFileParser.cpp`: add a `#define`
|
||||
for the new version
|
||||
* `src/java.base/share/classes/java/lang/classfile/ClassFile.java`:
|
||||
add a constant for the new class file format version
|
||||
* `src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java`:
|
||||
add an `enum` constant for the new class file format version
|
||||
* `src/java.compiler/share/classes/javax/lang/model/SourceVersion.java`:
|
||||
add an `enum` constant for the new source version
|
||||
* `src/java.compiler/share/classes/javax/lang/model/util/*` visitors: Update
|
||||
`@SupportedSourceVersion` annotations to latest value. Note this update
|
||||
is done in lieu of introducing another set of visitors for each Java
|
||||
SE release.
|
||||
* `src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java`:
|
||||
add an `enum` constant for the new source version internal to `javac`
|
||||
* `src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java`:
|
||||
add an `enum` constant for the new class file format version internal to `javac`
|
||||
* `src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java`:
|
||||
add an `enum` constant for the new target version internal to `javac`
|
||||
* `src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java`
|
||||
update printing processor to support the new source version
|
||||
* The symbol information for `--release` is stored as new text files in the
|
||||
`src/jdk.compiler/share/data/symbols` directory, one file per
|
||||
module. The README file in that directory contains directions on how
|
||||
to create the files.
|
||||
|
||||
### `test` files
|
||||
|
||||
* `test/langtools/tools/javac/api/TestGetSourceVersions.java`: add new `SourceVersion` constant to test matrix.
|
||||
* `test/langtools/tools/javac/classfiles/ClassVersionChecker.java`: add new enum constant for the new class file version
|
||||
* `test/langtools/tools/javac/lib/JavacTestingAbstractProcessor.java`
|
||||
update annotation processor extended by `javac` tests to cover the new source version
|
||||
* `test/langtools/tools/javac/preview/classReaderTest/Client.nopreview.out` and `test/langtools/tools/javac/preview/classReaderTest/Client.preview.out`: update expected messages for preview errors and warnings
|
||||
|
||||
@ -72,6 +72,12 @@ id="toc-notes-for-specific-tests">Notes for Specific Tests</a>
|
||||
<li><a href="#non-us-locale" id="toc-non-us-locale">Non-US
|
||||
locale</a></li>
|
||||
<li><a href="#pkcs11-tests" id="toc-pkcs11-tests">PKCS11 Tests</a></li>
|
||||
<li><a href="#testing-ahead-of-time-optimizations"
|
||||
id="toc-testing-ahead-of-time-optimizations">Testing Ahead-of-time
|
||||
Optimizations</a></li>
|
||||
<li><a href="#testing-with-alternative-security-providers"
|
||||
id="toc-testing-with-alternative-security-providers">Testing with
|
||||
alternative security providers</a></li>
|
||||
<li><a href="#client-ui-tests" id="toc-client-ui-tests">Client UI
|
||||
Tests</a></li>
|
||||
</ul></li>
|
||||
@ -392,7 +398,8 @@ TEST_OPTS keywords.</p>
|
||||
<h4 id="jobs">JOBS</h4>
|
||||
<p>Currently only applies to JTReg.</p>
|
||||
<h4 id="timeout_factor">TIMEOUT_FACTOR</h4>
|
||||
<p>Currently only applies to JTReg.</p>
|
||||
<p>Currently only applies to <a href="#timeout_factor-1">JTReg
|
||||
-timeoutFactor</a>.</p>
|
||||
<h4 id="java_options">JAVA_OPTIONS</h4>
|
||||
<p>Applies to JTReg, GTest and Micro.</p>
|
||||
<h4 id="vm_options">VM_OPTIONS</h4>
|
||||
@ -408,6 +415,13 @@ instrumentation
|
||||
special target <code>jcov-test</code> instead of <code>test</code>, e.g.
|
||||
<code>make jcov-test TEST=jdk_lang</code>. This will make sure the JCov
|
||||
image is built, and that JCov reporting is enabled.</p>
|
||||
<p>To include JCov coverage for just a subset of all modules, you can
|
||||
use the <code>--with-jcov-modules</code> arguments to
|
||||
<code>configure</code>, e.g.
|
||||
<code>--with-jcov-modules=jdk.compiler,java.desktop</code>.</p>
|
||||
<p>For more fine-grained control, you can pass arbitrary filters to JCov
|
||||
using <code>--with-jcov-filters</code>, and you can specify a specific
|
||||
JDK to instrument using <code>--with-jcov-input-jdk</code>.</p>
|
||||
<p>The JCov report is stored in
|
||||
<code>build/$BUILD/test-results/jcov-output/report</code>.</p>
|
||||
<p>Please note that running with JCov reporting can be very memory
|
||||
@ -420,6 +434,9 @@ the diff between the specified revision and the repository tip.</p>
|
||||
<p>The report is stored in
|
||||
<code>build/$BUILD/test-results/jcov-output/diff_coverage_report</code>
|
||||
file.</p>
|
||||
<h4 id="aot_jdk">AOT_JDK</h4>
|
||||
<p>See <a href="#testing-ahead-of-time-optimizations">Testing
|
||||
Ahead-of-time optimizations</a>.</p>
|
||||
<h3 id="jtreg-keywords">JTReg keywords</h3>
|
||||
<h4 id="jobs-1">JOBS</h4>
|
||||
<p>The test concurrency (<code>-concurrency</code>).</p>
|
||||
@ -428,13 +445,17 @@ otherwise it defaults to JOBS, except for Hotspot, where the default is
|
||||
<em>number of CPU cores/2</em>, but never more than <em>memory size in
|
||||
GB/2</em>.</p>
|
||||
<h4 id="timeout_factor-1">TIMEOUT_FACTOR</h4>
|
||||
<p>The timeout factor (<code>-timeoutFactor</code>).</p>
|
||||
<p>Defaults to 4.</p>
|
||||
<p>The <code>TIMEOUT_FACTOR</code> is forwarded to JTReg framework
|
||||
itself (<code>-timeoutFactor</code>). Also, some test cases that
|
||||
programmatically wait a certain amount of time will apply this factor.
|
||||
If we run in forced compilation mode (<code>-Xcomp</code>), the build
|
||||
system will automatically adjust this factor to compensate for less
|
||||
performance. Defaults to 1.</p>
|
||||
<h4 id="failure_handler_timeout">FAILURE_HANDLER_TIMEOUT</h4>
|
||||
<p>Sets the argument <code>-timeoutHandlerTimeout</code> for JTReg. The
|
||||
default value is 0. This is only valid if the failure handler is
|
||||
built.</p>
|
||||
<h4 id="jtreg_test_thread_factory">JTREG_TEST_THREAD_FACTORY</h4>
|
||||
<h4 id="test_thread_factory">TEST_THREAD_FACTORY</h4>
|
||||
<p>Sets the <code>-testThreadFactory</code> for JTReg. It should be the
|
||||
fully qualified classname of a class which implements
|
||||
<code>java.util.concurrent.ThreadFactory</code>. One such implementation
|
||||
@ -442,6 +463,12 @@ class, named Virtual, is currently part of the JDK build in the
|
||||
<code>test/jtreg_test_thread_factory/</code> directory. This class gets
|
||||
compiled during the test image build. The implementation of the Virtual
|
||||
class creates a new virtual thread for executing each test class.</p>
|
||||
<h4 id="jvmti_stress_agent">JVMTI_STRESS_AGENT</h4>
|
||||
<p>Executes JTReg tests with JVM TI stress agent. The stress agent is
|
||||
the part of test library and located in
|
||||
<code>test/lib/jdk/test/lib/jvmti/libJvmtiStressAgent.cpp</code>. The
|
||||
value of this argument is set as JVM TI agent options. This mode uses
|
||||
ProblemList-jvmti-stress-agent.txt as an additional exclude list.</p>
|
||||
<h4 id="test_mode">TEST_MODE</h4>
|
||||
<p>The test mode (<code>agentvm</code> or <code>othervm</code>).</p>
|
||||
<p>Defaults to <code>agentvm</code>.</p>
|
||||
@ -541,6 +568,12 @@ each fork. Same as specifying <code>-wi <num></code>.</p>
|
||||
same values as <code>-rff</code>, i.e., <code>text</code>,
|
||||
<code>csv</code>, <code>scsv</code>, <code>json</code>, or
|
||||
<code>latex</code>.</p>
|
||||
<h4 id="test_jdk">TEST_JDK</h4>
|
||||
<p>The path to the JDK that will be used to run the benchmarks.</p>
|
||||
<p>Defaults to <code>build/<CONF-NAME>/jdk</code>.</p>
|
||||
<h4 id="benchmarks_jar">BENCHMARKS_JAR</h4>
|
||||
<p>The path to the JAR containing the benchmarks.</p>
|
||||
<p>Defaults to <code>test/micro/benchmarks.jar</code>.</p>
|
||||
<h4 id="vm_options-2">VM_OPTIONS</h4>
|
||||
<p>Additional VM arguments to provide to forked off VMs. Same as
|
||||
<code>-jvmArgs <args></code></p>
|
||||
@ -586,6 +619,49 @@ element of the appropriate <code>@Artifact</code> class. (See
|
||||
JTREG="JAVA_OPTIONS=-Djdk.test.lib.artifacts.nsslib-linux_aarch64=/path/to/NSS-libs"</code></pre>
|
||||
<p>For more notes about the PKCS11 tests, please refer to
|
||||
test/jdk/sun/security/pkcs11/README.</p>
|
||||
<h3 id="testing-ahead-of-time-optimizations">Testing Ahead-of-time
|
||||
Optimizations</h3>
|
||||
<p>One way to improve test coverage of ahead-of-time (AOT) optimizations
|
||||
in the JDK is to run existing jtreg test cases in a special "AOT_JDK"
|
||||
mode. Example:</p>
|
||||
<pre><code>$ make test JTREG="AOT_JDK=onestep" \
|
||||
TEST=open/test/hotspot/jtreg/runtime/invokedynamic</code></pre>
|
||||
<p>In this testing mode, we first perform an AOT training run (see
|
||||
https://openjdk.org/jeps/483) of a special test program (<a
|
||||
href="../test/setup_aot/TestSetupAOT.java">test/setup_aot/TestSetupAOT.java</a>)
|
||||
that accesses about 5,0000 classes in the JDK core libraries.
|
||||
Optimization artifacts for these classes (such as pre-linked lambda
|
||||
expressions, execution profiles, and pre-generated native code) are
|
||||
stored into an AOT cache file, which will be used by all the JVMs
|
||||
launched by the selected jtreg test cases.</p>
|
||||
<p>When the jtreg tests call into the core libraries classes that are in
|
||||
the AOT cache, we will be able to test the AOT optimizations that were
|
||||
used on those classes.</p>
|
||||
<p>Please note that not all existing jtreg test cases can be executed
|
||||
with the AOT_JDK mode. See <a
|
||||
href="../test/hotspot/jtreg/ProblemList-AotJdk.txt">test/hotspot/jtreg/ProblemList-AotJdk.txt</a>
|
||||
and <a
|
||||
href="../test/jdk/ProblemList-AotJdk.txt">test/jdk/ProblemList-AotJdk.txt</a>.</p>
|
||||
<p>Also, test cases that were written specifically to test AOT, such as
|
||||
the tests under <a
|
||||
href="../test/hotspot/jtreg/runtime/cds/">test/hotspot/jtreg/runtime/cds</a>,
|
||||
cannot be executed with the AOT_JDK mode.</p>
|
||||
<p>Valid values for <code>AOT_JDK</code> are <code>onestep</code> and
|
||||
<code>twostep</code>. These control how the AOT cache is generated. See
|
||||
https://openjdk.org/jeps/514 for details. All other values are
|
||||
ignored.</p>
|
||||
<h3 id="testing-with-alternative-security-providers">Testing with
|
||||
alternative security providers</h3>
|
||||
<p>Some security tests use a hardcoded provider for
|
||||
<code>KeyFactory</code>, <code>Cipher</code>,
|
||||
<code>KeyPairGenerator</code>, <code>KeyGenerator</code>,
|
||||
<code>AlgorithmParameterGenerator</code>, <code>KeyAgreement</code>,
|
||||
<code>Mac</code>, <code>MessageDigest</code>, <code>SecureRandom</code>,
|
||||
<code>Signature</code>, <code>AlgorithmParameters</code>,
|
||||
<code>Configuration</code>, <code>Policy</code>, or
|
||||
<code>SecretKeyFactory</code> objects. Specify the
|
||||
<code>-Dtest.provider.name=NAME</code> property to use a different
|
||||
provider for the service(s).</p>
|
||||
<h3 id="client-ui-tests">Client UI Tests</h3>
|
||||
<h4 id="system-key-shortcuts">System key shortcuts</h4>
|
||||
<p>Some Client UI tests use key sequences which may be reserved by the
|
||||
|
||||
@ -324,7 +324,7 @@ Currently only applies to JTReg.
|
||||
|
||||
#### TIMEOUT_FACTOR
|
||||
|
||||
Currently only applies to JTReg.
|
||||
Currently only applies to [JTReg -timeoutFactor](#timeout_factor-1).
|
||||
|
||||
#### JAVA_OPTIONS
|
||||
|
||||
@ -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.
|
||||
@ -359,6 +367,10 @@ between the specified revision and the repository tip.
|
||||
The report is stored in
|
||||
`build/$BUILD/test-results/jcov-output/diff_coverage_report` file.
|
||||
|
||||
#### AOT_JDK
|
||||
|
||||
See [Testing Ahead-of-time optimizations](#testing-ahead-of-time-optimizations).
|
||||
|
||||
### JTReg keywords
|
||||
|
||||
#### JOBS
|
||||
@ -371,16 +383,18 @@ never more than *memory size in GB/2*.
|
||||
|
||||
#### TIMEOUT_FACTOR
|
||||
|
||||
The timeout factor (`-timeoutFactor`).
|
||||
|
||||
Defaults to 4.
|
||||
The `TIMEOUT_FACTOR` is forwarded to JTReg framework itself
|
||||
(`-timeoutFactor`). Also, some test cases that programmatically wait a
|
||||
certain amount of time will apply this factor. If we run in forced
|
||||
compilation mode (`-Xcomp`), the build system will automatically
|
||||
adjust this factor to compensate for less performance. Defaults to 1.
|
||||
|
||||
#### FAILURE_HANDLER_TIMEOUT
|
||||
|
||||
Sets the argument `-timeoutHandlerTimeout` for JTReg. The default value is 0.
|
||||
This is only valid if the failure handler is built.
|
||||
|
||||
#### JTREG_TEST_THREAD_FACTORY
|
||||
#### TEST_THREAD_FACTORY
|
||||
|
||||
Sets the `-testThreadFactory` for JTReg. It should be the fully qualified
|
||||
classname of a class which implements `java.util.concurrent.ThreadFactory`. One
|
||||
@ -389,6 +403,13 @@ the `test/jtreg_test_thread_factory/` directory. This class gets compiled
|
||||
during the test image build. The implementation of the Virtual class creates a
|
||||
new virtual thread for executing each test class.
|
||||
|
||||
#### JVMTI_STRESS_AGENT
|
||||
|
||||
Executes JTReg tests with JVM TI stress agent. The stress agent is the part of
|
||||
test library and located in `test/lib/jdk/test/lib/jvmti/libJvmtiStressAgent.cpp`.
|
||||
The value of this argument is set as JVM TI agent options.
|
||||
This mode uses ProblemList-jvmti-stress-agent.txt as an additional exclude list.
|
||||
|
||||
#### TEST_MODE
|
||||
|
||||
The test mode (`agentvm` or `othervm`).
|
||||
@ -537,6 +558,18 @@ Amount of time to spend in each warmup iteration. Same as specifying `-w
|
||||
Specify to have the test run save a log of the values. Accepts the same values
|
||||
as `-rff`, i.e., `text`, `csv`, `scsv`, `json`, or `latex`.
|
||||
|
||||
#### TEST_JDK
|
||||
|
||||
The path to the JDK that will be used to run the benchmarks.
|
||||
|
||||
Defaults to `build/<CONF-NAME>/jdk`.
|
||||
|
||||
#### BENCHMARKS_JAR
|
||||
|
||||
The path to the JAR containing the benchmarks.
|
||||
|
||||
Defaults to `test/micro/benchmarks.jar`.
|
||||
|
||||
#### VM_OPTIONS
|
||||
|
||||
Additional VM arguments to provide to forked off VMs. Same as `-jvmArgs <args>`
|
||||
@ -603,6 +636,52 @@ $ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" \
|
||||
For more notes about the PKCS11 tests, please refer to
|
||||
test/jdk/sun/security/pkcs11/README.
|
||||
|
||||
### Testing Ahead-of-time Optimizations
|
||||
|
||||
One way to improve test coverage of ahead-of-time (AOT) optimizations in
|
||||
the JDK is to run existing jtreg test cases in a special "AOT_JDK" mode.
|
||||
Example:
|
||||
|
||||
```
|
||||
$ make test JTREG="AOT_JDK=onestep" \
|
||||
TEST=open/test/hotspot/jtreg/runtime/invokedynamic
|
||||
```
|
||||
|
||||
In this testing mode, we first perform an AOT training run
|
||||
(see https://openjdk.org/jeps/483) of a special test program
|
||||
([test/setup_aot/TestSetupAOT.java](../test/setup_aot/TestSetupAOT.java))
|
||||
that accesses about 5,0000 classes in the JDK core libraries.
|
||||
Optimization artifacts for these classes (such as pre-linked
|
||||
lambda expressions, execution profiles, and pre-generated native code)
|
||||
are stored into an AOT cache file, which will be used by all the JVMs
|
||||
launched by the selected jtreg test cases.
|
||||
|
||||
When the jtreg tests call into the core libraries classes that are in
|
||||
the AOT cache, we will be able to test the AOT optimizations that were
|
||||
used on those classes.
|
||||
|
||||
Please note that not all existing jtreg test cases can be executed with
|
||||
the AOT_JDK mode. See
|
||||
[test/hotspot/jtreg/ProblemList-AotJdk.txt](../test/hotspot/jtreg/ProblemList-AotJdk.txt)
|
||||
and [test/jdk/ProblemList-AotJdk.txt](../test/jdk/ProblemList-AotJdk.txt).
|
||||
|
||||
Also, test cases that were written specifically to test AOT, such as the tests
|
||||
under [test/hotspot/jtreg/runtime/cds](../test/hotspot/jtreg/runtime/cds/),
|
||||
cannot be executed with the AOT_JDK mode.
|
||||
|
||||
Valid values for `AOT_JDK` are `onestep` and `twostep`. These control how
|
||||
the AOT cache is generated. See https://openjdk.org/jeps/514 for details.
|
||||
All other values are ignored.
|
||||
|
||||
### Testing with alternative security providers
|
||||
|
||||
Some security tests use a hardcoded provider for `KeyFactory`, `Cipher`,
|
||||
`KeyPairGenerator`, `KeyGenerator`, `AlgorithmParameterGenerator`,
|
||||
`KeyAgreement`, `Mac`, `MessageDigest`, `SecureRandom`, `Signature`,
|
||||
`AlgorithmParameters`, `Configuration`, `Policy`, or `SecretKeyFactory` objects.
|
||||
Specify the `-Dtest.provider.name=NAME` property to use a different provider for
|
||||
the service(s).
|
||||
|
||||
### Client UI Tests
|
||||
|
||||
#### System key shortcuts
|
||||
|
||||
@ -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
|
||||
@ -23,10 +23,9 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
include MakeFileStart.gmk
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
################################################################################
|
||||
|
||||
include CopyFiles.gmk
|
||||
include MakeIO.gmk
|
||||
@ -43,8 +42,6 @@ ifeq ($(call isBuildOs, windows), true)
|
||||
TAR_IGNORE_EXIT_VALUE := || test "$$$$?" = "1"
|
||||
endif
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, Bundles-pre.gmk))
|
||||
################################################################################
|
||||
# BUNDLE : Name of bundle to create
|
||||
# FILES : Files in BASE_DIRS to add to bundle
|
||||
@ -177,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
|
||||
@ -245,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))
|
||||
@ -500,10 +502,20 @@ ifneq ($(filter static-libs-graal-bundles, $(MAKECMDGOALS)), )
|
||||
STATIC_LIBS_GRAAL_TARGETS += $(BUILD_STATIC_LIBS_GRAAL_BUNDLE)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
#################################################################################
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, Bundles.gmk))
|
||||
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
|
||||
|
||||
################################################################################
|
||||
|
||||
@ -515,8 +527,13 @@ 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: all default product-bundles test-bundles \
|
||||
.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
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2018, 2020, 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
|
||||
@ -23,10 +23,9 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
include MakeFileStart.gmk
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
################################################################################
|
||||
|
||||
# When FIXPATH is set, let it process the file to make sure all paths are usable
|
||||
# by system native tools. The FIXPATH tool assumes arguments preceded by an @
|
||||
@ -50,6 +49,6 @@ $(OUTPUTDIR)/compile_commands.json: $(wildcard $(MAKESUPPORT_OUTPUTDIR)/compile-
|
||||
|
||||
TARGETS += $(OUTPUTDIR)/compile_commands.json
|
||||
|
||||
all: $(TARGETS)
|
||||
################################################################################
|
||||
|
||||
.PHONY: all
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -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
|
||||
@ -23,23 +23,17 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# Build demos for the JDK into $(SUPPORT_OUTPUTDIR)/demos/image.
|
||||
################################################################################
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JavaCompilation.gmk
|
||||
include TextFileProcessing.gmk
|
||||
include ZipArchive.gmk
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, CompileDemos-pre.gmk))
|
||||
|
||||
# Prepare the find cache.
|
||||
DEMO_SRC_DIRS += $(TOPDIR)/src/demo
|
||||
|
||||
@ -132,12 +126,19 @@ define SetupBuildDemoBody
|
||||
JARMAIN := $$($1_MAIN_CLASS), \
|
||||
MANIFEST := $(DEMO_MANIFEST), \
|
||||
EXTRA_MANIFEST_ATTR := $$($1_EXTRA_MANIFEST_ATTR), \
|
||||
SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/src.zip, \
|
||||
EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \
|
||||
DISABLED_WARNINGS := $$($1_DISABLED_WARNINGS), \
|
||||
))
|
||||
|
||||
$1 += $$(BUILD_DEMO_$1)
|
||||
|
||||
$$(eval $$(call SetupZipArchive, ZIP_SRC_DEMO_$1, \
|
||||
SRC := $$($1_MAIN_SRC) $$($1_EXTRA_SRC_DIR), \
|
||||
ZIP := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/src.zip, \
|
||||
EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \
|
||||
))
|
||||
|
||||
$1 += $$(ZIP_SRC_DEMO_$1)
|
||||
endif
|
||||
|
||||
# Copy files. Sort is needed to remove duplicates.
|
||||
@ -257,11 +258,8 @@ ifneq ($(filter images, $(MAKECMDGOALS)), )
|
||||
IMAGES_TARGETS := $(COPY_TO_TEST_IMAGE)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, CompileDemos-post.gmk))
|
||||
|
||||
all: $(TARGETS)
|
||||
images: $(IMAGES_TARGETS)
|
||||
|
||||
.PHONY: all
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 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
|
||||
@ -23,11 +23,9 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
# This must be the first rule
|
||||
default: all
|
||||
include MakeFileStart.gmk
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
################################################################################
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JavaCompilation.gmk
|
||||
@ -97,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, \
|
||||
@ -148,5 +148,4 @@ TARGETS += $(BUILD_JAVAC_SERVER)
|
||||
|
||||
################################################################################
|
||||
|
||||
|
||||
all: $(TARGETS)
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 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
|
||||
@ -23,13 +23,12 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
# This must be the first rule
|
||||
default: all
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include Modules.gmk
|
||||
include JavaCompilation.gmk
|
||||
include Modules.gmk
|
||||
|
||||
################################################################################
|
||||
# If this is an imported module that has prebuilt classes, only compile
|
||||
@ -86,7 +85,15 @@ CreateHkTargets = \
|
||||
################################################################################
|
||||
# Include module specific build settings
|
||||
|
||||
-include Java.gmk
|
||||
THIS_SNIPPET := $(call GetModuleSnippetName, Java)
|
||||
|
||||
ifneq ($(wildcard $(THIS_SNIPPET)), )
|
||||
include MakeSnippetStart.gmk
|
||||
|
||||
include $(THIS_SNIPPET)
|
||||
|
||||
include MakeSnippetEnd.gmk
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Setup the main compilation
|
||||
@ -106,7 +113,9 @@ $(eval $(call SetupJavaCompilation, $(MODULE), \
|
||||
DISABLED_WARNINGS := $(DISABLED_WARNINGS_java), \
|
||||
EXCLUDES := $(EXCLUDES), \
|
||||
EXCLUDE_FILES := $(EXCLUDE_FILES), \
|
||||
EXCLUDE_PATTERNS := -files, \
|
||||
KEEP_ALL_TRANSLATIONS := $(KEEP_ALL_TRANSLATIONS), \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE), \
|
||||
JAVAC_FLAGS := \
|
||||
$(DOCLINT) \
|
||||
$(JAVAC_FLAGS) \
|
||||
@ -148,6 +157,4 @@ endif
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
.PHONY: all
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 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
|
||||
@ -23,14 +23,12 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
include JavaCompilation.gmk
|
||||
|
||||
TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes
|
||||
|
||||
# When using an external BUILDJDK, make it possible to shortcut building of
|
||||
@ -64,4 +62,4 @@ TARGETS += $(BUILD_JIGSAW_TOOLS)
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(TARGETS)
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2020, 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
|
||||
@ -23,19 +23,12 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
# This must be the first rule
|
||||
default: all
|
||||
include MakeFileStart.gmk
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
################################################################################
|
||||
|
||||
include JavaCompilation.gmk
|
||||
|
||||
TARGETS :=
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, hotspot/CompileTools.gmk))
|
||||
|
||||
################################################################################
|
||||
# Build tools needed for the JFR source code generation
|
||||
|
||||
@ -51,7 +44,6 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_HOTSPOT, \
|
||||
|
||||
TARGETS += $(BUILD_TOOLS_HOTSPOT)
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
.PHONY: all
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -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
|
||||
@ -23,21 +23,14 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
include MakeFileStart.gmk
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
################################################################################
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JavaCompilation.gmk
|
||||
include TextFileProcessing.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
$(eval $(call IncludeCustomExtension, CompileTools.gmk))
|
||||
|
||||
################################################################################
|
||||
|
||||
# Use += to be able to add to this from a custom extension
|
||||
BUILD_TOOLS_SRC_DIRS += \
|
||||
$(TOPDIR)/make/jdk/src/classes \
|
||||
@ -160,4 +153,6 @@ ifeq ($(ENABLE_PANDOC), true)
|
||||
TARGETS += $(PANDOC_HTML_MANPAGE_FILTER_SETUP)
|
||||
endif
|
||||
|
||||
all: $(TARGETS)
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 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
|
||||
@ -23,13 +23,12 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# This makefile is called for every imported module to copy the non class
|
||||
# contents into the exploded jdk image.
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
################################################################################
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
@ -103,4 +102,6 @@ ifneq ($(CONF_DIR), )
|
||||
TARGETS += $(COPY_CONF)
|
||||
endif
|
||||
|
||||
all: $(TARGETS)
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2019, 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
|
||||
@ -23,15 +23,12 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
include CopyFiles.gmk
|
||||
|
||||
### TZDB tool needs files from java.time.zone package
|
||||
|
||||
define tzdb_copyfiles
|
||||
@ -51,3 +48,7 @@ $(eval $(call SetupCopyFiles, COPY_INTERIM_TZDB, \
|
||||
################################################################################
|
||||
|
||||
all: $(COPY_INTERIM_TZDB)
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2018, 2019, 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
|
||||
@ -22,8 +22,7 @@
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
@ -35,23 +34,33 @@ 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.internal.org.objectweb.**' \
|
||||
-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)
|
||||
|
||||
jcov-image: $(JCOV_IMAGE_DIR)/release
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 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
|
||||
@ -23,10 +23,9 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
include MakeFileStart.gmk
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
################################################################################
|
||||
|
||||
include CopyFiles.gmk
|
||||
include Execute.gmk
|
||||
@ -36,8 +35,6 @@ ifeq ($(MODULE), )
|
||||
$(error MODULE must be set when calling CreateJmods.gmk)
|
||||
endif
|
||||
|
||||
$(eval $(call IncludeCustomExtension, CreateJmods.gmk))
|
||||
|
||||
################################################################################
|
||||
|
||||
JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods
|
||||
@ -187,7 +184,15 @@ endif
|
||||
################################################################################
|
||||
# Include module specific build settings
|
||||
|
||||
-include Jmod.gmk
|
||||
THIS_SNIPPET := $(call GetModuleSnippetName, Jmod)
|
||||
|
||||
ifneq ($(wildcard $(THIS_SNIPPET)), )
|
||||
include MakeSnippetStart.gmk
|
||||
|
||||
include $(THIS_SNIPPET)
|
||||
|
||||
include MakeSnippetEnd.gmk
|
||||
endif
|
||||
|
||||
# Set main class
|
||||
ifneq ($(JMOD_FLAGS_main_class), )
|
||||
@ -252,6 +257,7 @@ $(eval $(call SetupExecute, create_$(JMOD_FILE), \
|
||||
WARN := Creating $(INTERIM_MSG)$(JMOD_FILE), \
|
||||
DEPS := $(DEPS), \
|
||||
OUTPUT_FILE := $(JMODS_DIR)/$(JMOD_FILE), \
|
||||
WORKING_DIR := $(WORKSPACE_ROOT), \
|
||||
SUPPORT_DIR := $(JMODS_SUPPORT_DIR), \
|
||||
PRE_COMMAND := $(RM) $(JMODS_DIR)/$(JMOD_FILE) $(JMODS_SUPPORT_DIR)/$(JMOD_FILE), \
|
||||
COMMAND := $(JMOD) $(JMOD_SMALL_FLAGS) create --module-version $(VERSION_SHORT) \
|
||||
@ -266,6 +272,4 @@ TARGETS += $(create_$(JMOD_FILE))
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
################################################################################
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1997, 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
|
||||
@ -22,26 +22,7 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include Execute.gmk
|
||||
include Modules.gmk
|
||||
include ModuleTools.gmk
|
||||
include ProcessMarkdown.gmk
|
||||
include ToolsJdk.gmk
|
||||
include ZipArchive.gmk
|
||||
include TextFileProcessing.gmk
|
||||
|
||||
# This is needed to properly setup DOCS_MODULES.
|
||||
$(eval $(call ReadImportMetaData))
|
||||
|
||||
################################################################################
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, Docs.gmk))
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# This file generates all documentation for OpenJDK.
|
||||
@ -54,7 +35,19 @@ $(eval $(call IncludeCustomExtension, Docs.gmk))
|
||||
#
|
||||
# We will also generate separate, free-standing specifications from either
|
||||
# markdown or existing html files.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
include CopyFiles.gmk
|
||||
include Execute.gmk
|
||||
include Modules.gmk
|
||||
include ProcessMarkdown.gmk
|
||||
include TextFileProcessing.gmk
|
||||
include ZipArchive.gmk
|
||||
include $(TOPDIR)/make/ModuleTools.gmk
|
||||
include $(TOPDIR)/make/ToolsJdk.gmk
|
||||
|
||||
# This is needed to properly setup DOCS_MODULES.
|
||||
$(eval $(call ReadImportMetaData))
|
||||
|
||||
################################################################################
|
||||
# Javadoc settings
|
||||
@ -99,23 +92,17 @@ 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 \
|
||||
-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 \
|
||||
--no-external-specs-page
|
||||
--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 \
|
||||
-encoding ISO-8859-1 -breakiterator -splitIndex --system none \
|
||||
-html5 -javafx --expand-requires transitive \
|
||||
--no-external-specs-page
|
||||
-serialwarn -encoding utf-8 -breakiterator -splitIndex --system none \
|
||||
-html5 -javafx --expand-requires transitive
|
||||
|
||||
# Should we add DRAFT stamps to the generated javadoc?
|
||||
ifeq ($(VERSION_IS_GA), true)
|
||||
@ -249,8 +236,8 @@ define create_overview_file
|
||||
#
|
||||
ifneq ($$($1_GROUPS), )
|
||||
$1_OVERVIEW_TEXT += \
|
||||
<p>This document is divided into \
|
||||
$$(subst 2,two,$$(subst 3,three,$$(words $$($1_GROUPS)))) sections:</p> \
|
||||
<p>This document has \
|
||||
$$(subst 2,two,$$(subst 3,three,$$(words $$($1_GROUPS)))) major sections:</p> \
|
||||
<blockquote><dl> \
|
||||
#
|
||||
$1_OVERVIEW_TEXT += $$(foreach g, $$($1_GROUPS), \
|
||||
@ -259,7 +246,10 @@ define create_overview_file
|
||||
)
|
||||
$1_OVERVIEW_TEXT += \
|
||||
</dl></blockquote> \
|
||||
#
|
||||
<p><a href="../specs/index.html">Related documents</a> specify the Java \
|
||||
programming language, the Java Virtual Machine, various protocols and file \
|
||||
formats pertaining to the Java platform, and tools included in the JDK.</p> \
|
||||
#
|
||||
endif
|
||||
$1_OVERVIEW_TEXT += \
|
||||
</body></html> \
|
||||
@ -273,7 +263,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
|
||||
|
||||
################################################################################
|
||||
@ -331,7 +321,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)<br>Version $$(VERSION_SPECIFICATION) API \
|
||||
Specification
|
||||
@ -551,7 +543,9 @@ $(eval $(call SetupApiDocsGeneration, REFERENCE_API, \
|
||||
# Format: space-delimited list of names, including at most one '%' as a
|
||||
# wildcard. Spec source files match if their filename or any enclosing folder
|
||||
# name matches one of the items in SPEC_FILTER.
|
||||
SPEC_FILTER := %
|
||||
ifeq ($(SPEC_FILTER), )
|
||||
SPEC_FILTER := %
|
||||
endif
|
||||
|
||||
ApplySpecFilter = \
|
||||
$(strip $(foreach file, $(1), \
|
||||
@ -682,7 +676,7 @@ ifeq ($(ENABLE_PANDOC), true)
|
||||
|
||||
$(foreach m, $(ALL_MODULES), \
|
||||
$(eval MAN_$m := $(call ApplySpecFilter, $(filter %.md, $(call FindFiles, \
|
||||
$(call FindModuleManDirs, $m))))) \
|
||||
$(call FindModuleManDirsForDocs, $m))))) \
|
||||
$(if $(MAN_$m), \
|
||||
$(eval $(call SetupProcessMarkdown, MAN_TO_HTML_$m, \
|
||||
FILES := $(MAN_$m), \
|
||||
@ -763,10 +757,6 @@ $(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
|
||||
|
||||
ZIP_TARGETS += $(BUILD_JAVADOC_ZIP)
|
||||
|
||||
################################################################################
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, Docs-post.gmk))
|
||||
|
||||
################################################################################
|
||||
# Bundles all generated specs into a zip archive, skipping javadocs.
|
||||
|
||||
@ -808,7 +798,11 @@ all: docs-jdk-api-javadoc docs-jdk-api-graphs docs-javase-api-javadoc \
|
||||
docs-reference-api-graphs docs-jdk-specs docs-jdk-index docs-zip \
|
||||
docs-specs-zip
|
||||
|
||||
.PHONY: default all docs-jdk-api-javadoc docs-jdk-api-graphs \
|
||||
.PHONY: docs-jdk-api-javadoc docs-jdk-api-graphs \
|
||||
docs-javase-api-javadoc docs-javase-api-graphs \
|
||||
docs-reference-api-javadoc docs-reference-api-graphs docs-jdk-specs \
|
||||
docs-jdk-index docs-zip docs-specs-zip
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 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
|
||||
@ -23,18 +23,11 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, Doctor.gmk))
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Help user diagnose possible errors and problems with the build environment.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
prologue:
|
||||
$(ECHO)
|
||||
@ -145,4 +138,8 @@ doctor: $(TARGETS)
|
||||
|
||||
all: doctor
|
||||
|
||||
.PHONY: default all doctor $(TARGETS)
|
||||
.PHONY: doctor $(TARGETS)
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2019, 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
|
||||
@ -23,16 +23,14 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
# Runs a tool on the exploded image to improve performance
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include Execute.gmk
|
||||
include $(TOPDIR)/make/ModuleTools.gmk
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# Runs a tool on the exploded image to improve performance
|
||||
################################################################################
|
||||
|
||||
include Execute.gmk
|
||||
include $(TOPDIR)/make/ModuleTools.gmk
|
||||
|
||||
ALL_MODULEINFO_CLASSES := $(wildcard $(JDK_OUTPUTDIR)/modules/*/module-info.class)
|
||||
|
||||
@ -47,6 +45,4 @@ TARGETS := $(optimize_image_TARGET)
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
.PHONY: all default
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
38
make/GenerateFindTests.gmk
Normal file
38
make/GenerateFindTests.gmk
Normal file
@ -0,0 +1,38 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# This makefile is a thin wrapper around FindTests.gmk, just to make FindTest
|
||||
# fill the cache.
|
||||
################################################################################
|
||||
|
||||
GENERATE_FIND_TESTS_FILE := true
|
||||
include FindTests.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
@ -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
|
||||
@ -23,15 +23,12 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# Generate classlist
|
||||
################################################################################
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JavaCompilation.gmk
|
||||
|
||||
@ -79,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 \
|
||||
@ -90,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) \
|
||||
@ -103,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 > $@
|
||||
|
||||
@ -148,4 +153,4 @@ TARGETS += $(COPY_JLI_TRACE)
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(TARGETS)
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 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
|
||||
@ -23,12 +23,11 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
# Default target declared first
|
||||
default: all
|
||||
include MakeFileStart.gmk
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include ModuleTools.gmk
|
||||
################################################################################
|
||||
|
||||
include $(TOPDIR)/make/ModuleTools.gmk
|
||||
|
||||
GENGRAPHS_DIR := $(IMAGES_OUTPUTDIR)/gengraphs
|
||||
SPEC_DOTFILES_DIR := $(GENGRAPHS_DIR)/spec-dotfiles
|
||||
@ -50,3 +49,7 @@ $(GENGRAPHS_DIR)/module-summary.html: $(BUILD_JIGSAW_TOOLS) $(GENGRAPHS_DIR)/tec
|
||||
$(TOOL_MODULESUMMARY) -o $@ --module-path $(IMAGES_OUTPUTDIR)/jmods
|
||||
|
||||
all: $(GENGRAPHS_DIR)/jdk.dot $(GENGRAPHS_DIR)/module-summary.html $(SPEC_DOTFILES_DIR)/java.se.dot
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 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
|
||||
@ -102,12 +102,13 @@ help:
|
||||
$(info $(_) # method is 'auto', 'ignore' or 'fail' (default))
|
||||
$(info $(_) TEST="test1 ..." # Use the given test descriptor(s) for testing, e.g.)
|
||||
$(info $(_) # make test TEST="jdk_lang gtest:all")
|
||||
$(info $(_) TEST_DEPS="dependency1 ..." # Specify additional dependencies for running tests, e.g docs-jdk
|
||||
$(info $(_) TEST_DEPS="dependency1 ..." # Specify additional dependencies for running tests, e.g docs-jdk)
|
||||
$(info $(_) JTREG="OPT1=x;OPT2=y" # Control the JTREG test harness, use 'make test-only JTREG=help' to list)
|
||||
$(info $(_) GTEST="OPT1=x;OPT2=y" # Control the GTEST test harness, use 'make test-only GTEST=help' to list)
|
||||
$(info $(_) MICRO="OPT1=x;OPT2=y" # Control the MICRO test harness, use 'make test-only MICRO=help' to list)
|
||||
$(info $(_) TEST_OPTS="OPT1=x;..." # Generic control of all test harnesses)
|
||||
$(info $(_) TEST_VM_OPTS="ARG ..." # Same as setting TEST_OPTS to VM_OPTIONS="ARG ...")
|
||||
$(info $(_) ALLOW="FOO,BAR" # Do not warn that FOO and BAR are non-control variables)
|
||||
$(info )
|
||||
$(if $(all_confs), $(info Available configurations in $(build_dir):) $(foreach var,$(all_confs),$(info * $(var))), \
|
||||
$(info No configurations were found in $(build_dir).) $(info Run 'bash configure' to create a configuration.))
|
||||
@ -120,12 +121,12 @@ print-configurations:
|
||||
@true
|
||||
|
||||
test-prebuilt:
|
||||
@( cd $(topdir) && \
|
||||
@( cd $(TOPDIR) && \
|
||||
$(MAKE) --no-print-directory -r -R -I make/common/ -f make/RunTestsPrebuilt.gmk \
|
||||
test-prebuilt CUSTOM_MAKE_DIR=$(CUSTOM_MAKE_DIR) TEST="$(TEST)" )
|
||||
|
||||
test-prebuilt-with-exit-code:
|
||||
@( cd $(topdir) && \
|
||||
@( cd $(TOPDIR) && \
|
||||
$(MAKE) --no-print-directory -r -R -I make/common/ -f make/RunTestsPrebuilt.gmk \
|
||||
test-prebuilt-with-exit-code CUSTOM_MAKE_DIR=$(CUSTOM_MAKE_DIR) TEST="$(TEST)" )
|
||||
|
||||
|
||||
@ -23,19 +23,14 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
# This makefile creates a jdk image overlaid with statically linked core
|
||||
# libraries.
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# This makefile creates a jdk image overlaid with statically linked core
|
||||
# libraries.
|
||||
################################################################################
|
||||
|
||||
TARGETS :=
|
||||
include CopyFiles.gmk
|
||||
|
||||
$(eval $(call SetupCopyFiles, COPY_JDK_IMG, \
|
||||
SRC := $(JDK_IMAGE_DIR)/, \
|
||||
@ -54,6 +49,4 @@ TARGETS += $(COPY_STATIC_LIBS)
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
.PHONY: all
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2020, 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
|
||||
@ -23,17 +23,14 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JdkNativeCompilation.gmk
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# This makefile compiles and installs the hsdis library
|
||||
#
|
||||
################################################################################
|
||||
|
||||
include JdkNativeCompilation.gmk
|
||||
|
||||
HSDIS_OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/hsdis
|
||||
REAL_HSDIS_NAME := hsdis-$(OPENJDK_TARGET_CPU_LEGACY_LIB)$(SHARED_LIBRARY_SUFFIX)
|
||||
BUILT_HSDIS_LIB := $(HSDIS_OUTPUT_DIR)/$(REAL_HSDIS_NAME)
|
||||
@ -201,8 +198,8 @@ endif
|
||||
|
||||
TARGETS += install
|
||||
|
||||
.PHONY: build install
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
.PHONY: all default build install
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 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
|
||||
@ -23,12 +23,12 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
include MakeFileStart.gmk
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
################################################################################
|
||||
|
||||
include CopyFiles.gmk
|
||||
include DebugInfoUtils.gmk
|
||||
include Execute.gmk
|
||||
include Modules.gmk
|
||||
include Utils.gmk
|
||||
@ -36,9 +36,6 @@ include Utils.gmk
|
||||
JDK_TARGETS :=
|
||||
JRE_TARGETS :=
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, Images-pre.gmk))
|
||||
|
||||
################################################################################
|
||||
|
||||
# All modules for the current target platform.
|
||||
@ -96,6 +93,14 @@ JLINK_DISABLE_WARNINGS := | ( $(GREP) -v -e "WARNING: Using incubator module" ||
|
||||
JDK_IMAGE_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk
|
||||
JRE_IMAGE_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre
|
||||
|
||||
ifeq ($(JLINK_PRODUCE_LINKABLE_RUNTIME), true)
|
||||
JLINK_JDK_EXTRA_OPTS += --generate-linkable-runtime
|
||||
endif
|
||||
|
||||
ifneq ($(JLINK_USER_EXTRA_FLAGS), )
|
||||
JLINK_JDK_EXTRA_OPTS += $(JLINK_USER_EXTRA_FLAGS)
|
||||
endif
|
||||
|
||||
$(eval $(call SetupExecute, jlink_jdk, \
|
||||
WARN := Creating jdk image, \
|
||||
DEPS := $(JDK_JMODS) $(BASE_RELEASE_FILE) \
|
||||
@ -132,10 +137,16 @@ CDS_DUMP_FLAGS = -Xmx128M -Xms128M
|
||||
# Helper function for creating the CDS archives for the JDK and JRE
|
||||
#
|
||||
# Param1 - VM variant (e.g., server, client, zero, ...)
|
||||
# Param2 - _nocoops, or empty
|
||||
# Param2 - _nocoops, _coh, _nocoops_coh, or empty
|
||||
define CreateCDSArchive
|
||||
$1_$2_DUMP_EXTRA_ARG := $(if $(filter _nocoops, $2), -XX:-UseCompressedOops, )
|
||||
$1_$2_DUMP_TYPE := $(if $(filter _nocoops, $2), -NOCOOPS, )
|
||||
$1_$2_COOPS_OPTION := $(if $(findstring _nocoops, $2),-XX:-UseCompressedOops)
|
||||
# enable and also explicitly disable coh as needed.
|
||||
ifeq ($(call isTargetCpuBits, 64), true)
|
||||
$1_$2_COH_OPTION := -XX:+UnlockExperimentalVMOptions \
|
||||
$(if $(findstring _coh, $2),-XX:+UseCompactObjectHeaders,-XX:-UseCompactObjectHeaders)
|
||||
endif
|
||||
$1_$2_DUMP_EXTRA_ARG := $$($1_$2_COOPS_OPTION) $$($1_$2_COH_OPTION)
|
||||
$1_$2_DUMP_TYPE := $(if $(findstring _nocoops, $2),-NOCOOPS,)$(if $(findstring _coh, $2),-COH,)
|
||||
|
||||
# Only G1 supports dumping the shared heap, so explicitly use G1 if the JVM supports it.
|
||||
$1_$2_CDS_DUMP_FLAGS := $(CDS_DUMP_FLAGS) $(if $(filter g1gc, $(JVM_FEATURES_$1)), -XX:+UseG1GC)
|
||||
@ -151,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, \
|
||||
@ -190,6 +201,14 @@ ifeq ($(BUILD_CDS_ARCHIVE), true)
|
||||
$(foreach v, $(JVM_VARIANTS), \
|
||||
$(eval $(call CreateCDSArchive,$v,_nocoops)) \
|
||||
)
|
||||
ifeq ($(BUILD_CDS_ARCHIVE_COH), true)
|
||||
$(foreach v, $(JVM_VARIANTS), \
|
||||
$(eval $(call CreateCDSArchive,$v,_coh)) \
|
||||
)
|
||||
$(foreach v, $(JVM_VARIANTS), \
|
||||
$(eval $(call CreateCDSArchive,$v,_nocoops_coh)) \
|
||||
)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -251,6 +270,7 @@ endif
|
||||
# Since debug symbols are not included in the jmod files, they need to be copied
|
||||
# in manually after generating the images.
|
||||
|
||||
# These variables are read by SetupCopyDebuginfo
|
||||
ALL_JDK_MODULES := $(JDK_MODULES)
|
||||
ALL_JRE_MODULES := $(sort $(JRE_MODULES), $(foreach m, $(JRE_MODULES), \
|
||||
$(call FindTransitiveDepsForModule, $m)))
|
||||
@ -263,27 +283,6 @@ else
|
||||
endif
|
||||
CMDS_TARGET_SUBDIR := bin
|
||||
|
||||
# Param 1 - dir to find debuginfo files in
|
||||
FindDebuginfoFiles = \
|
||||
$(wildcard $(addprefix $1/*, $(DEBUGINFO_SUFFIXES)) \
|
||||
$(addprefix $1/*/*, $(DEBUGINFO_SUFFIXES)) \
|
||||
$(addprefix $1/*/*/*, $(DEBUGINFO_SUFFIXES)))
|
||||
|
||||
# Pick the correct debug info files to copy, either zipped or not.
|
||||
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
|
||||
DEBUGINFO_SUFFIXES += .diz
|
||||
else
|
||||
DEBUGINFO_SUFFIXES := .debuginfo .pdb .map
|
||||
# On Macosx, if debug symbols have not been zipped, find all files inside *.dSYM
|
||||
# dirs.
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
$(call FillFindCache, \
|
||||
$(SUPPORT_OUTPUTDIR)/modules_libs $(SUPPORT_OUTPUTDIR)/modules_cmds)
|
||||
FindDebuginfoFiles = \
|
||||
$(if $(wildcard $1), $(call containing, .dSYM/, $(call FindFiles, $1)))
|
||||
endif
|
||||
endif
|
||||
|
||||
# Param 1 - either JDK or JRE
|
||||
SetupCopyDebuginfo = \
|
||||
$(foreach m, $(ALL_$1_MODULES), \
|
||||
@ -311,12 +310,6 @@ $(call SetupCopyDebuginfo,SYMBOLS)
|
||||
|
||||
################################################################################
|
||||
|
||||
# Include custom post hook here to make it possible to augment the target lists
|
||||
# before actual target prerequisites are declared.
|
||||
$(eval $(call IncludeCustomExtension, Images-post.gmk))
|
||||
|
||||
################################################################################
|
||||
|
||||
$(JRE_TARGETS): $(JLINK_JRE_TARGETS)
|
||||
$(JDK_TARGETS): $(JLINK_JDK_TARGETS)
|
||||
|
||||
@ -326,4 +319,8 @@ symbols: $(SYMBOLS_TARGETS)
|
||||
|
||||
all: jdk jre symbols
|
||||
|
||||
.PHONY: default all jdk jre symbols
|
||||
.PHONY: jdk jre symbols
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
348
make/Init.gmk
348
make/Init.gmk
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 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
|
||||
@ -23,263 +23,78 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# This is the bootstrapping part of the build. This file is included from the
|
||||
# top level Makefile, and is responsible for launching the Main.gmk file with
|
||||
# the proper make and the proper make arguments.
|
||||
# Init.gmk sits between PreInit.gmk and Main.gmk when bootstrapping the build.
|
||||
# It is called from PreInit.gmk, and its main responsibility is to launch
|
||||
# Main.gmk with the proper make and the proper make arguments.
|
||||
# PreMain.gmk has provided us with a proper SPEC. This allows us to use the
|
||||
# value of $(MAKE) for all further make calls.
|
||||
################################################################################
|
||||
|
||||
# This must be the first rule
|
||||
default:
|
||||
.PHONY: default
|
||||
# Our helper functions.
|
||||
include $(TOPDIR)/make/InitSupport.gmk
|
||||
include LogUtils.gmk
|
||||
|
||||
# Inclusion of this pseudo-target will cause make to execute this file
|
||||
# serially, regardless of -j.
|
||||
.NOTPARALLEL:
|
||||
|
||||
ifeq ($(HAS_SPEC), )
|
||||
##############################################################################
|
||||
# This is the default mode. We have not been recursively called with a SPEC.
|
||||
##############################################################################
|
||||
# Parse COMPARE_BUILD (for makefile development)
|
||||
$(eval $(call ParseCompareBuild))
|
||||
|
||||
# Include our helper functions.
|
||||
include $(topdir)/make/InitSupport.gmk
|
||||
# Setup reproducible build environment
|
||||
$(eval $(call SetupReproducibleBuild))
|
||||
|
||||
# Here are "global" targets, i.e. targets that can be executed without having
|
||||
# a configuration. This will define ALL_GLOBAL_TARGETS.
|
||||
include $(topdir)/make/Global.gmk
|
||||
|
||||
# Targets provided by Init.gmk.
|
||||
ALL_INIT_TARGETS := print-modules print-targets print-configuration \
|
||||
print-tests reconfigure pre-compare-build post-compare-build
|
||||
|
||||
# CALLED_TARGETS is the list of targets that the user provided,
|
||||
# or "default" if unspecified.
|
||||
CALLED_TARGETS := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), default)
|
||||
|
||||
# Extract non-global targets that require a spec file.
|
||||
CALLED_SPEC_TARGETS := $(filter-out $(ALL_GLOBAL_TARGETS), $(CALLED_TARGETS))
|
||||
|
||||
# If we have only global targets, or if we are called with -qp (assuming an
|
||||
# external part, e.g. bash completion, is trying to understand our targets),
|
||||
# we will skip SPEC location and the sanity checks.
|
||||
ifeq ($(CALLED_SPEC_TARGETS), )
|
||||
ONLY_GLOBAL_TARGETS := true
|
||||
endif
|
||||
ifeq ($(findstring p, $(MAKEFLAGS))$(findstring q, $(MAKEFLAGS)), pq)
|
||||
ONLY_GLOBAL_TARGETS := true
|
||||
endif
|
||||
|
||||
ifeq ($(ONLY_GLOBAL_TARGETS), true)
|
||||
############################################################################
|
||||
# We have only global targets, or are called with -pq.
|
||||
############################################################################
|
||||
|
||||
ifeq ($(wildcard $(SPEC)), )
|
||||
# If we have no SPEC provided, we will just make a "best effort" target list.
|
||||
# First try to grab any available pre-existing main-targets.gmk.
|
||||
main_targets_file := $(firstword $(wildcard $(build_dir)/*/make-support/main-targets.gmk))
|
||||
ifneq ($(main_targets_file), )
|
||||
# Extract the SPEC that corresponds to this main-targets.gmk file.
|
||||
SPEC := $(patsubst %/make-support/main-targets.gmk, %/spec.gmk, $(main_targets_file))
|
||||
else
|
||||
# None found, pick an arbitrary SPEC for which to generate a file
|
||||
SPEC := $(firstword $(all_spec_files))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard $(SPEC)), )
|
||||
$(eval $(call DefineMainTargets, LAZY, $(SPEC)))
|
||||
else
|
||||
# If we have no configurations we can not provide any main targets.
|
||||
ALL_MAIN_TARGETS :=
|
||||
endif
|
||||
|
||||
ALL_TARGETS := $(sort $(ALL_GLOBAL_TARGETS) $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS))
|
||||
|
||||
# Just list all our targets.
|
||||
$(ALL_TARGETS):
|
||||
|
||||
.PHONY: $(ALL_TARGETS)
|
||||
|
||||
else
|
||||
############################################################################
|
||||
# This is the normal case, we have been called from the command line by the
|
||||
# user and we need to call ourself back with a proper SPEC.
|
||||
# We have at least one non-global target, so we need to find a spec file.
|
||||
############################################################################
|
||||
|
||||
# Basic checks on environment and command line.
|
||||
$(eval $(call CheckControlVariables))
|
||||
$(eval $(call CheckDeprecatedEnvironment))
|
||||
$(eval $(call CheckInvalidMakeFlags))
|
||||
|
||||
# Check that CONF_CHECK is valid.
|
||||
$(eval $(call ParseConfCheckOption))
|
||||
|
||||
# Check that the LOG given is valid, and set LOG_LEVEL, LOG_NOFILE, MAKE_LOG_VARS and MAKE_LOG_FLAGS.
|
||||
# If no LOG= was given on command line, but we have a non-standard default
|
||||
# value, use that instead and re-parse log level.
|
||||
ifeq ($(LOG), )
|
||||
ifneq ($(DEFAULT_LOG), )
|
||||
override LOG := $(DEFAULT_LOG)
|
||||
$(eval $(call ParseLogLevel))
|
||||
|
||||
# After this SPECS contain 1..N spec files (otherwise ParseConfAndSpec fails).
|
||||
$(eval $(call ParseConfAndSpec))
|
||||
|
||||
# Extract main targets from Main.gmk using the spec(s) provided. In theory,
|
||||
# with multiple specs, we should find the intersection of targets provided
|
||||
# by all specs, but we approximate this by an arbitrary spec from the list.
|
||||
# This will setup ALL_MAIN_TARGETS.
|
||||
$(eval $(call DefineMainTargets, FORCE, $(firstword $(SPECS))))
|
||||
|
||||
# Separate called targets depending on type.
|
||||
INIT_TARGETS := $(filter $(ALL_INIT_TARGETS), $(CALLED_SPEC_TARGETS))
|
||||
MAIN_TARGETS := $(filter $(ALL_MAIN_TARGETS), $(CALLED_SPEC_TARGETS))
|
||||
SEQUENTIAL_TARGETS := $(filter dist-clean clean%, $(MAIN_TARGETS))
|
||||
PARALLEL_TARGETS := $(filter-out $(SEQUENTIAL_TARGETS), $(MAIN_TARGETS))
|
||||
|
||||
# The spec files depend on the autoconf source code. This check makes sure
|
||||
# the configuration is up to date after changes to configure.
|
||||
$(SPECS): $(wildcard $(topdir)/make/autoconf/*) \
|
||||
$(if $(CUSTOM_CONFIG_DIR), $(wildcard $(CUSTOM_CONFIG_DIR)/*)) \
|
||||
$(addprefix $(topdir)/make/conf/, version-numbers.conf branding.conf) \
|
||||
$(if $(CUSTOM_CONF_DIR), $(wildcard $(addprefix $(CUSTOM_CONF_DIR)/, \
|
||||
version-numbers.conf branding.conf)))
|
||||
ifeq ($(CONF_CHECK), fail)
|
||||
@echo Error: The configuration is not up to date for \
|
||||
"'$(lastword $(subst /, , $(dir $@)))'."
|
||||
$(call PrintConfCheckFailed)
|
||||
@exit 2
|
||||
else ifeq ($(CONF_CHECK), auto)
|
||||
@echo Note: The configuration is not up to date for \
|
||||
"'$(lastword $(subst /, , $(dir $@)))'."
|
||||
@( cd $(topdir) && \
|
||||
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \
|
||||
SPEC=$@ HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \
|
||||
reconfigure )
|
||||
else ifeq ($(CONF_CHECK), ignore)
|
||||
# Do nothing
|
||||
endif
|
||||
|
||||
# Do not let make delete spec files even if aborted while doing a reconfigure
|
||||
.PRECIOUS: $(SPECS)
|
||||
|
||||
# Unless reconfigure is explicitly called, let all main targets depend on
|
||||
# the spec files to be up to date.
|
||||
ifeq ($(findstring reconfigure, $(INIT_TARGETS)), )
|
||||
$(MAIN_TARGETS): $(SPECS)
|
||||
endif
|
||||
|
||||
make-info:
|
||||
ifneq ($(findstring $(LOG_LEVEL), info debug trace), )
|
||||
$(info Running make as '$(strip $(MAKE) $(MFLAGS) \
|
||||
$(COMMAND_LINE_VARIABLES) $(MAKECMDGOALS))')
|
||||
endif
|
||||
|
||||
MAKE_INIT_WITH_SPEC_ARGUMENTS := ACTUAL_TOPDIR=$(topdir) \
|
||||
USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \
|
||||
$(MAKE_LOG_VARS) \
|
||||
INIT_TARGETS="$(INIT_TARGETS)" \
|
||||
SEQUENTIAL_TARGETS="$(SEQUENTIAL_TARGETS)" \
|
||||
PARALLEL_TARGETS="$(PARALLEL_TARGETS)"
|
||||
|
||||
# Now the init and main targets will be called, once for each SPEC. The
|
||||
# recipe will be run once for every target specified, but we only want to
|
||||
# execute the recipe a single time, hence the TARGET_DONE with a dummy
|
||||
# command if true.
|
||||
# The COMPARE_BUILD part implements special support for makefile development.
|
||||
$(ALL_INIT_TARGETS) $(ALL_MAIN_TARGETS): make-info
|
||||
@$(if $(TARGET_DONE), \
|
||||
true \
|
||||
, \
|
||||
( cd $(topdir) && \
|
||||
$(foreach spec, $(SPECS), \
|
||||
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/Init.gmk \
|
||||
SPEC=$(spec) HAS_SPEC=true $(MAKE_INIT_WITH_SPEC_ARGUMENTS) \
|
||||
main && \
|
||||
$(if $(and $(COMPARE_BUILD), $(PARALLEL_TARGETS)), \
|
||||
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \
|
||||
SPEC=$(spec) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \
|
||||
COMPARE_BUILD="$(COMPARE_BUILD)" pre-compare-build && \
|
||||
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/Init.gmk \
|
||||
SPEC=$(spec) HAS_SPEC=true $(MAKE_INIT_WITH_SPEC_ARGUMENTS) \
|
||||
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" main && \
|
||||
$(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \
|
||||
SPEC=$(spec) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \
|
||||
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" post-compare-build && \
|
||||
) \
|
||||
) true ) \
|
||||
$(eval TARGET_DONE=true) \
|
||||
)
|
||||
|
||||
.PHONY: $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS)
|
||||
|
||||
endif # $(ONLY_GLOBAL_TARGETS)!=true
|
||||
|
||||
else # HAS_SPEC=true
|
||||
|
||||
##############################################################################
|
||||
# Now we have a spec. This part provides the "main" target that acts as a
|
||||
# trampoline to call the Main.gmk with the value of $(MAKE) found in the spec
|
||||
# file.
|
||||
##############################################################################
|
||||
|
||||
include $(SPEC)
|
||||
|
||||
# Our helper functions.
|
||||
include $(TOPDIR)/make/InitSupport.gmk
|
||||
|
||||
# Parse COMPARE_BUILD (for makefile development)
|
||||
$(eval $(call ParseCompareBuild))
|
||||
|
||||
# Setup reproducible build environment
|
||||
$(eval $(call SetupReproducibleBuild))
|
||||
|
||||
# If no LOG= was given on command line, but we have a non-standard default
|
||||
# value, use that instead and re-parse log level.
|
||||
ifeq ($(LOG), )
|
||||
ifneq ($(DEFAULT_LOG), )
|
||||
override LOG := $(DEFAULT_LOG)
|
||||
$(eval $(call ParseLogLevel))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(LOG_NOFILE), true)
|
||||
# Disable build log if LOG=[level,]nofile was given
|
||||
override BUILD_LOG_PIPE :=
|
||||
override BUILD_LOG_PIPE_SIMPLE :=
|
||||
endif
|
||||
ifeq ($(LOG_NOFILE), true)
|
||||
# Disable build log if LOG=[level,]nofile was given
|
||||
override BUILD_LOG_PIPE :=
|
||||
override BUILD_LOG_PIPE_SIMPLE :=
|
||||
endif
|
||||
|
||||
ifeq ($(filter dist-clean, $(SEQUENTIAL_TARGETS)), dist-clean)
|
||||
# We can't have a log file if we're about to remove it.
|
||||
override BUILD_LOG_PIPE :=
|
||||
override BUILD_LOG_PIPE_SIMPLE :=
|
||||
endif
|
||||
ifeq ($(filter dist-clean, $(SEQUENTIAL_TARGETS)), dist-clean)
|
||||
# We can't have a log file if we're about to remove it.
|
||||
override BUILD_LOG_PIPE :=
|
||||
override BUILD_LOG_PIPE_SIMPLE :=
|
||||
endif
|
||||
|
||||
ifeq ($(OUTPUT_SYNC_SUPPORTED), true)
|
||||
OUTPUT_SYNC_FLAG := -O$(OUTPUT_SYNC)
|
||||
endif
|
||||
ifeq ($(OUTPUT_SYNC_SUPPORTED), true)
|
||||
OUTPUT_SYNC_FLAG := -O$(OUTPUT_SYNC)
|
||||
endif
|
||||
|
||||
##############################################################################
|
||||
# Init targets
|
||||
##############################################################################
|
||||
##############################################################################
|
||||
# Init targets. These are handled fully, here and now.
|
||||
##############################################################################
|
||||
|
||||
print-modules:
|
||||
print-modules:
|
||||
( cd $(TOPDIR) && \
|
||||
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
|
||||
NO_RECIPES=true print-modules )
|
||||
|
||||
print-targets:
|
||||
print-targets:
|
||||
( cd $(TOPDIR) && \
|
||||
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
|
||||
NO_RECIPES=true print-targets )
|
||||
|
||||
print-tests:
|
||||
print-tests:
|
||||
( cd $(TOPDIR) && \
|
||||
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
|
||||
NO_RECIPES=true print-tests )
|
||||
|
||||
print-configuration:
|
||||
$(ECHO) $(CONFIGURE_COMMAND_LINE)
|
||||
print-configuration:
|
||||
$(ECHO) $(CONFIGURE_COMMAND_LINE)
|
||||
|
||||
reconfigure:
|
||||
reconfigure:
|
||||
ifneq ($(REAL_CONFIGURE_COMMAND_EXEC_FULL), )
|
||||
$(ECHO) "Re-running configure using original command line '$(REAL_CONFIGURE_COMMAND_EXEC_SHORT) $(REAL_CONFIGURE_COMMAND_LINE)'"
|
||||
$(eval RECONFIGURE_COMMAND := $(REAL_CONFIGURE_COMMAND_EXEC_FULL) $(REAL_CONFIGURE_COMMAND_LINE))
|
||||
@ -295,34 +110,50 @@ else # HAS_SPEC=true
|
||||
CUSTOM_CONFIG_DIR="$(CUSTOM_CONFIG_DIR)" \
|
||||
$(RECONFIGURE_COMMAND) )
|
||||
|
||||
##############################################################################
|
||||
# The main target, for delegating into Main.gmk
|
||||
##############################################################################
|
||||
# Create files that are needed to run most targets in Main.gmk
|
||||
create-make-helpers:
|
||||
( cd $(TOPDIR) && \
|
||||
$(MAKE) $(MAKE_ARGS) -j 1 -f make/GenerateFindTests.gmk \
|
||||
$(USER_MAKE_VARS) )
|
||||
( cd $(TOPDIR) && \
|
||||
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
|
||||
UPDATE_MODULE_DEPS=true NO_RECIPES=true \
|
||||
create-main-targets-include )
|
||||
|
||||
MAIN_TARGETS := $(SEQUENTIAL_TARGETS) $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE)
|
||||
# If building the default target, add what they are to the description.
|
||||
DESCRIPTION_TARGETS := $(strip $(MAIN_TARGETS))
|
||||
ifeq ($(DESCRIPTION_TARGETS), default)
|
||||
DESCRIPTION_TARGETS += ($(DEFAULT_MAKE_TARGET))
|
||||
endif
|
||||
TARGET_DESCRIPTION := target$(if $(word 2, $(MAIN_TARGETS)),s) \
|
||||
'$(strip $(DESCRIPTION_TARGETS))' in configuration '$(CONF_NAME)'
|
||||
.PHONY: print-modules print-targets print-tests print-configuration \
|
||||
reconfigure create-make-helpers
|
||||
|
||||
# MAKEOVERRIDES is automatically set and propagated by Make to sub-Make calls.
|
||||
# We need to clear it of the init-specific variables. The user-specified
|
||||
# variables are explicitly propagated using $(USER_MAKE_VARS).
|
||||
main: MAKEOVERRIDES :=
|
||||
##############################################################################
|
||||
# The main target. This will delegate all other targets into Main.gmk.
|
||||
##############################################################################
|
||||
|
||||
main: $(INIT_TARGETS)
|
||||
MAIN_TARGETS := $(SEQUENTIAL_TARGETS) $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE)
|
||||
# If building the default target, add what they are to the description.
|
||||
DESCRIPTION_TARGETS := $(strip $(MAIN_TARGETS))
|
||||
ifeq ($(DESCRIPTION_TARGETS), default)
|
||||
DESCRIPTION_TARGETS += ($(DEFAULT_MAKE_TARGET))
|
||||
endif
|
||||
TARGET_DESCRIPTION := target$(if $(word 2, $(MAIN_TARGETS)),s) \
|
||||
'$(strip $(DESCRIPTION_TARGETS))' in configuration '$(CONF_NAME)'
|
||||
|
||||
# MAKEOVERRIDES is automatically set and propagated by Make to sub-Make calls.
|
||||
# We need to clear it of the init-specific variables. The user-specified
|
||||
# variables are explicitly propagated using $(USER_MAKE_VARS).
|
||||
main: MAKEOVERRIDES :=
|
||||
|
||||
main: $(INIT_TARGETS) create-make-helpers
|
||||
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.
|
||||
( cd $(TOPDIR) && \
|
||||
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
|
||||
$(SEQUENTIAL_TARGETS) )
|
||||
# We might have cleaned away essential files, recreate them.
|
||||
( cd $(TOPDIR) && \
|
||||
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Init.gmk create-make-helpers )
|
||||
endif
|
||||
ifneq ($(PARALLEL_TARGETS), )
|
||||
$(call PrepareFailureLogs)
|
||||
@ -333,14 +164,15 @@ else # HAS_SPEC=true
|
||||
# treat it as NOT using jobs at all.
|
||||
( cd $(TOPDIR) && \
|
||||
$(NICE) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \
|
||||
$(if $(JOBS), -j $(JOBS)) \
|
||||
$(if $(JOBS), -j $(JOBS)) \
|
||||
-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 \
|
||||
HAS_SPEC=true on-failure ; \
|
||||
on-failure ; \
|
||||
exit $$exitcode ) )
|
||||
$(call CleanupJavacServer)
|
||||
$(call StopGlobalTimer)
|
||||
@ -349,31 +181,35 @@ else # HAS_SPEC=true
|
||||
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
|
||||
|
||||
on-failure:
|
||||
on-failure:
|
||||
$(call CleanupJavacServer)
|
||||
$(call StopGlobalTimer)
|
||||
$(call ReportBuildTimes)
|
||||
$(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
|
||||
|
||||
# Support targets for COMPARE_BUILD, used for makefile development
|
||||
pre-compare-build:
|
||||
# Support targets for COMPARE_BUILD, used for makefile development
|
||||
pre-compare-build:
|
||||
$(call WaitForJavacServerFinish)
|
||||
$(call PrepareCompareBuild)
|
||||
|
||||
post-compare-build:
|
||||
post-compare-build:
|
||||
$(call WaitForJavacServerFinish)
|
||||
$(call CleanupCompareBuild)
|
||||
$(call CompareBuildDoComparison)
|
||||
|
||||
.PHONY: print-targets print-modules reconfigure main on-failure
|
||||
endif
|
||||
.PHONY: main on-failure pre-compare-build post-compare-build
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -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
|
||||
@ -23,396 +23,114 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include MakeIncludeStart.gmk
|
||||
ifeq ($(INCLUDE), true)
|
||||
|
||||
################################################################################
|
||||
# This file contains helper functions for Init.gmk.
|
||||
# It is divided in two parts, depending on if a SPEC is present or not
|
||||
# (HAS_SPEC is true or not).
|
||||
################################################################################
|
||||
|
||||
ifndef _INITSUPPORT_GMK
|
||||
_INITSUPPORT_GMK := 1
|
||||
# Define basic logging setup
|
||||
BUILD_LOG := $(OUTPUTDIR)/build.log
|
||||
BUILD_PROFILE_LOG := $(OUTPUTDIR)/build-profile.log
|
||||
|
||||
ifeq ($(HAS_SPEC), )
|
||||
BUILD_LOG_PIPE := > >($(TEE) -a $(BUILD_LOG)) 2> >($(TEE) -a $(BUILD_LOG) >&2) && wait
|
||||
# Use this for simple echo/printf commands that are never expected to print
|
||||
# to stderr.
|
||||
BUILD_LOG_PIPE_SIMPLE := | $(TEE) -a $(BUILD_LOG)
|
||||
|
||||
# COMMA is defined in spec.gmk, but that is not included yet
|
||||
COMMA := ,
|
||||
|
||||
# Include the corresponding closed file, if present.
|
||||
ifneq ($(CUSTOM_MAKE_DIR), )
|
||||
-include $(CUSTOM_MAKE_DIR)/InitSupport.gmk
|
||||
# Setup the build environment to match the requested specification on
|
||||
# level of reproducible builds
|
||||
define SetupReproducibleBuild
|
||||
ifeq ($$(SOURCE_DATE), updated)
|
||||
# For static values of SOURCE_DATE (not "updated"), these are set in spec.gmk
|
||||
export SOURCE_DATE_EPOCH := $$(shell $$(DATE) +"%s")
|
||||
export SOURCE_DATE_ISO_8601 := $$(call EpochToISO8601, $$(SOURCE_DATE_EPOCH))
|
||||
endif
|
||||
endef
|
||||
|
||||
##############################################################################
|
||||
# Helper functions for the initial part of Init.gmk, before the spec file is
|
||||
# loaded. Most of these functions provide parsing and setting up make options
|
||||
# from the command-line.
|
||||
##############################################################################
|
||||
# Parse COMPARE_BUILD into COMPARE_BUILD_*
|
||||
# Syntax: COMPARE_BUILD=CONF=<configure options>:PATCH=<patch file>:
|
||||
# MAKE=<make targets>:COMP_OPTS=<compare script options>:
|
||||
# COMP_DIR=<compare script base dir>|<default>:
|
||||
# FAIL=<bool>
|
||||
# If neither CONF or PATCH is given, assume <default> means CONF if it
|
||||
# begins with "--", otherwise assume it means PATCH.
|
||||
# MAKE and COMP_OPTS can only be used with CONF and/or PATCH specified.
|
||||
# If any value contains "+", it will be replaced by space.
|
||||
# FAIL can be set to false to have the return value of compare be ignored.
|
||||
define ParseCompareBuild
|
||||
ifneq ($$(COMPARE_BUILD), )
|
||||
COMPARE_BUILD_OUTPUTDIR := $(WORKSPACE_ROOT)/build/compare-build/$(CONF_NAME)
|
||||
COMPARE_BUILD_FAIL := true
|
||||
|
||||
# Make control variables, handled by Init.gmk
|
||||
INIT_CONTROL_VARIABLES += LOG CONF CONF_NAME SPEC JOBS TEST_JOBS CONF_CHECK \
|
||||
COMPARE_BUILD JTREG GTEST MICRO TEST_OPTS TEST_VM_OPTS TEST_DEPS
|
||||
|
||||
# All known make control variables
|
||||
MAKE_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) TEST JDK_FILTER SPEC_FILTER
|
||||
|
||||
# Define a simple reverse function.
|
||||
# Should maybe move to MakeBase.gmk, but we can't include that file now.
|
||||
reverse = \
|
||||
$(if $(strip $(1)), $(call reverse, $(wordlist 2, $(words $(1)), $(1)))) \
|
||||
$(firstword $(1))
|
||||
|
||||
# The variable MAKEOVERRIDES contains variable assignments from the command
|
||||
# line, but in reverse order to what the user entered.
|
||||
# The '§' <=> '\ 'dance is needed to keep values with space in them connected.
|
||||
COMMAND_LINE_VARIABLES := $(subst §,\ , $(call reverse, $(subst \ ,§,$(MAKEOVERRIDES))))
|
||||
|
||||
# A list like FOO="val1" BAR="val2" containing all user-supplied make
|
||||
# variables that we should propagate.
|
||||
# The '§' <=> '\ 'dance is needed to keep values with space in them connected.
|
||||
USER_MAKE_VARS := $(subst §,\ , $(filter-out $(addsuffix =%, $(INIT_CONTROL_VARIABLES)), \
|
||||
$(subst \ ,§,$(MAKEOVERRIDES))))
|
||||
|
||||
# Setup information about available configurations, if any.
|
||||
ifneq ($(CUSTOM_ROOT), )
|
||||
build_dir = $(CUSTOM_ROOT)/build
|
||||
else
|
||||
build_dir = $(topdir)/build
|
||||
endif
|
||||
all_spec_files = $(wildcard $(build_dir)/*/spec.gmk)
|
||||
# Extract the configuration names from the path
|
||||
all_confs = $(patsubst %/spec.gmk, %, $(patsubst $(build_dir)/%, %, $(all_spec_files)))
|
||||
|
||||
# Check for unknown command-line variables
|
||||
define CheckControlVariables
|
||||
command_line_variables := $$(strip $$(foreach var, \
|
||||
$$(subst \ ,_,$$(MAKEOVERRIDES)), \
|
||||
$$(firstword $$(subst =, , $$(var)))))
|
||||
unknown_command_line_variables := $$(strip \
|
||||
$$(filter-out $$(MAKE_CONTROL_VARIABLES), $$(command_line_variables)))
|
||||
ifneq ($$(unknown_command_line_variables), )
|
||||
$$(info Note: Command line contains non-control variables:)
|
||||
$$(foreach var, $$(unknown_command_line_variables), $$(info * $$(var)=$$($$(var))))
|
||||
$$(info Make sure it is not mistyped, and that you intend to override this variable.)
|
||||
$$(info 'make help' will list known control variables.)
|
||||
$$(info )
|
||||
endif
|
||||
endef
|
||||
|
||||
# Check for deprecated ALT_ variables
|
||||
define CheckDeprecatedEnvironment
|
||||
defined_alt_variables := $$(filter ALT_%, $$(.VARIABLES))
|
||||
ifneq ($$(defined_alt_variables), )
|
||||
$$(info Warning: You have the following ALT_ variables set:)
|
||||
$$(foreach var, $$(defined_alt_variables), $$(info * $$(var)=$$($$(var))))
|
||||
$$(info ALT_ variables are deprecated, and may result in a failed build.)
|
||||
$$(info Please clean your environment.)
|
||||
$$(info )
|
||||
endif
|
||||
endef
|
||||
|
||||
# Check for invalid make flags like -j
|
||||
define CheckInvalidMakeFlags
|
||||
# This is a trick to get this rule to execute before any other rules
|
||||
# MAKEFLAGS only indicate -j if read in a recipe (!)
|
||||
$$(topdir)/make/Init.gmk: .FORCE
|
||||
$$(if $$(findstring --jobserver, $$(MAKEFLAGS)), \
|
||||
$$(info Error: 'make -jN' is not supported, use 'make JOBS=N') \
|
||||
$$(error Cannot continue) \
|
||||
)
|
||||
.FORCE:
|
||||
.PHONY: .FORCE
|
||||
endef
|
||||
|
||||
# Check that the CONF_CHECK option is valid and set up handling
|
||||
define ParseConfCheckOption
|
||||
ifeq ($$(CONF_CHECK), )
|
||||
# Default behavior is fail
|
||||
CONF_CHECK := fail
|
||||
else ifneq ($$(filter-out auto fail ignore, $$(CONF_CHECK)), )
|
||||
$$(info Error: CONF_CHECK must be one of: auto, fail or ignore.)
|
||||
$$(error Cannot continue)
|
||||
endif
|
||||
endef
|
||||
|
||||
define ParseConfAndSpec
|
||||
ifneq ($$(origin SPEC), undefined)
|
||||
# We have been given a SPEC, check that it works out properly
|
||||
ifneq ($$(origin CONF), undefined)
|
||||
# We also have a CONF argument. We can't have both.
|
||||
$$(info Error: Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.)
|
||||
$$(error Cannot continue)
|
||||
endif
|
||||
ifneq ($$(origin CONF_NAME), undefined)
|
||||
# We also have a CONF_NAME argument. We can't have both.
|
||||
$$(info Error: Cannot use CONF_NAME=$$(CONF_NAME) and SPEC=$$(SPEC) at the same time. Choose one.)
|
||||
$$(error Cannot continue)
|
||||
endif
|
||||
ifeq ($$(wildcard $$(SPEC)), )
|
||||
$$(info Error: Cannot locate spec.gmk, given by SPEC=$$(SPEC).)
|
||||
$$(error Cannot continue)
|
||||
endif
|
||||
ifeq ($$(filter /%, $$(SPEC)), )
|
||||
# If given with relative path, make it absolute
|
||||
SPECS := $$(CURDIR)/$$(strip $$(SPEC))
|
||||
else
|
||||
SPECS := $$(SPEC)
|
||||
endif
|
||||
|
||||
# For now, unset this SPEC variable.
|
||||
override SPEC :=
|
||||
ifneq ($$(findstring :, $$(COMPARE_BUILD)), )
|
||||
$$(foreach part, $$(subst :, , $$(COMPARE_BUILD)), \
|
||||
$$(if $$(filter PATCH=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_PATCH = $$(strip $$(patsubst PATCH=%, %, $$(part)))) \
|
||||
) \
|
||||
$$(if $$(filter CONF=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(part))))) \
|
||||
) \
|
||||
$$(if $$(filter MAKE=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_MAKE = $$(strip $$(subst +, , $$(patsubst MAKE=%, %, $$(part))))) \
|
||||
) \
|
||||
$$(if $$(filter COMP_OPTS=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_COMP_OPTS = $$(strip $$(subst +, , $$(patsubst COMP_OPTS=%, %, $$(part))))) \
|
||||
) \
|
||||
$$(if $$(filter COMP_DIR=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_COMP_DIR = $$(strip $$(subst +, , $$(patsubst COMP_DIR=%, %, $$(part))))) \
|
||||
) \
|
||||
$$(if $$(filter FAIL=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_FAIL = $$(strip $$(subst +, , $$(patsubst FAIL=%, %, $$(part))))) \
|
||||
) \
|
||||
$$(if $$(filter NODRYRUN=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_NODRYRUN = $$(strip $$(subst +, , $$(patsubst NODRYRUN=%, %, $$(part))))) \
|
||||
) \
|
||||
)
|
||||
else
|
||||
# Use spec.gmk files in the build output directory
|
||||
ifeq ($$(all_spec_files), )
|
||||
ifneq ($(CUSTOM_ROOT), )
|
||||
$$(info Error: No configurations found for $$(CUSTOM_ROOT).)
|
||||
else
|
||||
$$(info Error: No configurations found for $$(topdir).)
|
||||
endif
|
||||
$$(info Please run 'bash configure' to create a configuration.)
|
||||
$$(info )
|
||||
$$(error Cannot continue)
|
||||
endif
|
||||
|
||||
ifneq ($$(origin CONF_NAME), undefined)
|
||||
ifneq ($$(origin CONF), undefined)
|
||||
# We also have a CONF argument. We can't have both.
|
||||
$$(info Error: Cannot use CONF=$$(CONF) and CONF_NAME=$$(CONF_NAME) at the same time. Choose one.)
|
||||
$$(error Cannot continue)
|
||||
endif
|
||||
matching_conf := $$(strip $$(filter $$(CONF_NAME), $$(all_confs)))
|
||||
ifeq ($$(matching_conf), )
|
||||
$$(info Error: No configurations found matching CONF_NAME=$$(CONF_NAME).)
|
||||
$$(info Available configurations in $$(build_dir):)
|
||||
$$(foreach var, $$(all_confs), $$(info * $$(var)))
|
||||
$$(error Cannot continue)
|
||||
else ifneq ($$(words $$(matching_conf)), 1)
|
||||
$$(info Error: Matching more than one configuration CONF_NAME=$$(CONF_NAME).)
|
||||
$$(info Available configurations in $$(build_dir):)
|
||||
$$(foreach var, $$(all_confs), $$(info * $$(var)))
|
||||
$$(error Cannot continue)
|
||||
else
|
||||
$$(info Building configuration '$$(matching_conf)' (matching CONF_NAME=$$(CONF_NAME)))
|
||||
endif
|
||||
# Create a SPEC definition. This will contain the path to exactly one spec file.
|
||||
SPECS := $$(build_dir)/$$(matching_conf)/spec.gmk
|
||||
else ifneq ($$(origin CONF), undefined)
|
||||
# User have given a CONF= argument.
|
||||
ifeq ($$(CONF), )
|
||||
# If given CONF=, match all configurations
|
||||
matching_confs := $$(strip $$(all_confs))
|
||||
else
|
||||
# Otherwise select those that contain the given CONF string
|
||||
ifeq ($$(patsubst !%,,$$(CONF)), )
|
||||
# A CONF starting with ! means we should negate the search term
|
||||
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
|
||||
$$(if $$(findstring $$(subst !,,$$(CONF)), $$(var)), ,$$(var))))
|
||||
else
|
||||
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
|
||||
$$(if $$(findstring $$(CONF), $$(var)), $$(var))))
|
||||
endif
|
||||
ifneq ($$(filter $$(CONF), $$(matching_confs)), )
|
||||
# If we found an exact match, use that
|
||||
matching_confs := $$(CONF)
|
||||
# Don't repeat this output on make restarts caused by including
|
||||
# generated files.
|
||||
ifeq ($$(MAKE_RESTARTS), )
|
||||
$$(info Using exact match for CONF=$$(CONF) (other matches are possible))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
ifeq ($$(matching_confs), )
|
||||
$$(info Error: No configurations found matching CONF=$$(CONF).)
|
||||
$$(info Available configurations in $$(build_dir):)
|
||||
$$(foreach var, $$(all_confs), $$(info * $$(var)))
|
||||
$$(error Cannot continue)
|
||||
else
|
||||
# Don't repeat this output on make restarts caused by including
|
||||
# generated files.
|
||||
ifeq ($$(MAKE_RESTARTS), )
|
||||
ifeq ($$(words $$(matching_confs)), 1)
|
||||
ifneq ($$(findstring $$(LOG_LEVEL), info debug trace), )
|
||||
$$(info Building configuration '$$(matching_confs)' (matching CONF=$$(CONF)))
|
||||
endif
|
||||
else
|
||||
$$(info Building these configurations (matching CONF=$$(CONF)):)
|
||||
$$(foreach var, $$(matching_confs), $$(info * $$(var)))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Create a SPEC definition. This will contain the path to one or more spec.gmk files.
|
||||
SPECS := $$(addsuffix /spec.gmk, $$(addprefix $$(build_dir)/, $$(matching_confs)))
|
||||
# Separate handling for single field case, to allow for spaces in values.
|
||||
ifneq ($$(filter PATCH=%, $$(COMPARE_BUILD)), )
|
||||
COMPARE_BUILD_PATCH = $$(strip $$(patsubst PATCH=%, %, $$(COMPARE_BUILD)))
|
||||
else ifneq ($$(filter CONF=%, $$(COMPARE_BUILD)), )
|
||||
COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(COMPARE_BUILD))))
|
||||
else ifneq ($$(filter --%, $$(COMPARE_BUILD)), )
|
||||
# Assume CONF if value begins with --
|
||||
COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(COMPARE_BUILD)))
|
||||
else
|
||||
# No CONF or SPEC given, check the available configurations
|
||||
ifneq ($$(words $$(all_spec_files)), 1)
|
||||
$$(info Error: No CONF given, but more than one configuration found.)
|
||||
$$(info Available configurations in $$(build_dir):)
|
||||
$$(foreach var, $$(all_confs), $$(info * $$(var)))
|
||||
$$(info Please retry building with CONF=<config pattern> (or SPEC=<spec file>).)
|
||||
$$(info )
|
||||
$$(error Cannot continue)
|
||||
# Otherwise assume patch file
|
||||
COMPARE_BUILD_PATCH = $$(strip $$(COMPARE_BUILD))
|
||||
endif
|
||||
endif
|
||||
ifneq ($$(COMPARE_BUILD_PATCH), )
|
||||
ifneq ($$(wildcard $$(WORKSPACE_ROOT)/$$(COMPARE_BUILD_PATCH)), )
|
||||
# Assume relative path, if file exists
|
||||
COMPARE_BUILD_PATCH := $$(wildcard $$(WORKSPACE_ROOT)/$$(COMPARE_BUILD_PATCH))
|
||||
else ifeq ($$(wildcard $$(COMPARE_BUILD_PATCH)), )
|
||||
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not exist)
|
||||
endif
|
||||
ifneq ($$(COMPARE_BUILD_NODRYRUN), true)
|
||||
PATCH_DRY_RUN := $$(shell cd $$(WORKSPACE_ROOT) && $$(PATCH) --dry-run -p1 < $$(COMPARE_BUILD_PATCH) > /dev/null 2>&1 || $$(ECHO) FAILED)
|
||||
ifeq ($$(PATCH_DRY_RUN), FAILED)
|
||||
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not apply cleanly)
|
||||
endif
|
||||
|
||||
# We found exactly one configuration, use it
|
||||
SPECS := $$(strip $$(all_spec_files))
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
# Extract main targets from Main.gmk using the spec provided in $2.
|
||||
#
|
||||
# Param 1: FORCE = force generation of main-targets.gmk or LAZY = do not force.
|
||||
# Param 2: The SPEC file to use.
|
||||
define DefineMainTargets
|
||||
|
||||
# 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
|
||||
|
||||
ifeq ($$(MAKE_RESTARTS), )
|
||||
# Only do this if make has not been restarted, and if we do not force it.
|
||||
ifeq ($(strip $1), FORCE)
|
||||
$$(shell rm -f $$(main_targets_file))
|
||||
endif
|
||||
ifneq ($$(COMPARE_BUILD_FAIL), true)
|
||||
COMPARE_BUILD_IGNORE_RESULT := || true
|
||||
endif
|
||||
|
||||
$$(main_targets_file):
|
||||
@( cd $$(topdir) && \
|
||||
$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(topdir)/make/Main.gmk \
|
||||
-I $$(topdir)/make/common SPEC=$(strip $2) NO_RECIPES=true \
|
||||
$$(MAKE_LOG_VARS) \
|
||||
create-main-targets-include )
|
||||
|
||||
# Now include main-targets.gmk. This will define ALL_MAIN_TARGETS.
|
||||
-include $$(main_targets_file)
|
||||
endef
|
||||
|
||||
define PrintConfCheckFailed
|
||||
@echo ' '
|
||||
@echo "Please rerun configure! Easiest way to do this is by running"
|
||||
@echo "'make reconfigure'."
|
||||
@echo "This behavior may also be changed using CONF_CHECK=<ignore|auto>."
|
||||
@echo ' '
|
||||
endef
|
||||
|
||||
else # $(HAS_SPEC)=true
|
||||
##############################################################################
|
||||
# Helper functions for the 'main' target. These functions assume a single,
|
||||
# proper and existing SPEC is included.
|
||||
##############################################################################
|
||||
|
||||
include $(TOPDIR)/make/common/MakeBase.gmk
|
||||
|
||||
# Define basic logging setup
|
||||
BUILD_LOG := $(OUTPUTDIR)/build.log
|
||||
BUILD_PROFILE_LOG := $(OUTPUTDIR)/build-profile.log
|
||||
|
||||
BUILD_LOG_PIPE := > >($(TEE) -a $(BUILD_LOG)) 2> >($(TEE) -a $(BUILD_LOG) >&2) && wait
|
||||
# Use this for simple echo/printf commands that are never expected to print
|
||||
# to stderr.
|
||||
BUILD_LOG_PIPE_SIMPLE := | $(TEE) -a $(BUILD_LOG)
|
||||
|
||||
ifneq ($(CUSTOM_ROOT), )
|
||||
topdir = $(CUSTOM_ROOT)
|
||||
else
|
||||
topdir = $(TOPDIR)
|
||||
endif
|
||||
endef
|
||||
|
||||
# Setup the build environment to match the requested specification on
|
||||
# level of reproducible builds
|
||||
define SetupReproducibleBuild
|
||||
ifeq ($$(SOURCE_DATE), updated)
|
||||
# For static values of SOURCE_DATE (not "updated"), these are set in spec.gmk
|
||||
export SOURCE_DATE_EPOCH := $$(shell $$(DATE) +"%s")
|
||||
export SOURCE_DATE_ISO_8601 := $$(call EpochToISO8601, $$(SOURCE_DATE_EPOCH))
|
||||
endif
|
||||
endef
|
||||
|
||||
# Parse COMPARE_BUILD into COMPARE_BUILD_*
|
||||
# Syntax: COMPARE_BUILD=CONF=<configure options>:PATCH=<patch file>:
|
||||
# MAKE=<make targets>:COMP_OPTS=<compare script options>:
|
||||
# COMP_DIR=<compare script base dir>|<default>:
|
||||
# FAIL=<bool>
|
||||
# If neither CONF or PATCH is given, assume <default> means CONF if it
|
||||
# begins with "--", otherwise assume it means PATCH.
|
||||
# MAKE and COMP_OPTS can only be used with CONF and/or PATCH specified.
|
||||
# If any value contains "+", it will be replaced by space.
|
||||
# FAIL can be set to false to have the return value of compare be ignored.
|
||||
define ParseCompareBuild
|
||||
ifneq ($$(COMPARE_BUILD), )
|
||||
COMPARE_BUILD_OUTPUTDIR := $(topdir)/build/compare-build/$(CONF_NAME)
|
||||
COMPARE_BUILD_FAIL := true
|
||||
|
||||
ifneq ($$(findstring :, $$(COMPARE_BUILD)), )
|
||||
$$(foreach part, $$(subst :, , $$(COMPARE_BUILD)), \
|
||||
$$(if $$(filter PATCH=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_PATCH = $$(strip $$(patsubst PATCH=%, %, $$(part)))) \
|
||||
) \
|
||||
$$(if $$(filter CONF=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(part))))) \
|
||||
) \
|
||||
$$(if $$(filter MAKE=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_MAKE = $$(strip $$(subst +, , $$(patsubst MAKE=%, %, $$(part))))) \
|
||||
) \
|
||||
$$(if $$(filter COMP_OPTS=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_COMP_OPTS = $$(strip $$(subst +, , $$(patsubst COMP_OPTS=%, %, $$(part))))) \
|
||||
) \
|
||||
$$(if $$(filter COMP_DIR=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_COMP_DIR = $$(strip $$(subst +, , $$(patsubst COMP_DIR=%, %, $$(part))))) \
|
||||
) \
|
||||
$$(if $$(filter FAIL=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_FAIL = $$(strip $$(subst +, , $$(patsubst FAIL=%, %, $$(part))))) \
|
||||
) \
|
||||
$$(if $$(filter NODRYRUN=%, $$(part)), \
|
||||
$$(eval COMPARE_BUILD_NODRYRUN = $$(strip $$(subst +, , $$(patsubst NODRYRUN=%, %, $$(part))))) \
|
||||
) \
|
||||
)
|
||||
else
|
||||
# Separate handling for single field case, to allow for spaces in values.
|
||||
ifneq ($$(filter PATCH=%, $$(COMPARE_BUILD)), )
|
||||
COMPARE_BUILD_PATCH = $$(strip $$(patsubst PATCH=%, %, $$(COMPARE_BUILD)))
|
||||
else ifneq ($$(filter CONF=%, $$(COMPARE_BUILD)), )
|
||||
COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(COMPARE_BUILD))))
|
||||
else ifneq ($$(filter --%, $$(COMPARE_BUILD)), )
|
||||
# Assume CONF if value begins with --
|
||||
COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(COMPARE_BUILD)))
|
||||
else
|
||||
# Otherwise assume patch file
|
||||
COMPARE_BUILD_PATCH = $$(strip $$(COMPARE_BUILD))
|
||||
endif
|
||||
endif
|
||||
ifneq ($$(COMPARE_BUILD_PATCH), )
|
||||
ifneq ($$(wildcard $$(topdir)/$$(COMPARE_BUILD_PATCH)), )
|
||||
# Assume relative path, if file exists
|
||||
COMPARE_BUILD_PATCH := $$(wildcard $$(topdir)/$$(COMPARE_BUILD_PATCH))
|
||||
else ifeq ($$(wildcard $$(COMPARE_BUILD_PATCH)), )
|
||||
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not exist)
|
||||
endif
|
||||
ifneq ($$(COMPARE_BUILD_NODRYRUN), true)
|
||||
PATCH_DRY_RUN := $$(shell cd $$(topdir) && $$(PATCH) --dry-run -p1 < $$(COMPARE_BUILD_PATCH) > /dev/null 2>&1 || $$(ECHO) FAILED)
|
||||
ifeq ($$(PATCH_DRY_RUN), FAILED)
|
||||
$$(error Patch file $$(COMPARE_BUILD_PATCH) does not apply cleanly)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
ifneq ($$(COMPARE_BUILD_FAIL), true)
|
||||
COMPARE_BUILD_IGNORE_RESULT := || true
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
# Prepare for a comparison rebuild
|
||||
define PrepareCompareBuild
|
||||
# Prepare for a comparison rebuild
|
||||
define PrepareCompareBuild
|
||||
$(ECHO) "Preparing for comparison rebuild"
|
||||
# Apply patch, if any
|
||||
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -p1 < $(COMPARE_BUILD_PATCH))
|
||||
$(if $(COMPARE_BUILD_PATCH), cd $(WORKSPACE_ROOT) && $(PATCH) -p1 < $(COMPARE_BUILD_PATCH))
|
||||
# Move the first build away temporarily
|
||||
$(RM) -r $(topdir)/build/.compare-build-temp
|
||||
$(MKDIR) -p $(topdir)/build/.compare-build-temp
|
||||
$(MV) $(OUTPUTDIR) $(topdir)/build/.compare-build-temp
|
||||
$(RM) -r $(WORKSPACE_ROOT)/build/.compare-build-temp
|
||||
$(MKDIR) -p $(WORKSPACE_ROOT)/build/.compare-build-temp
|
||||
$(MV) $(OUTPUTDIR) $(WORKSPACE_ROOT)/build/.compare-build-temp
|
||||
# Restore an old compare-build, or create a new compare-build directory.
|
||||
if test -d $(COMPARE_BUILD_OUTPUTDIR); then \
|
||||
$(MV) $(COMPARE_BUILD_OUTPUTDIR) $(OUTPUTDIR); \
|
||||
@ -422,23 +140,23 @@ else # $(HAS_SPEC)=true
|
||||
# Re-run configure with the same arguments (and possibly some additional),
|
||||
# must be done after patching.
|
||||
( cd $(CONFIGURE_START_DIR) && PATH="$(ORIGINAL_PATH)" \
|
||||
$(BASH) $(topdir)/configure $(CONFIGURE_COMMAND_LINE) $(COMPARE_BUILD_CONF))
|
||||
endef
|
||||
$(BASH) $(WORKSPACE_ROOT)/configure $(CONFIGURE_COMMAND_LINE) $(COMPARE_BUILD_CONF))
|
||||
endef
|
||||
|
||||
# Cleanup after a compare build
|
||||
define CleanupCompareBuild
|
||||
# Cleanup after a compare build
|
||||
define CleanupCompareBuild
|
||||
# If running with a COMPARE_BUILD patch, reverse-apply it, but continue
|
||||
# even if that fails (can happen with removed files).
|
||||
$(if $(COMPARE_BUILD_PATCH), cd $(topdir) && $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH) || true)
|
||||
$(if $(COMPARE_BUILD_PATCH), cd $(WORKSPACE_ROOT) && $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH) || true)
|
||||
# Move this build away and restore the original build
|
||||
$(MKDIR) -p $(topdir)/build/compare-build
|
||||
$(MKDIR) -p $(WORKSPACE_ROOT)/build/compare-build
|
||||
$(MV) $(OUTPUTDIR) $(COMPARE_BUILD_OUTPUTDIR)
|
||||
$(MV) $(topdir)/build/.compare-build-temp/$(CONF_NAME) $(OUTPUTDIR)
|
||||
$(RM) -r $(topdir)/build/.compare-build-temp
|
||||
endef
|
||||
$(MV) $(WORKSPACE_ROOT)/build/.compare-build-temp/$(CONF_NAME) $(OUTPUTDIR)
|
||||
$(RM) -r $(WORKSPACE_ROOT)/build/.compare-build-temp
|
||||
endef
|
||||
|
||||
# Do the actual comparison of two builds
|
||||
define CompareBuildDoComparison
|
||||
# Do the actual comparison of two builds
|
||||
define CompareBuildDoComparison
|
||||
# Compare first and second build. Ignore any error code from compare.sh.
|
||||
$(ECHO) "Comparing between comparison rebuild (this/new) and baseline (other/old)"
|
||||
$(if $(COMPARE_BUILD_COMP_DIR), \
|
||||
@ -448,16 +166,17 @@ else # $(HAS_SPEC)=true
|
||||
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh --diffs $(COMPARE_BUILD_COMP_OPTS) \
|
||||
-o $(OUTPUTDIR) $(COMPARE_BUILD_IGNORE_RESULT)) \
|
||||
)
|
||||
endef
|
||||
endef
|
||||
|
||||
define PrintFailureReports
|
||||
define PrintFailureReports
|
||||
$(if $(filter none, $(LOG_REPORT)), , \
|
||||
$(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 ; \
|
||||
, \
|
||||
@ -467,116 +186,120 @@ else # $(HAS_SPEC)=true
|
||||
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 \
|
||||
) \
|
||||
)
|
||||
endef
|
||||
endef
|
||||
|
||||
define PrintBuildLogFailures
|
||||
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 \
|
||||
)
|
||||
endef
|
||||
endef
|
||||
|
||||
define RotateLogFiles
|
||||
define RotateLogFiles
|
||||
$(RM) $(BUILD_LOG).old 2> /dev/null && \
|
||||
$(MV) $(BUILD_LOG) $(BUILD_LOG).old 2> /dev/null || true
|
||||
$(if $(findstring true, $(LOG_PROFILE_TIMES_FILE)), \
|
||||
$(RM) $(BUILD_PROFILE_LOG).old 2> /dev/null && \
|
||||
$(MV) $(BUILD_PROFILE_LOG) $(BUILD_PROFILE_LOG).old 2> /dev/null || true \
|
||||
)
|
||||
endef
|
||||
endef
|
||||
|
||||
# Failure logs are only supported for "parallel" main targets, not the
|
||||
# (trivial) sequential make targets (such as clean and reconfigure),
|
||||
# since the failure-logs directory creation will conflict with clean.
|
||||
# We also make sure the javatmp directory exists, which is needed if a java
|
||||
# process (like javac) is using java.io.tmpdir.
|
||||
define PrepareFailureLogs
|
||||
# Failure logs are only supported for "parallel" main targets, not the
|
||||
# (trivial) sequential make targets (such as clean and reconfigure),
|
||||
# since the failure-logs directory creation will conflict with clean.
|
||||
# We also make sure the javatmp directory exists, which is needed if a java
|
||||
# process (like javac) is using java.io.tmpdir.
|
||||
define PrepareFailureLogs
|
||||
$(RM) -r $(MAKESUPPORT_OUTPUTDIR)/failure-logs 2> /dev/null && \
|
||||
$(MKDIR) -p $(MAKESUPPORT_OUTPUTDIR)/failure-logs
|
||||
$(MKDIR) -p $(JAVA_TMP_DIR)
|
||||
$(RM) $(MAKESUPPORT_OUTPUTDIR)/exit-with-error 2> /dev/null
|
||||
endef
|
||||
endef
|
||||
|
||||
# Remove any javac server logs and port files. This
|
||||
# prevents a new make run to reuse the previous servers.
|
||||
define PrepareJavacServer
|
||||
# Remove any javac server logs and port files. This
|
||||
# prevents a new make run to reuse the previous servers.
|
||||
define PrepareJavacServer
|
||||
$(if $(JAVAC_SERVER_DIR), \
|
||||
$(RM) -r $(JAVAC_SERVER_DIR) 2> /dev/null && \
|
||||
$(MKDIR) -p $(JAVAC_SERVER_DIR) \
|
||||
)
|
||||
endef
|
||||
endef
|
||||
|
||||
define CleanupJavacServer
|
||||
define CleanupJavacServer
|
||||
[ -f $(JAVAC_SERVER_DIR)/server.port ] && $(ECHO) Stopping javac server && \
|
||||
$(TOUCH) $(JAVAC_SERVER_DIR)/server.port.stop; true
|
||||
endef
|
||||
endef
|
||||
|
||||
ifeq ($(call isBuildOs, windows), true)
|
||||
# On windows we need to synchronize with the javac server to be able to
|
||||
# move or remove the build output directory. Since we have no proper
|
||||
# synchronization process, wait for a while and hope it helps. This is only
|
||||
# used by build comparisons.
|
||||
ifeq ($(call isBuildOs, windows), true)
|
||||
# On windows we need to synchronize with the javac server to be able to
|
||||
# move or remove the build output directory. Since we have no proper
|
||||
# synchronization process, wait for a while and hope it helps. This is only
|
||||
# used by build comparisons.
|
||||
define WaitForJavacServerFinish
|
||||
$(if $(JAVAC_SERVER_DIR), \
|
||||
sleep 5 \
|
||||
)
|
||||
endef
|
||||
else
|
||||
define WaitForJavacServerFinish
|
||||
endef
|
||||
endif
|
||||
endef
|
||||
else
|
||||
define WaitForJavacServerFinish
|
||||
endef
|
||||
endif
|
||||
|
||||
##############################################################################
|
||||
# Functions for timers
|
||||
##############################################################################
|
||||
##############################################################################
|
||||
# Functions for timers
|
||||
##############################################################################
|
||||
|
||||
# Store the build times in this directory.
|
||||
BUILDTIMESDIR = $(OUTPUTDIR)/make-support/build-times
|
||||
# Store the build times in this directory.
|
||||
BUILDTIMESDIR := $(OUTPUTDIR)/make-support/build-times
|
||||
|
||||
# Record starting time for build of a sub repository.
|
||||
define RecordStartTime
|
||||
# Record starting time for build of a sub repository.
|
||||
define RecordStartTime
|
||||
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$(strip $1) && \
|
||||
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$(strip $1)_human_readable
|
||||
endef
|
||||
endef
|
||||
|
||||
# Record ending time and calculate the difference and store it in a
|
||||
# easy to read format. Handles builds that cross midnight. Expects
|
||||
# that a build will never take 24 hours or more.
|
||||
define RecordEndTime
|
||||
# Record ending time and calculate the difference and store it in a
|
||||
# easy to read format. Handles builds that cross midnight. Expects
|
||||
# that a build will never take 24 hours or more.
|
||||
define RecordEndTime
|
||||
$(DATE) '+%Y %m %d %H %M %S' | $(AWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)
|
||||
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$(strip $1)_human_readable
|
||||
$(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$(strip $1)` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$(strip $1)` $1 | \
|
||||
$(AWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
|
||||
M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \
|
||||
> $(BUILDTIMESDIR)/build_time_diff_$(strip $1)
|
||||
endef
|
||||
endef
|
||||
|
||||
define StartGlobalTimer
|
||||
define StartGlobalTimer
|
||||
$(RM) -r $(BUILDTIMESDIR) 2> /dev/null && \
|
||||
$(MKDIR) -p $(BUILDTIMESDIR) && \
|
||||
$(call RecordStartTime,TOTAL)
|
||||
endef
|
||||
endef
|
||||
|
||||
define StopGlobalTimer
|
||||
define StopGlobalTimer
|
||||
$(call RecordEndTime,TOTAL)
|
||||
endef
|
||||
endef
|
||||
|
||||
# Find all build_time_* files and print their contents in a list sorted
|
||||
# on the name of the sub repository.
|
||||
define ReportBuildTimes
|
||||
# Find all build_time_* files and print their contents in a list sorted
|
||||
# on the name of the sub repository.
|
||||
define ReportBuildTimes
|
||||
$(PRINTF) $(LOG_INFO) -- \
|
||||
"----- Build times -------\nStart %s\nEnd %s\n%s\n%s\n-------------------------\n" \
|
||||
"`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \
|
||||
@ -585,119 +308,20 @@ else # $(HAS_SPEC)=true
|
||||
$(XARGS) $(CAT) | $(SORT) -k 2`" \
|
||||
"`$(CAT) $(BUILDTIMESDIR)/build_time_diff_TOTAL`" \
|
||||
$(BUILD_LOG_PIPE_SIMPLE)
|
||||
endef
|
||||
|
||||
define ReportProfileTimes
|
||||
$(if $(findstring true, $(LOG_PROFILE_TIMES_LOG)), \
|
||||
[ ! -f $(BUILD_PROFILE_LOG) ] || \
|
||||
{ $(ECHO) Begin $(notdir $(BUILD_PROFILE_LOG)) && \
|
||||
$(CAT) $(BUILD_PROFILE_LOG) && \
|
||||
$(ECHO) End $(notdir $(BUILD_PROFILE_LOG)); \
|
||||
} \
|
||||
$(BUILD_LOG_PIPE_SIMPLE)
|
||||
)
|
||||
endef
|
||||
|
||||
endif # HAS_SPEC
|
||||
|
||||
# Look for a given option in the LOG variable, and if found, set a variable
|
||||
# and remove the option from the LOG variable
|
||||
# $1: The option to look for
|
||||
# $2: The variable to set to "true" if the option is found
|
||||
define ParseLogOption
|
||||
ifneq ($$(findstring $1, $$(LOG)), )
|
||||
override $2 := true
|
||||
# First try to remove ",<option>" if it exists, otherwise just remove "<option>"
|
||||
LOG_STRIPPED := $$(subst $1,, $$(subst $$(COMMA)$$(strip $1),, $$(LOG)))
|
||||
# We might have ended up with a leading comma. Remove it. Need override
|
||||
# since LOG is set from the command line.
|
||||
override LOG := $$(strip $$(patsubst $$(COMMA)%, %, $$(LOG_STRIPPED)))
|
||||
endif
|
||||
endef
|
||||
|
||||
# Look for a given option with an assignment in the LOG variable, and if found,
|
||||
# set a variable to that value and remove the option from the LOG variable
|
||||
# $1: The option to look for
|
||||
# $2: The variable to set to the value of the option, if found
|
||||
define ParseLogValue
|
||||
ifneq ($$(findstring $1=, $$(LOG)), )
|
||||
# Make words of out comma-separated list and find the one with opt=val
|
||||
value := $$(strip $$(subst $$(strip $1)=,, $$(filter $$(strip $1)=%, $$(subst $$(COMMA), , $$(LOG)))))
|
||||
override $2 := $$(value)
|
||||
# First try to remove ",<option>" if it exists, otherwise just remove "<option>"
|
||||
LOG_STRIPPED := $$(subst $$(strip $1)=$$(value),, \
|
||||
$$(subst $$(COMMA)$$(strip $1)=$$(value),, $$(LOG)))
|
||||
# We might have ended up with a leading comma. Remove it. Need override
|
||||
# since LOG is set from the command line.
|
||||
override LOG := $$(strip $$(patsubst $$(COMMA)%, %, $$(LOG_STRIPPED)))
|
||||
endif
|
||||
define ReportProfileTimes
|
||||
$(if $(findstring true, $(LOG_PROFILE_TIMES_LOG)), \
|
||||
[ ! -f $(BUILD_PROFILE_LOG) ] || \
|
||||
{ $(ECHO) Begin $(notdir $(BUILD_PROFILE_LOG)) && \
|
||||
$(CAT) $(BUILD_PROFILE_LOG) && \
|
||||
$(ECHO) End $(notdir $(BUILD_PROFILE_LOG)); \
|
||||
} \
|
||||
$(BUILD_LOG_PIPE_SIMPLE)
|
||||
)
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
|
||||
define ParseLogLevel
|
||||
# Catch old-style VERBOSE= command lines.
|
||||
ifneq ($$(origin VERBOSE), undefined)
|
||||
$$(info Error: VERBOSE is deprecated. Use LOG=<warn|info|debug|trace> instead.)
|
||||
$$(error Cannot continue)
|
||||
endif
|
||||
|
||||
# Setup logging according to LOG
|
||||
|
||||
# If "nofile" is present, do not log to a file
|
||||
$$(eval $$(call ParseLogOption, nofile, LOG_NOFILE))
|
||||
|
||||
# If "cmdline" is present, print all executes "important" command lines.
|
||||
$$(eval $$(call ParseLogOption, cmdlines, LOG_CMDLINES))
|
||||
|
||||
# If "report" is present, use non-standard reporting options at build failure.
|
||||
$$(eval $$(call ParseLogValue, report, LOG_REPORT))
|
||||
ifneq ($$(LOG_REPORT), )
|
||||
ifeq ($$(filter $$(LOG_REPORT), none all default), )
|
||||
$$(info Error: LOG=report has invalid value: $$(LOG_REPORT).)
|
||||
$$(info Valid values: LOG=report=<none>|<all>|<default>)
|
||||
$$(error Cannot continue)
|
||||
endif
|
||||
endif
|
||||
|
||||
# If "profile-to-log" is present, write shell times in build log
|
||||
$$(eval $$(call ParseLogOption, profile-to-log, LOG_PROFILE_TIMES_LOG))
|
||||
|
||||
# If "profile" is present, write shell times in separate log file
|
||||
# IMPORTANT: $(ParseLogOption profile-to-log) should go first. Otherwise
|
||||
# parsing of 'LOG=debug,profile-to-log,nofile' ends up in the following error:
|
||||
# Error: LOG contains unknown option or log level: debug-to-log.
|
||||
$$(eval $$(call ParseLogOption, profile, LOG_PROFILE_TIMES_FILE))
|
||||
|
||||
# Treat LOG=profile-to-log as if it were LOG=profile,profile-to-log
|
||||
LOG_PROFILE_TIMES_FILE := $$(firstword $$(LOG_PROFILE_TIMES_FILE) $$(LOG_PROFILE_TIMES_LOG))
|
||||
|
||||
override LOG_LEVEL := $$(LOG)
|
||||
|
||||
ifeq ($$(LOG_LEVEL), )
|
||||
# Set LOG to "warn" as default if not set
|
||||
override LOG_LEVEL := warn
|
||||
endif
|
||||
|
||||
ifeq ($$(LOG_LEVEL), warn)
|
||||
override MAKE_LOG_FLAGS := -s
|
||||
else ifeq ($$(LOG_LEVEL), info)
|
||||
override MAKE_LOG_FLAGS := -s
|
||||
else ifeq ($$(LOG_LEVEL), debug)
|
||||
override MAKE_LOG_FLAGS :=
|
||||
else ifeq ($$(LOG_LEVEL), trace)
|
||||
override MAKE_LOG_FLAGS :=
|
||||
else
|
||||
$$(info Error: LOG contains unknown option or log level: $$(LOG).)
|
||||
$$(info LOG can be <level>[,<opt>[...]] where <opt> is nofile | cmdlines | profile | profile-to-log)
|
||||
$$(info and <level> is warn | info | debug | trace)
|
||||
$$(error Cannot continue)
|
||||
endif
|
||||
endef
|
||||
|
||||
MAKE_LOG_VARS = $(foreach v, \
|
||||
LOG_LEVEL LOG_NOFILE LOG_CMDLINES LOG_REPORT LOG_PROFILE_TIMES_LOG \
|
||||
LOG_PROFILE_TIMES_FILE, \
|
||||
$v=$($v) \
|
||||
)
|
||||
|
||||
endif # _INITSUPPORT_GMK
|
||||
endif # include guard
|
||||
include MakeIncludeEnd.gmk
|
||||
|
||||
@ -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
|
||||
@ -23,10 +23,9 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
include MakeFileStart.gmk
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
################################################################################
|
||||
|
||||
include Execute.gmk
|
||||
include Modules.gmk
|
||||
@ -58,6 +57,4 @@ TARGETS += $(jlink_interim_image)
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
.PHONY: all
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 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
|
||||
@ -23,14 +23,13 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
include MakeFileStart.gmk
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
################################################################################
|
||||
|
||||
include CopyFiles.gmk
|
||||
include JavaCompilation.gmk
|
||||
include JarArchive.gmk
|
||||
include JavaCompilation.gmk
|
||||
include TextFileProcessing.gmk
|
||||
|
||||
# This rule will be depended on due to the MANIFEST line
|
||||
@ -78,3 +77,7 @@ $(eval $(call SetupJarArchive, BUILD_JRTFS_JAR, \
|
||||
))
|
||||
|
||||
all: $(BUILD_JRTFS_JAR)
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2019, 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
|
||||
@ -23,8 +23,9 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
include CopyFiles.gmk
|
||||
include TextFileProcessing.gmk
|
||||
@ -118,3 +119,7 @@ else # Not macosx
|
||||
endif # macosx
|
||||
|
||||
.PHONY: jdk-bundle jre-bundle bundles
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
115
make/Main.gmk
115
make/Main.gmk
@ -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
|
||||
@ -24,44 +24,41 @@
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This is the main makefile containing most actual top level targets. It needs
|
||||
# to be called with a SPEC file defined.
|
||||
# This is the main makefile containing most actual top level targets.
|
||||
################################################################################
|
||||
|
||||
# Declare default target
|
||||
default:
|
||||
# Declare ALL_TARGETS as an immediate variable. This variable is a list of all
|
||||
# valid top level targets. It's used to declare them all as PHONY and to
|
||||
# generate the -only targets.
|
||||
|
||||
ifeq ($(wildcard $(SPEC)), )
|
||||
$(error Main.gmk needs SPEC set to a proper spec.gmk)
|
||||
endif
|
||||
ALL_TARGETS :=
|
||||
|
||||
# Now load the spec
|
||||
include $(SPEC)
|
||||
DEFAULT_TARGET := default-target
|
||||
|
||||
# Load the vital tools for all the makefiles.
|
||||
include $(TOPDIR)/make/common/MakeBase.gmk
|
||||
include $(TOPDIR)/make/common/Modules.gmk
|
||||
include $(TOPDIR)/make/common/FindTests.gmk
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
include $(TOPDIR)/make/MainSupport.gmk
|
||||
|
||||
include FindTests.gmk
|
||||
|
||||
ifeq ($(UPDATE_MODULE_DEPS), true)
|
||||
# Update module-deps.gmk if requested. This is read in Modules.gmk.
|
||||
GENERATE_MODULE_DEPS_FILE := true
|
||||
endif
|
||||
|
||||
include Modules.gmk
|
||||
|
||||
# Are we requested to ignore dependencies?
|
||||
ifneq ($(findstring -only, $(MAKECMDGOALS)), )
|
||||
DEPS := none
|
||||
endif
|
||||
|
||||
# Declare ALL_TARGETS as an immediate variable. This variable is a list of all
|
||||
# valid top level targets. It's used to declare them all as PHONY and to
|
||||
# generate the -only targets.
|
||||
ALL_TARGETS :=
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, Main.gmk))
|
||||
|
||||
# All modules for the current target platform.
|
||||
ALL_MODULES := $(call FindAllModules)
|
||||
|
||||
################################################################################
|
||||
################################################################################
|
||||
#
|
||||
# Recipes for all targets. Only recipes, dependencies are declared later.
|
||||
@ -356,6 +353,14 @@ $(eval $(call SetupTarget, vscode-project-ccls, \
|
||||
DEPS := compile-commands, \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
# IDEA IntelliJ projects
|
||||
|
||||
$(eval $(call SetupTarget, idea-gen-config, \
|
||||
MAKEFILE := ide/idea/jdk/IdeaGenConfig, \
|
||||
ARGS := IDEA_OUTPUT="$(IDEA_OUTPUT)" MODULES="$(MODULES)", \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
# Build demos targets
|
||||
|
||||
@ -412,12 +417,14 @@ $(eval $(call SetupTarget, create-source-revision-tracker, \
|
||||
))
|
||||
|
||||
BOOTCYCLE_TARGET := product-images
|
||||
BOOTCYCLE_SPEC := $(dir $(SPEC))bootcycle-spec.gmk
|
||||
|
||||
bootcycle-images:
|
||||
ifneq ($(COMPILE_TYPE), cross)
|
||||
$(call LogWarn, Boot cycle build step 2: Building a new JDK image using previously built image)
|
||||
$(call MakeDir, $(OUTPUTDIR)/bootcycle-build)
|
||||
+$(MAKE) $(MAKE_ARGS) -f $(TOPDIR)/make/Init.gmk PARALLEL_TARGETS=$(BOOTCYCLE_TARGET) \
|
||||
LOG_PREFIX="[bootcycle] " JOBS= SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
|
||||
LOG_PREFIX="[bootcycle] " JOBS= SPEC=$(BOOTCYCLE_SPEC) main
|
||||
else
|
||||
$(call LogWarn, Boot cycle build disabled when cross compiling)
|
||||
endif
|
||||
@ -454,6 +461,18 @@ $(eval $(call SetupTarget, symbols-image, \
|
||||
TARGET := symbols, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, static-launcher, \
|
||||
MAKEFILE := StaticLibs, \
|
||||
TARGET := static-launcher, \
|
||||
DEPS := hotspot-static-libs static-libs, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, static-jdk-image, \
|
||||
MAKEFILE := StaticLibs, \
|
||||
TARGET := static-jdk-image, \
|
||||
DEPS := static-exploded-image jdk-image, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, static-libs-image, \
|
||||
MAKEFILE := StaticLibsImage, \
|
||||
TARGET := static-libs-image, \
|
||||
@ -742,6 +761,17 @@ $(eval $(call SetupTarget, test-image-lib, \
|
||||
DEPS := build-test-lib, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, build-test-setup-aot, \
|
||||
MAKEFILE := test/BuildTestSetupAOT, \
|
||||
DEPS := interim-langtools exploded-image, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, test-image-setup-aot, \
|
||||
MAKEFILE := test/BuildTestSetupAOT, \
|
||||
TARGET := images, \
|
||||
DEPS := build-test-setup-aot, \
|
||||
))
|
||||
|
||||
ifeq ($(BUILD_FAILURE_HANDLER), true)
|
||||
# Builds the failure handler jtreg extension
|
||||
$(eval $(call SetupTarget, build-test-failure-handler, \
|
||||
@ -853,6 +883,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, \
|
||||
@ -978,7 +1014,7 @@ else
|
||||
else ifeq ($(EXTERNAL_BUILDJDK), false)
|
||||
# When not cross compiling, the BUILD_JDK is the interim jdk image, and
|
||||
# the javac launcher is needed.
|
||||
jdk.compiler-gendata: jdk.compiler-launchers
|
||||
jdk.compiler-gendata: jdk.compiler-launchers java.base-launchers
|
||||
jdk.javadoc-gendata: jdk.compiler-launchers
|
||||
endif
|
||||
|
||||
@ -1086,9 +1122,9 @@ else
|
||||
|
||||
symbols-image: $(LIBS_TARGETS) $(LAUNCHER_TARGETS)
|
||||
|
||||
static-libs-image: hotspot-static-libs $(STATIC_LIBS_TARGETS)
|
||||
static-libs-image: hotspot-static-libs static-libs
|
||||
|
||||
static-libs-graal-image: $(STATIC_LIBS_TARGETS)
|
||||
static-libs-graal-image: static-libs
|
||||
|
||||
bootcycle-images: jdk-image
|
||||
|
||||
@ -1254,6 +1290,8 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
legacy-images: mac-legacy-jre-bundle
|
||||
endif
|
||||
|
||||
static-exploded-image: static-launcher exploded-image
|
||||
|
||||
# These targets build the various documentation images
|
||||
docs-jdk-image: docs-jdk
|
||||
docs-javase-image: docs-javase
|
||||
@ -1268,7 +1306,8 @@ all-docs-bundles: docs-jdk-bundles docs-javase-bundles docs-reference-bundles
|
||||
# This target builds the test image
|
||||
test-image: prepare-test-image test-image-jdk-jtreg-native \
|
||||
test-image-demos-jdk test-image-libtest-jtreg-native \
|
||||
test-image-lib test-image-lib-native
|
||||
test-image-lib test-image-lib-native \
|
||||
test-image-setup-aot
|
||||
|
||||
ifneq ($(JVM_TEST_IMAGE_TARGETS), )
|
||||
# If JVM_TEST_IMAGE_TARGETS is externally defined, use it instead of the
|
||||
@ -1296,7 +1335,7 @@ endif
|
||||
################################################################################
|
||||
|
||||
# all-images builds all our deliverables as images.
|
||||
all-images: product-images test-image all-docs-images
|
||||
all-images: product-images static-jdk-image test-image all-docs-images
|
||||
|
||||
# all-bundles packages all our deliverables as tar.gz bundles.
|
||||
all-bundles: product-bundles test-bundles docs-bundles static-libs-bundles
|
||||
@ -1309,7 +1348,7 @@ ALL_TARGETS += buildtools hotspot hotspot-libs hotspot-static-libs \
|
||||
create-buildjdk docs-jdk-api docs-javase-api docs-reference-api docs-jdk \
|
||||
docs-javase docs-reference docs-javadoc mac-bundles product-images legacy-images \
|
||||
docs-image docs-javase-image docs-reference-image all-docs-images \
|
||||
docs-bundles all-docs-bundles test-image all-images \
|
||||
docs-bundles all-docs-bundles test-image all-images static-exploded-image \
|
||||
all-bundles
|
||||
|
||||
################################################################################
|
||||
@ -1317,7 +1356,7 @@ ALL_TARGETS += buildtools hotspot hotspot-libs hotspot-static-libs \
|
||||
# Traditional targets typically run by users.
|
||||
# These can be considered aliases for the targets now named by a more
|
||||
# "modern" naming scheme.
|
||||
default: $(DEFAULT_MAKE_TARGET)
|
||||
default-target: $(DEFAULT_MAKE_TARGET)
|
||||
jdk: exploded-image
|
||||
images: product-images
|
||||
docs: docs-image
|
||||
@ -1344,11 +1383,14 @@ test-hotspot-jtreg-native: test-hotspot_native_sanity
|
||||
test-hotspot-gtest: exploded-test-gtest
|
||||
test-jdk-jtreg-native: test-jdk_native_sanity
|
||||
|
||||
# Set dependencies for doc tests
|
||||
$(eval $(call AddTestDependency, docs_all, docs-jdk))
|
||||
test-docs: test-docs_all
|
||||
|
||||
ALL_TARGETS += $(RUN_TEST_TARGETS) run-test exploded-run-test check \
|
||||
test-hotspot-jtreg test-hotspot-jtreg-native test-hotspot-gtest \
|
||||
test-jdk-jtreg-native
|
||||
test-jdk-jtreg-native test-docs
|
||||
|
||||
################################################################################
|
||||
################################################################################
|
||||
#
|
||||
# Clean targets
|
||||
@ -1365,7 +1407,7 @@ CLEAN_SUPPORT_DIRS += demos
|
||||
CLEAN_SUPPORT_DIR_TARGETS := $(addprefix clean-, $(CLEAN_SUPPORT_DIRS))
|
||||
CLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native lib
|
||||
CLEAN_TEST_TARGETS += $(addprefix clean-test-, $(CLEAN_TESTS))
|
||||
CLEAN_PHASES := gensrc java native include
|
||||
CLEAN_PHASES += gensrc java native include
|
||||
CLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES))
|
||||
CLEAN_MODULE_TARGETS := $(addprefix clean-, $(ALL_MODULES))
|
||||
# Construct targets of the form clean-$module-$phase
|
||||
@ -1454,13 +1496,12 @@ print-tests:
|
||||
|
||||
create-main-targets-include:
|
||||
$(call LogInfo, Generating main target list)
|
||||
$(call MakeDir, $(MAKESUPPORT_OUTPUTDIR))
|
||||
@$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \
|
||||
$(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk
|
||||
|
||||
################################################################################
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, Main-post.gmk))
|
||||
|
||||
.PHONY: $(ALL_TARGETS)
|
||||
|
||||
FRC: # Force target
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, 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
|
||||
@ -23,13 +23,13 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include MakeIncludeStart.gmk
|
||||
ifeq ($(INCLUDE), true)
|
||||
|
||||
################################################################################
|
||||
# This file contains helper functions for Main.gmk.
|
||||
################################################################################
|
||||
|
||||
ifndef _MAINSUPPORT_GMK
|
||||
_MAINSUPPORT_GMK := 1
|
||||
|
||||
# Setup make rules for creating a top-level target.
|
||||
# Parameter 1 is the name of the rule. This name is used as variable prefix.
|
||||
#
|
||||
@ -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
|
||||
@ -137,10 +137,19 @@ define CleanModule
|
||||
$(call Clean-include, $1)
|
||||
endef
|
||||
|
||||
define AddTestDependency
|
||||
test-$(strip $1): $2
|
||||
|
||||
exploded-test-$(strip $1): $2
|
||||
|
||||
ifneq ($(filter $(TEST), $1), )
|
||||
TEST_DEPS += $2
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
|
||||
PHASE_MAKEDIRS := $(TOPDIR)/make
|
||||
PHASE_MAKEDIRS += $(TOPDIR)/make
|
||||
|
||||
# Helper macro for DeclareRecipesForPhase
|
||||
# Declare a recipe for calling the module and phase specific makefile.
|
||||
@ -209,4 +218,5 @@ endef
|
||||
|
||||
################################################################################
|
||||
|
||||
endif # _MAINSUPPORT_GMK
|
||||
endif # include guard
|
||||
include MakeIncludeEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 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
|
||||
@ -23,8 +23,10 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
ifndef _MODULE_TOOLS_GMK
|
||||
_MODULE_TOOLS_GMK := 1
|
||||
include MakeIncludeStart.gmk
|
||||
ifeq ($(INCLUDE), true)
|
||||
|
||||
################################################################################
|
||||
|
||||
include JavaCompilation.gmk
|
||||
|
||||
@ -49,4 +51,7 @@ TOOL_ADD_PACKAGES_ATTRIBUTE := $(BUILD_JAVA) $(JAVA_FLAGS_SMALL_BUILDJDK) \
|
||||
--add-exports java.base/jdk.internal.module=ALL-UNNAMED \
|
||||
build.tools.jigsaw.AddPackagesAttribute
|
||||
|
||||
endif # _MODULE_TOOLS_GMK
|
||||
################################################################################
|
||||
|
||||
endif # include guard
|
||||
include MakeIncludeEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 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
|
||||
@ -23,27 +23,51 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# This makefile is called from Main.gmk, through a macro in MakeHelpers.gmk
|
||||
# and wraps calls to makefiles for specific modules and build phases. Having
|
||||
# this wrapper reduces the need for boilerplate code. It also provides
|
||||
# opportunity for automatic copying of files to an interim exploded runnable
|
||||
# image.
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
################################################################################
|
||||
|
||||
include CopyFiles.gmk
|
||||
include Modules.gmk
|
||||
|
||||
MODULE_SRC := $(TOPDIR)/src/$(MODULE)
|
||||
|
||||
# All makefiles should add the targets to be built to this variable.
|
||||
TARGETS :=
|
||||
################################################################################
|
||||
# Include module specific build settings
|
||||
|
||||
# Include the file being wrapped.
|
||||
include $(MAKEFILE_PREFIX).gmk
|
||||
THIS_SNIPPET := $(call GetModuleSnippetName, $(MAKEFILE_PREFIX))
|
||||
|
||||
ifneq ($(wildcard $(THIS_SNIPPET)), )
|
||||
include MakeSnippetStart.gmk
|
||||
|
||||
# Include the file being wrapped.
|
||||
include $(THIS_SNIPPET)
|
||||
|
||||
include MakeSnippetEnd.gmk
|
||||
endif
|
||||
|
||||
ifeq ($(MAKEFILE_PREFIX), Lib)
|
||||
# We need to keep track of what libraries are generated/needed by this
|
||||
# module. This information is required when doing static linking, to know
|
||||
# which static library files to include. The variable $(MODULE)_INCLUDED_LIBS is
|
||||
# added to for each call to SetupJdkLibrary. The file module-included-libs.txt is then
|
||||
# read in StaticLibs.gmk.
|
||||
ifneq ($($(MODULE)_INCLUDED_LIBS), )
|
||||
LIBLIST := $(SUPPORT_OUTPUTDIR)/modules_static-libs/$(MODULE)/module-included-libs.txt
|
||||
|
||||
$(LIBLIST): $(TARGETS)
|
||||
$(call MakeDir, $(@D))
|
||||
$(ECHO) $($(MODULE)_INCLUDED_LIBS) > $@
|
||||
|
||||
TARGETS += $(LIBLIST)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Setup copy rules from the modules directories to the jdk image directory.
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
@ -111,8 +135,12 @@ $(eval $(call SetupCopyFiles, COPY_CONF, \
|
||||
))
|
||||
|
||||
ifeq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
|
||||
all: $(filter $(MAKESUPPORT_OUTPUTDIR)/compile-commands/%, $(TARGETS))
|
||||
TARGETS := $(filter $(MAKESUPPORT_OUTPUTDIR)/compile-commands/%, $(TARGETS))
|
||||
else
|
||||
all: $(TARGETS) $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB) \
|
||||
TARGETS += $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB) \
|
||||
$(COPY_INCLUDE) $(COPY_CMDS) $(COPY_MAN) $(COPY_CONF) $(LINK_LIBS_TO_LIB)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
224
make/PreInit.gmk
Normal file
224
make/PreInit.gmk
Normal file
@ -0,0 +1,224 @@
|
||||
#
|
||||
# Copyright (c) 2012, 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.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This file is the earliest part of the build bootstrap process (not counting
|
||||
# Makefile that includes it). Its main responsibility is to figure out what
|
||||
# configuration to use and pick up the corresponding SPEC file. It will then
|
||||
# call Init.gmk with this SPEC for further bootstrapping.
|
||||
################################################################################
|
||||
|
||||
# This must be the first rule
|
||||
default:
|
||||
.PHONY: default
|
||||
|
||||
# Inclusion of this pseudo-target will cause make to execute this file
|
||||
# serially, regardless of -j.
|
||||
.NOTPARALLEL:
|
||||
|
||||
IS_PREINIT_ENV := true
|
||||
|
||||
# Include our helper functions.
|
||||
include $(TOPDIR)/make/PreInitSupport.gmk
|
||||
include $(TOPDIR)/make/common/LogUtils.gmk
|
||||
|
||||
# Here are "global" targets, i.e. targets that can be executed without having
|
||||
# a configuration. This will define ALL_GLOBAL_TARGETS.
|
||||
include $(TOPDIR)/make/Global.gmk
|
||||
|
||||
# Targets provided by Init.gmk.
|
||||
ALL_INIT_TARGETS := print-modules print-targets print-configuration \
|
||||
print-tests reconfigure pre-compare-build post-compare-build \
|
||||
create-make-helpers
|
||||
|
||||
# CALLED_TARGETS is the list of targets that the user provided,
|
||||
# or "default" if unspecified.
|
||||
CALLED_TARGETS := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), default)
|
||||
|
||||
# Extract non-global targets that require a spec file.
|
||||
CALLED_SPEC_TARGETS := $(filter-out $(ALL_GLOBAL_TARGETS), $(CALLED_TARGETS))
|
||||
|
||||
# If we have only global targets, or if we are called with -qp (assuming an
|
||||
# external part, e.g. bash completion, is trying to understand our targets),
|
||||
# we will skip SPEC location and the sanity checks.
|
||||
ifeq ($(CALLED_SPEC_TARGETS), )
|
||||
SKIP_SPEC := true
|
||||
endif
|
||||
ifeq ($(findstring p, $(MAKEFLAGS))$(findstring q, $(MAKEFLAGS)), pq)
|
||||
SKIP_SPEC := true
|
||||
endif
|
||||
|
||||
ifneq ($(SKIP_SPEC), true)
|
||||
|
||||
############################################################################
|
||||
# This is the common case: we have been called from the command line by the
|
||||
# user with a target that should be delegated to Main.gmk, so we need to
|
||||
# figure out a proper SPEC and call Init.gmk with it.
|
||||
############################################################################
|
||||
|
||||
# Basic checks on environment and command line.
|
||||
$(eval $(call CheckControlVariables))
|
||||
$(eval $(call CheckInvalidMakeFlags))
|
||||
|
||||
# Check that CONF_CHECK is valid.
|
||||
$(eval $(call ParseConfCheckOption))
|
||||
|
||||
# Check that the LOG given is valid, and set LOG_LEVEL, LOG_NOFILE,
|
||||
# MAKE_LOG_VARS and MAKE_LOG_FLAGS.
|
||||
$(eval $(call ParseLogLevel))
|
||||
|
||||
# After this SPECS contain 1..N spec files (otherwise ParseConfAndSpec fails).
|
||||
$(eval $(call ParseConfAndSpec))
|
||||
|
||||
# Extract main targets from Main.gmk using the spec(s) provided. In theory,
|
||||
# with multiple specs, we should find the intersection of targets provided
|
||||
# by all specs, but we approximate this by an arbitrary spec from the list.
|
||||
# This will setup ALL_MAIN_TARGETS.
|
||||
$(eval $(call DefineMainTargets, FORCE, $(firstword $(SPECS))))
|
||||
|
||||
# Separate called targets depending on type.
|
||||
INIT_TARGETS := $(filter $(ALL_INIT_TARGETS), $(CALLED_SPEC_TARGETS))
|
||||
MAIN_TARGETS := $(filter $(ALL_MAIN_TARGETS), $(CALLED_SPEC_TARGETS))
|
||||
SEQUENTIAL_TARGETS := $(filter dist-clean clean%, $(MAIN_TARGETS))
|
||||
PARALLEL_TARGETS := $(filter-out $(SEQUENTIAL_TARGETS), $(MAIN_TARGETS))
|
||||
|
||||
MAKE_INIT_ARGS := $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -I $(TOPDIR)/make/common
|
||||
|
||||
# The spec files depend on the autoconf source code. This check makes sure
|
||||
# the configuration is up to date after changes to configure.
|
||||
$(SPECS): $(wildcard $(TOPDIR)/make/autoconf/*) \
|
||||
$(if $(CUSTOM_CONFIG_DIR), $(wildcard $(CUSTOM_CONFIG_DIR)/*)) \
|
||||
$(addprefix $(TOPDIR)/make/conf/, version-numbers.conf branding.conf) \
|
||||
$(if $(CUSTOM_CONF_DIR), $(wildcard $(addprefix $(CUSTOM_CONF_DIR)/, \
|
||||
version-numbers.conf branding.conf)))
|
||||
ifeq ($(CONF_CHECK), fail)
|
||||
@echo Error: The configuration is not up to date for \
|
||||
"'$(lastword $(subst /, , $(dir $@)))'."
|
||||
$(call PrintConfCheckFailed)
|
||||
@exit 2
|
||||
else ifeq ($(CONF_CHECK), auto)
|
||||
@echo Note: The configuration is not up to date for \
|
||||
"'$(lastword $(subst /, , $(dir $@)))'."
|
||||
@( cd $(TOPDIR) && \
|
||||
$(MAKE) $(MAKE_INIT_ARGS) -f $(TOPDIR)/make/Init.gmk SPEC=$@ \
|
||||
reconfigure )
|
||||
else ifeq ($(CONF_CHECK), ignore)
|
||||
# Do nothing
|
||||
endif
|
||||
|
||||
# Do not let make delete spec files even if aborted while doing a reconfigure
|
||||
.PRECIOUS: $(SPECS)
|
||||
|
||||
# Unless reconfigure is explicitly called, let all main targets depend on
|
||||
# the spec files to be up to date.
|
||||
ifeq ($(findstring reconfigure, $(INIT_TARGETS)), )
|
||||
$(MAIN_TARGETS): $(SPECS)
|
||||
endif
|
||||
|
||||
make-info:
|
||||
ifneq ($(findstring $(LOG_LEVEL), info debug trace), )
|
||||
$(info Running make as '$(strip $(MAKE) $(MFLAGS) \
|
||||
$(COMMAND_LINE_VARIABLES) $(MAKECMDGOALS))')
|
||||
endif
|
||||
|
||||
MAKE_INIT_MAIN_TARGET_ARGS := \
|
||||
USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \
|
||||
$(MAKE_LOG_VARS) \
|
||||
INIT_TARGETS="$(INIT_TARGETS)" \
|
||||
SEQUENTIAL_TARGETS="$(SEQUENTIAL_TARGETS)" \
|
||||
PARALLEL_TARGETS="$(PARALLEL_TARGETS)"
|
||||
|
||||
# Now the init and main targets will be called, once for each SPEC. The
|
||||
# recipe will be run once for every target specified, but we only want to
|
||||
# execute the recipe a single time, hence the TARGET_DONE with a dummy
|
||||
# command if true.
|
||||
# The COMPARE_BUILD part implements special support for makefile development.
|
||||
$(ALL_INIT_TARGETS) $(ALL_MAIN_TARGETS): make-info
|
||||
@$(if $(TARGET_DONE), \
|
||||
true \
|
||||
, \
|
||||
( cd $(TOPDIR) && \
|
||||
$(foreach spec, $(SPECS), \
|
||||
$(MAKE) $(MAKE_INIT_ARGS) -j 1 -f $(TOPDIR)/make/Init.gmk \
|
||||
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) TOPDIR_ALT=$(TOPDIR) \
|
||||
COMPARE_BUILD="$(COMPARE_BUILD)" \
|
||||
pre-compare-build && \
|
||||
$(MAKE) $(MAKE_INIT_ARGS) -j 1 -f $(TOPDIR)/make/Init.gmk \
|
||||
SPEC=$(spec) TOPDIR_ALT=$(TOPDIR) \
|
||||
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" \
|
||||
$(MAKE_INIT_MAIN_TARGET_ARGS) main && \
|
||||
$(MAKE) $(MAKE_INIT_ARGS) -f $(TOPDIR)/make/Init.gmk \
|
||||
SPEC=$(spec) TOPDIR_ALT=$(TOPDIR) \
|
||||
COMPARE_BUILD="$(COMPARE_BUILD):NODRYRUN=true" \
|
||||
post-compare-build && \
|
||||
) \
|
||||
) true ) \
|
||||
$(eval TARGET_DONE=true) \
|
||||
)
|
||||
|
||||
.PHONY: $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS)
|
||||
|
||||
else # SKIP_SPEC=true
|
||||
|
||||
############################################################################
|
||||
# We have only global targets, or are called with -pq (from command
|
||||
# completion). In this case we might not even have a configuration at all, but
|
||||
# still need to handle the situation gracefully even if there is no SPEC file.
|
||||
############################################################################
|
||||
|
||||
ifeq ($(wildcard $(SPEC)), )
|
||||
# If we have no SPEC provided, we will just make a "best effort" target list.
|
||||
# First try to grab any available pre-existing main-targets.gmk.
|
||||
main_targets_file := $(firstword $(wildcard $(build_dir)/*/make-support/main-targets.gmk))
|
||||
ifneq ($(main_targets_file), )
|
||||
# Extract the SPEC that corresponds to this main-targets.gmk file.
|
||||
SPEC := $(patsubst %/make-support/main-targets.gmk, %/spec.gmk, $(main_targets_file))
|
||||
else
|
||||
# None found, pick an arbitrary SPEC for which to generate a file
|
||||
SPEC := $(firstword $(all_spec_files))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard $(SPEC)), )
|
||||
$(eval $(call DefineMainTargets, LAZY, $(SPEC)))
|
||||
else
|
||||
# If we have no configurations we can not provide any main targets.
|
||||
ALL_MAIN_TARGETS :=
|
||||
endif
|
||||
|
||||
ALL_TARGETS := $(sort $(ALL_GLOBAL_TARGETS) $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS))
|
||||
|
||||
# Just list all our targets.
|
||||
$(ALL_TARGETS):
|
||||
|
||||
.PHONY: $(ALL_TARGETS)
|
||||
|
||||
endif # $(SKIP_SPEC)!=true
|
||||
|
||||
################################################################################
|
||||
292
make/PreInitSupport.gmk
Normal file
292
make/PreInitSupport.gmk
Normal file
@ -0,0 +1,292 @@
|
||||
#
|
||||
# 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
|
||||
# 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.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Helper functions for PreInit.gmk, the initial part of initialization before
|
||||
# the SPEC file is loaded. Most of these functions provide parsing and setting
|
||||
# up make options from the command-line.
|
||||
################################################################################
|
||||
|
||||
# Include the corresponding closed file, if present.
|
||||
ifneq ($(CUSTOM_MAKE_DIR), )
|
||||
-include $(CUSTOM_MAKE_DIR)/PreInitSupport-pre.gmk
|
||||
endif
|
||||
|
||||
# COMMA is defined in spec.gmk, but that is not included yet
|
||||
COMMA := ,
|
||||
|
||||
# Essential control variables that are handled by PreInit.gmk or Init.gmk
|
||||
INIT_CONTROL_VARIABLES := LOG CONF CONF_NAME SPEC JOBS CONF_CHECK ALLOW \
|
||||
COMPARE_BUILD
|
||||
|
||||
# All known make control variables; these are handled in other makefiles
|
||||
MAKE_CONTROL_VARIABLES += JDK_FILTER SPEC_FILTER \
|
||||
TEST TEST_JOBS JTREG GTEST MICRO TEST_OPTS TEST_VM_OPTS TEST_DEPS
|
||||
|
||||
ALL_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) $(MAKE_CONTROL_VARIABLES)
|
||||
|
||||
# Define a simple reverse function.
|
||||
# Should maybe move to MakeBase.gmk, but we can't include that file now.
|
||||
reverse = \
|
||||
$(if $(strip $(1)), $(call reverse, $(wordlist 2, $(words $(1)), $(1)))) \
|
||||
$(firstword $(1))
|
||||
|
||||
# The variable MAKEOVERRIDES contains variable assignments from the command
|
||||
# line, but in reverse order to what the user entered.
|
||||
# The '§' <=> '\ 'dance is needed to keep values with space in them connected.
|
||||
COMMAND_LINE_VARIABLES := $(subst §,\ , $(call reverse, $(subst \ ,§,$(MAKEOVERRIDES))))
|
||||
|
||||
# A list like FOO="val1" BAR="val2" containing all user-supplied make
|
||||
# variables that we should propagate.
|
||||
# The '§' <=> '\ 'dance is needed to keep values with space in them connected.
|
||||
# This explicit propagation is needed to avoid problems with characters that needs
|
||||
# escaping.
|
||||
USER_MAKE_VARS := $(subst §,\ , $(filter-out $(addsuffix =%, $(ALL_CONTROL_VARIABLES)), \
|
||||
$(subst \ ,§,$(MAKEOVERRIDES))))
|
||||
|
||||
# Setup information about available configurations, if any.
|
||||
ifneq ($(CUSTOM_ROOT), )
|
||||
build_dir := $(CUSTOM_ROOT)/build
|
||||
else
|
||||
build_dir := $(TOPDIR)/build
|
||||
endif
|
||||
all_spec_files := $(wildcard $(build_dir)/*/spec.gmk)
|
||||
# Extract the configuration names from the path
|
||||
all_confs := $(patsubst %/spec.gmk, %, $(patsubst $(build_dir)/%, %, $(all_spec_files)))
|
||||
|
||||
# Check for unknown command-line variables
|
||||
define CheckControlVariables
|
||||
command_line_variables := $$(strip $$(foreach var, \
|
||||
$$(subst \ ,_,$$(MAKEOVERRIDES)), \
|
||||
$$(firstword $$(subst =, , $$(var)))))
|
||||
allowed_command_line_variables := $$(strip $$(subst $$(COMMA), , $$(ALLOW)))
|
||||
unknown_command_line_variables := $$(strip \
|
||||
$$(filter-out $$(ALL_CONTROL_VARIABLES) $$(allowed_command_line_variables), \
|
||||
$$(command_line_variables)))
|
||||
ifneq ($$(unknown_command_line_variables), )
|
||||
$$(info Note: Command line contains non-control variables:)
|
||||
$$(foreach var, $$(unknown_command_line_variables), $$(info * $$(var)=$$($$(var))))
|
||||
$$(info Make sure it is not mistyped, and that you intend to override this variable.)
|
||||
$$(info 'make help' will list known control variables.)
|
||||
$$(info )
|
||||
endif
|
||||
endef
|
||||
|
||||
# Check for invalid make flags like -j
|
||||
define CheckInvalidMakeFlags
|
||||
# This is a trick to get this rule to execute before any other rules
|
||||
# MAKEFLAGS only indicate -j if read in a recipe (!)
|
||||
$$(TOPDIR)/make/PreInit.gmk: .FORCE
|
||||
$$(if $$(findstring --jobserver, $$(MAKEFLAGS)), \
|
||||
$$(info Error: 'make -jN' is not supported, use 'make JOBS=N') \
|
||||
$$(error Cannot continue) \
|
||||
)
|
||||
.FORCE:
|
||||
.PHONY: .FORCE
|
||||
endef
|
||||
|
||||
# Check that the CONF_CHECK option is valid and set up handling
|
||||
define ParseConfCheckOption
|
||||
ifeq ($$(CONF_CHECK), )
|
||||
# Default behavior is fail
|
||||
CONF_CHECK := fail
|
||||
else ifneq ($$(filter-out auto fail ignore, $$(CONF_CHECK)), )
|
||||
$$(info Error: CONF_CHECK must be one of: auto, fail or ignore.)
|
||||
$$(error Cannot continue)
|
||||
endif
|
||||
endef
|
||||
|
||||
define ParseConfAndSpec
|
||||
ifneq ($$(origin SPEC), undefined)
|
||||
# We have been given a SPEC, check that it works out properly
|
||||
ifneq ($$(origin CONF), undefined)
|
||||
# We also have a CONF argument. We can't have both.
|
||||
$$(info Error: Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.)
|
||||
$$(error Cannot continue)
|
||||
endif
|
||||
ifneq ($$(origin CONF_NAME), undefined)
|
||||
# We also have a CONF_NAME argument. We can't have both.
|
||||
$$(info Error: Cannot use CONF_NAME=$$(CONF_NAME) and SPEC=$$(SPEC) at the same time. Choose one.)
|
||||
$$(error Cannot continue)
|
||||
endif
|
||||
ifeq ($$(wildcard $$(SPEC)), )
|
||||
$$(info Error: Cannot locate spec.gmk, given by SPEC=$$(SPEC).)
|
||||
$$(error Cannot continue)
|
||||
endif
|
||||
ifeq ($$(filter /%, $$(SPEC)), )
|
||||
# If given with relative path, make it absolute
|
||||
SPECS := $$(CURDIR)/$$(strip $$(SPEC))
|
||||
else
|
||||
SPECS := $$(SPEC)
|
||||
endif
|
||||
|
||||
# For now, unset this SPEC variable.
|
||||
override SPEC :=
|
||||
else
|
||||
# Use spec.gmk files in the build output directory
|
||||
ifeq ($$(all_spec_files), )
|
||||
ifneq ($(CUSTOM_ROOT), )
|
||||
$$(info Error: No configurations found for $$(CUSTOM_ROOT).)
|
||||
else
|
||||
$$(info Error: No configurations found for $$(TOPDIR).)
|
||||
endif
|
||||
$$(info Please run 'bash configure' to create a configuration.)
|
||||
$$(info )
|
||||
$$(error Cannot continue)
|
||||
endif
|
||||
|
||||
ifneq ($$(origin CONF_NAME), undefined)
|
||||
ifneq ($$(origin CONF), undefined)
|
||||
# We also have a CONF argument. We can't have both.
|
||||
$$(info Error: Cannot use CONF=$$(CONF) and CONF_NAME=$$(CONF_NAME) at the same time. Choose one.)
|
||||
$$(error Cannot continue)
|
||||
endif
|
||||
matching_conf := $$(strip $$(filter $$(CONF_NAME), $$(all_confs)))
|
||||
ifeq ($$(matching_conf), )
|
||||
$$(info Error: No configurations found matching CONF_NAME=$$(CONF_NAME).)
|
||||
$$(info Available configurations in $$(build_dir):)
|
||||
$$(foreach var, $$(all_confs), $$(info * $$(var)))
|
||||
$$(error Cannot continue)
|
||||
else ifneq ($$(words $$(matching_conf)), 1)
|
||||
$$(info Error: Matching more than one configuration CONF_NAME=$$(CONF_NAME).)
|
||||
$$(info Available configurations in $$(build_dir):)
|
||||
$$(foreach var, $$(all_confs), $$(info * $$(var)))
|
||||
$$(error Cannot continue)
|
||||
else
|
||||
$$(info Building configuration '$$(matching_conf)' (matching CONF_NAME=$$(CONF_NAME)))
|
||||
endif
|
||||
# Create a SPEC definition. This will contain the path to exactly one spec file.
|
||||
SPECS := $$(build_dir)/$$(matching_conf)/spec.gmk
|
||||
else ifneq ($$(origin CONF), undefined)
|
||||
# User have given a CONF= argument.
|
||||
ifeq ($$(CONF), )
|
||||
# If given CONF=, match all configurations
|
||||
matching_confs := $$(strip $$(all_confs))
|
||||
else
|
||||
# Otherwise select those that contain the given CONF string
|
||||
ifeq ($$(patsubst !%,,$$(CONF)), )
|
||||
# A CONF starting with ! means we should negate the search term
|
||||
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
|
||||
$$(if $$(findstring $$(subst !,,$$(CONF)), $$(var)), ,$$(var))))
|
||||
else
|
||||
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
|
||||
$$(if $$(findstring $$(CONF), $$(var)), $$(var))))
|
||||
endif
|
||||
ifneq ($$(filter $$(CONF), $$(matching_confs)), )
|
||||
ifneq ($$(word 2, $$(matching_confs)), )
|
||||
# Don't repeat this output on make restarts caused by including
|
||||
# generated files.
|
||||
ifeq ($$(MAKE_RESTARTS), )
|
||||
$$(info Using exact match for CONF=$$(CONF) (other matches are possible))
|
||||
endif
|
||||
endif
|
||||
# If we found an exact match, use that
|
||||
matching_confs := $$(CONF)
|
||||
endif
|
||||
endif
|
||||
ifeq ($$(matching_confs), )
|
||||
$$(info Error: No configurations found matching CONF=$$(CONF).)
|
||||
$$(info Available configurations in $$(build_dir):)
|
||||
$$(foreach var, $$(all_confs), $$(info * $$(var)))
|
||||
$$(error Cannot continue)
|
||||
else
|
||||
# Don't repeat this output on make restarts caused by including
|
||||
# generated files.
|
||||
ifeq ($$(MAKE_RESTARTS), )
|
||||
ifeq ($$(words $$(matching_confs)), 1)
|
||||
ifneq ($$(findstring $$(LOG_LEVEL), info debug trace), )
|
||||
$$(info Building configuration '$$(matching_confs)' (matching CONF=$$(CONF)))
|
||||
endif
|
||||
else
|
||||
$$(info Building these configurations (matching CONF=$$(CONF)):)
|
||||
$$(foreach var, $$(matching_confs), $$(info * $$(var)))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Create a SPEC definition. This will contain the path to one or more spec.gmk files.
|
||||
SPECS := $$(addsuffix /spec.gmk, $$(addprefix $$(build_dir)/, $$(matching_confs)))
|
||||
else
|
||||
# No CONF or SPEC given, check the available configurations
|
||||
ifneq ($$(words $$(all_spec_files)), 1)
|
||||
$$(info Error: No CONF given, but more than one configuration found.)
|
||||
$$(info Available configurations in $$(build_dir):)
|
||||
$$(foreach var, $$(all_confs), $$(info * $$(var)))
|
||||
$$(info Please retry building with CONF=<config pattern> (or SPEC=<spec file>).)
|
||||
$$(info )
|
||||
$$(error Cannot continue)
|
||||
endif
|
||||
|
||||
# We found exactly one configuration, use it
|
||||
SPECS := $$(strip $$(all_spec_files))
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
# Extract main targets from Main.gmk using the spec provided in $2.
|
||||
#
|
||||
# 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 $$(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.
|
||||
ifeq ($(strip $1), FORCE)
|
||||
$$(shell rm -f $$(main_targets_file))
|
||||
endif
|
||||
endif
|
||||
|
||||
$$(main_targets_file):
|
||||
@( cd $$(TOPDIR) && \
|
||||
$$(MAKE) $$(MAKE_LOG_FLAGS) -s -r -R -f $$(TOPDIR)/make/GenerateFindTests.gmk \
|
||||
-I $$(TOPDIR)/make/common SPEC=$$(SPEC_FILE) TOPDIR_ALT=$$(TOPDIR))
|
||||
@( cd $$(TOPDIR) && \
|
||||
$$(MAKE) $$(MAKE_LOG_FLAGS) -s -r -R -f $$(TOPDIR)/make/Main.gmk \
|
||||
-I $$(TOPDIR)/make/common SPEC=$$(SPEC_FILE) TOPDIR_ALT=$$(TOPDIR) \
|
||||
UPDATE_MODULE_DEPS=true NO_RECIPES=true \
|
||||
$$(MAKE_LOG_VARS) \
|
||||
create-main-targets-include )
|
||||
|
||||
# Now include main-targets.gmk. This will define ALL_MAIN_TARGETS.
|
||||
-include $$(main_targets_file)
|
||||
endef
|
||||
|
||||
define PrintConfCheckFailed
|
||||
@echo ' '
|
||||
@echo "Please rerun configure! Easiest way to do this is by running"
|
||||
@echo "'make reconfigure'."
|
||||
@echo "This behavior may also be changed using CONF_CHECK=<ignore|auto>."
|
||||
@echo ' '
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2023, 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
|
||||
@ -23,16 +23,12 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# This makefile generates the "release" file into the exploded image. Jlink is
|
||||
# then responsible for using this as the base for release files in each linked
|
||||
# image.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
BASE_RELEASE_FILE := $(JDK_OUTPUTDIR)/release
|
||||
@ -85,10 +81,4 @@ TARGETS += $(BASE_RELEASE_FILE)
|
||||
|
||||
################################################################################
|
||||
|
||||
$(eval $(call IncludeCustomExtension, ReleaseFile.gmk))
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
.PHONY: all default
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -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
|
||||
@ -23,10 +23,10 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include FindTests.gmk
|
||||
|
||||
# We will always run multiple tests serially
|
||||
@ -45,7 +45,7 @@ ifneq ($(TEST_VM_OPTS), )
|
||||
endif
|
||||
|
||||
$(eval $(call ParseKeywordVariable, TEST_OPTS, \
|
||||
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR JCOV JCOV_DIFF_CHANGESET, \
|
||||
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR JCOV JCOV_DIFF_CHANGESET AOT_JDK, \
|
||||
STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS, \
|
||||
))
|
||||
|
||||
@ -71,9 +71,6 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
endif
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, RunTests.gmk))
|
||||
################################################################################
|
||||
|
||||
# This is the JDK that we will test
|
||||
@ -108,8 +105,8 @@ ifneq ($(wildcard $(JTREG_FAILURE_HANDLER)), )
|
||||
#
|
||||
endif
|
||||
|
||||
GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher, %, \
|
||||
$(wildcard $(TEST_IMAGE_DIR)/hotspot/gtest/*/gtestLauncher))
|
||||
GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher$(EXECUTABLE_SUFFIX), %, \
|
||||
$(wildcard $(TEST_IMAGE_DIR)/hotspot/gtest/*/gtestLauncher$(EXECUTABLE_SUFFIX)))
|
||||
GTEST_VARIANTS := $(strip $(patsubst $(TEST_IMAGE_DIR)/hotspot/gtest/%, %, \
|
||||
$(GTEST_LAUNCHER_DIRS)))
|
||||
|
||||
@ -118,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
|
||||
@ -202,11 +200,13 @@ $(eval $(call SetTestOpt,JOBS,JTREG))
|
||||
$(eval $(call SetTestOpt,TIMEOUT_FACTOR,JTREG))
|
||||
$(eval $(call SetTestOpt,FAILURE_HANDLER_TIMEOUT,JTREG))
|
||||
$(eval $(call SetTestOpt,REPORT,JTREG))
|
||||
$(eval $(call SetTestOpt,AOT_JDK,JTREG))
|
||||
|
||||
$(eval $(call ParseKeywordVariable, JTREG, \
|
||||
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR FAILURE_HANDLER_TIMEOUT \
|
||||
TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY MAX_MEM RUN_PROBLEM_LISTS \
|
||||
RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
|
||||
TEST_MODE ASSERT VERBOSE RETAIN TEST_THREAD_FACTORY JVMTI_STRESS_AGENT \
|
||||
MAX_MEM RUN_PROBLEM_LISTS RETRY_COUNT REPEAT_COUNT MAX_OUTPUT REPORT \
|
||||
AOT_JDK $(CUSTOM_JTREG_SINGLE_KEYWORDS), \
|
||||
STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS KEYWORDS \
|
||||
EXTRA_PROBLEM_LISTS LAUNCHER_OPTIONS \
|
||||
$(CUSTOM_JTREG_STRING_KEYWORDS), \
|
||||
@ -529,21 +529,33 @@ define SetupRunGtestTestBody
|
||||
$$(call LogWarn, Test report is stored in $$(strip \
|
||||
$$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR))))
|
||||
$$(if $$(wildcard $$($1_RESULT_FILE)), \
|
||||
$$(eval $1_TOTAL := $$(shell $$(AWK) '/==========.* tests? from .* \
|
||||
test (cases?|suites?) ran/ { print $$$$2 }' $$($1_RESULT_FILE))) \
|
||||
$$(if $$($1_TOTAL), , $$(eval $1_TOTAL := 0)) \
|
||||
$$(eval $1_RUN := $$(shell $$(AWK) \
|
||||
'/==========.* tests? from .* test (cases?|suites?) ran/ { print $$$$2 }' \
|
||||
$$($1_RESULT_FILE))) \
|
||||
$$(if $$($1_RUN), , $$(eval $1_RUN := 0)) \
|
||||
$$(eval $1_PASSED := $$(shell $$(AWK) '/\[ PASSED \] .* tests?./ \
|
||||
{ print $$$$4 }' $$($1_RESULT_FILE))) \
|
||||
$$(if $$($1_PASSED), , $$(eval $1_PASSED := 0)) \
|
||||
$$(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_TOTAL) - $$($1_PASSED) - $$($1_FAILED))) \
|
||||
$$(EXPR) $$($1_RUN) - $$($1_PASSED) - $$($1_FAILED) - $$($1_GTEST_SKIPPED))) \
|
||||
$$(eval $1_TOTAL := $$(shell \
|
||||
$$(EXPR) $$($1_RUN) + $$($1_GTEST_DISABLED))) \
|
||||
, \
|
||||
$$(eval $1_PASSED := 0) \
|
||||
$$(eval $1_FAILED := 0) \
|
||||
$$(eval $1_ERROR := 1) \
|
||||
$$(eval $1_SKIPPED := 0) \
|
||||
$$(eval $1_TOTAL := 1) \
|
||||
)
|
||||
|
||||
@ -572,6 +584,8 @@ define SetMicroValue
|
||||
else
|
||||
ifneq ($3, )
|
||||
$1_$2 := $3
|
||||
else
|
||||
$1_$2 :=
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
@ -604,7 +618,7 @@ define SetupRunMicroTestBody
|
||||
$1_JMH_JVM_ARGS += $$(MICRO_VM_OPTIONS) $$(MICRO_JAVA_OPTIONS)
|
||||
endif
|
||||
|
||||
$1_MICRO_VM_OPTIONS := -jvmArgs $(call ShellQuote,$$($1_JMH_JVM_ARGS))
|
||||
$1_MICRO_VM_OPTIONS := -jvmArgsPrepend $(call ShellQuote,$$($1_JMH_JVM_ARGS))
|
||||
|
||||
ifneq ($$(MICRO_ITER), )
|
||||
$1_MICRO_ITER := -i $$(MICRO_ITER)
|
||||
@ -667,6 +681,7 @@ define SetupRunMicroTestBody
|
||||
$$(eval $1_ERROR := 1) \
|
||||
$$(eval $1_TOTAL := 1) \
|
||||
)
|
||||
$$(eval $1_SKIPPED := 0)
|
||||
|
||||
$1: run-test-$1 parse-test-$1
|
||||
|
||||
@ -697,11 +712,87 @@ define SetJtregValue
|
||||
else
|
||||
ifneq ($3, )
|
||||
$1_$2 := $3
|
||||
else
|
||||
$1_$2 :=
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# Helper function for creating a customized AOT cache for running tests
|
||||
################################################################################
|
||||
|
||||
# Parameter 1 is the name of the rule.
|
||||
#
|
||||
# Remaining parameters are named arguments.
|
||||
# TRAINING The AOT training mode: onestep or twostep
|
||||
# VM_OPTIONS List of JVM arguments to use when creating AOT cache
|
||||
#
|
||||
# After calling this, the following variables are defined
|
||||
# $1_AOT_TARGETS List of all targets that the test rule will need to depend on
|
||||
# $1_AOT_JDK_CACHE The AOT cache file to be used to run the test with
|
||||
#
|
||||
SetupAOT = $(NamedParamsMacroTemplate)
|
||||
define SetupAOTBody
|
||||
$1_AOT_JDK_OUTPUT_DIR := $$($1_TEST_SUPPORT_DIR)/aot
|
||||
$1_AOT_JDK_CONF := $$($1_AOT_JDK_OUTPUT_DIR)/jdk.aotconf
|
||||
$1_AOT_JDK_CACHE := $$($1_AOT_JDK_OUTPUT_DIR)/jdk.aotcache
|
||||
$1_AOT_JDK_LOG := $$($1_AOT_JDK_OUTPUT_DIR)/TestSetupAOT.log
|
||||
|
||||
# We execute the training run with the TestSetupAOT class from $(TEST_IMAGE_DIR)/setup_aot/TestSetupAOT.jar
|
||||
# to touch a fair number of classes inside the JDK. Note that we can't specify a classpath,
|
||||
# or else the AOT cache cannot be used with jtreg test cases that use a different value
|
||||
# for their classpaths. Instead, we cd in the $$($1_AOT_JDK_OUTPUT_DIR) directory,
|
||||
# extract the TestSetupAOT.jar there, and run in that directory without specifying a classpath.
|
||||
# The "java" launcher will have an implicit classpath of ".", so it can pick up the TestSetupAOT
|
||||
# class from the JVM's current directory.
|
||||
#
|
||||
# The TestSetupAOT class (or any other classes that are loaded from ".") will be excluded
|
||||
# from the the AOT cache as "." is an unsupported location. As a result, the AOT cache will contain
|
||||
# only classes from the JDK.
|
||||
|
||||
$$($1_AOT_JDK_CACHE): $$(JDK_IMAGE_DIR)/release
|
||||
$$(call MakeDir, $$($1_AOT_JDK_OUTPUT_DIR))
|
||||
|
||||
ifeq ($$($1_TRAINING), onestep)
|
||||
|
||||
$$(call LogWarn, AOT: Create AOT cache $$($1_AOT_JDK_CACHE) in one step with flags: $$($1_VM_OPTIONS)) \
|
||||
$$(call ExecuteWithLog, $$($1_AOT_JDK_OUTPUT_DIR), ( \
|
||||
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,aot,aot+class=debug:file=$$($1_AOT_JDK_CACHE).log -Xlog:cds*=error -Xlog:aot*=error \
|
||||
-XX:AOTMode=record -XX:AOTCacheOutput=$$($1_AOT_JDK_CACHE) \
|
||||
TestSetupAOT $$($1_AOT_JDK_OUTPUT_DIR) > $$($1_AOT_JDK_LOG) \
|
||||
))
|
||||
|
||||
else
|
||||
|
||||
$$(call LogWarn, AOT: Create cache configuration) \
|
||||
$$(call ExecuteWithLog, $$($1_AOT_JDK_OUTPUT_DIR), ( \
|
||||
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,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) \
|
||||
))
|
||||
|
||||
$$(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: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) \
|
||||
))
|
||||
|
||||
endif
|
||||
|
||||
$1_AOT_TARGETS += $$($1_AOT_JDK_CACHE)
|
||||
|
||||
endef
|
||||
|
||||
SetupRunJtregTest = $(NamedParamsMacroTemplate)
|
||||
define SetupRunJtregTestBody
|
||||
$1_TEST_RESULTS_DIR := $$(TEST_RESULTS_DIR)/$1
|
||||
@ -762,6 +853,7 @@ define SetupRunJtregTestBody
|
||||
JTREG_RETRY_COUNT ?= 0
|
||||
JTREG_REPEAT_COUNT ?= 0
|
||||
JTREG_REPORT ?= files
|
||||
JTREG_AOT_JDK ?= none
|
||||
|
||||
ifneq ($$(JTREG_RETRY_COUNT), 0)
|
||||
ifneq ($$(JTREG_REPEAT_COUNT), 0)
|
||||
@ -771,6 +863,12 @@ define SetupRunJtregTestBody
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$(JTREG_RUN_PROBLEM_LISTS), true)
|
||||
JTREG_PROBLEM_LIST_PREFIX := -match:
|
||||
else
|
||||
JTREG_PROBLEM_LIST_PREFIX := -exclude:
|
||||
endif
|
||||
|
||||
ifneq ($$(JTREG_TEST_THREAD_FACTORY), )
|
||||
$1_JTREG_BASIC_OPTIONS += -testThreadFactoryPath:$$(JTREG_TEST_THREAD_FACTORY_JAR)
|
||||
$1_JTREG_BASIC_OPTIONS += -testThreadFactory:$$(JTREG_TEST_THREAD_FACTORY)
|
||||
@ -779,6 +877,15 @@ define SetupRunJtregTestBody
|
||||
))
|
||||
endif
|
||||
|
||||
ifneq ($$(JTREG_JVMTI_STRESS_AGENT), )
|
||||
AGENT := $$(LIBRARY_PREFIX)JvmtiStressAgent$$(SHARED_LIBRARY_SUFFIX)=$$(JTREG_JVMTI_STRESS_AGENT)
|
||||
$1_JTREG_BASIC_OPTIONS += -javaoption:'-agentpath:$(TEST_IMAGE_DIR)/hotspot/jtreg/native/$$(AGENT)'
|
||||
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
|
||||
$$(addprefix $$($1_TEST_ROOT)/, ProblemList-jvmti-stress-agent.txt) \
|
||||
))
|
||||
endif
|
||||
|
||||
|
||||
ifneq ($$(JTREG_LAUNCHER_OPTIONS), )
|
||||
$1_JTREG_LAUNCHER_OPTIONS += $$(JTREG_LAUNCHER_OPTIONS)
|
||||
endif
|
||||
@ -799,7 +906,7 @@ define SetupRunJtregTestBody
|
||||
# version of the JDK.
|
||||
$1_JTREG_BASIC_OPTIONS += -$$($1_JTREG_TEST_MODE) \
|
||||
-verbose:$$(JTREG_VERBOSE) -retain:$$(JTREG_RETAIN) \
|
||||
-concurrency:$$($1_JTREG_JOBS) -timeoutFactor:$$(JTREG_TIMEOUT_FACTOR) \
|
||||
-concurrency:$$($1_JTREG_JOBS) \
|
||||
-vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE) \
|
||||
-vmoption:-Dtest.boot.jdk="$$(BOOT_JDK)" \
|
||||
-vmoption:-Djava.io.tmpdir="$$($1_TEST_TMP_DIR)"
|
||||
@ -832,12 +939,6 @@ define SetupRunJtregTestBody
|
||||
$1_JTREG_BASIC_OPTIONS += -nativepath:$$($1_JTREG_NATIVEPATH)
|
||||
endif
|
||||
|
||||
ifeq ($$(JTREG_RUN_PROBLEM_LISTS), true)
|
||||
JTREG_PROBLEM_LIST_PREFIX := -match:
|
||||
else
|
||||
JTREG_PROBLEM_LIST_PREFIX := -exclude:
|
||||
endif
|
||||
|
||||
ifneq ($$($1_JTREG_PROBLEM_LIST), )
|
||||
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$($1_JTREG_PROBLEM_LIST))
|
||||
endif
|
||||
@ -845,7 +946,8 @@ define SetupRunJtregTestBody
|
||||
JTREG_ALL_OPTIONS := $$(JTREG_JAVA_OPTIONS) $$(JTREG_VM_OPTIONS)
|
||||
|
||||
JTREG_AUTO_PROBLEM_LISTS :=
|
||||
JTREG_AUTO_TIMEOUT_FACTOR := 4
|
||||
# Please reach consensus before changing this. It was not easy changing it to a `1`.
|
||||
JTREG_AUTO_TIMEOUT_FACTOR := 1
|
||||
|
||||
ifneq ($$(findstring -Xcomp, $$(JTREG_ALL_OPTIONS)), )
|
||||
JTREG_AUTO_PROBLEM_LISTS += ProblemList-Xcomp.txt
|
||||
@ -853,13 +955,18 @@ define SetupRunJtregTestBody
|
||||
endif
|
||||
|
||||
ifneq ($$(findstring -XX:+UseZGC, $$(JTREG_ALL_OPTIONS)), )
|
||||
ifneq ($$(findstring -XX:-ZGenerational, $$(JTREG_ALL_OPTIONS)), )
|
||||
JTREG_AUTO_PROBLEM_LISTS += ProblemList-zgc.txt
|
||||
else
|
||||
JTREG_AUTO_PROBLEM_LISTS += ProblemList-generational-zgc.txt
|
||||
endif
|
||||
JTREG_AUTO_PROBLEM_LISTS += ProblemList-zgc.txt
|
||||
endif
|
||||
|
||||
ifneq ($$(findstring -XX:+UseShenandoahGC, $$(JTREG_ALL_OPTIONS)), )
|
||||
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 \
|
||||
@ -872,6 +979,11 @@ define SetupRunJtregTestBody
|
||||
$1_JTREG_BASIC_OPTIONS += -e:JIB_HOME=$$(JIB_HOME)
|
||||
endif
|
||||
|
||||
ifneq ($$(JDK_FOR_COMPILE), )
|
||||
# Allow overriding the JDK used for compilation from the command line
|
||||
$1_JTREG_BASIC_OPTIONS += -compilejdk:$$(JDK_FOR_COMPILE)
|
||||
endif
|
||||
|
||||
$1_JTREG_BASIC_OPTIONS += -e:TEST_IMAGE_DIR=$(TEST_IMAGE_DIR)
|
||||
|
||||
$1_JTREG_BASIC_OPTIONS += -e:DOCS_JDK_IMAGE_DIR=$$(DOCS_JDK_IMAGE_DIR)
|
||||
@ -891,6 +1003,16 @@ define SetupRunJtregTestBody
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($$(filter $$(JTREG_AOT_JDK), onestep twostep), )
|
||||
$$(call LogWarn, Add AOT target for $1)
|
||||
$$(eval $$(call SetupAOT, $1, \
|
||||
TRAINING := $$(JTREG_AOT_JDK), \
|
||||
VM_OPTIONS := $$(JTREG_ALL_OPTIONS) ))
|
||||
$$(call LogWarn, AOT_JDK_CACHE=$$($1_AOT_JDK_CACHE))
|
||||
$1_JTREG_BASIC_OPTIONS += -vmoption:-XX:AOTCache="$$($1_AOT_JDK_CACHE)"
|
||||
endif
|
||||
|
||||
|
||||
$$(eval $$(call SetupRunJtregTestCustom, $1))
|
||||
|
||||
# SetupRunJtregTestCustom might also adjust JTREG_AUTO_ variables
|
||||
@ -904,8 +1026,10 @@ define SetupRunJtregTestBody
|
||||
endif
|
||||
|
||||
JTREG_TIMEOUT_FACTOR ?= $$(JTREG_AUTO_TIMEOUT_FACTOR)
|
||||
$1_JTREG_BASIC_OPTIONS += -timeoutFactor:$$(JTREG_TIMEOUT_FACTOR)
|
||||
|
||||
clean-outputdirs-$1:
|
||||
$$(call LogWarn, Clean up dirs for $1)
|
||||
$$(RM) -r $$($1_TEST_SUPPORT_DIR)
|
||||
$$(RM) -r $$($1_TEST_RESULTS_DIR)
|
||||
|
||||
@ -931,7 +1055,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 \
|
||||
@ -944,16 +1069,18 @@ 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
|
||||
endif
|
||||
|
||||
run-test-$1: pre-run-test clean-outputdirs-$1
|
||||
run-test-$1: clean-outputdirs-$1 pre-run-test $$($1_AOT_TARGETS)
|
||||
$$(call LogWarn)
|
||||
$$(call LogWarn, Running test '$$($1_TEST)')
|
||||
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR) \
|
||||
@ -968,23 +1095,64 @@ define SetupRunJtregTestBody
|
||||
$$(call LogWarn, Finished running test '$$($1_TEST)')
|
||||
$$(call LogWarn, Test report is stored in $$(strip \
|
||||
$$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR))))
|
||||
|
||||
# Read jtreg documentation to learn on the test stats categories:
|
||||
# https://github.com/openjdk/jtreg/blob/master/src/share/doc/javatest/regtest/faq.md#what-do-all-those-numbers-in-the-test-results-line-mean
|
||||
# In jtreg, "skipped:" category accounts for tests that threw jtreg.SkippedException at runtime.
|
||||
# At the same time these tests contribute to "passed:" tests.
|
||||
# In here we don't want that and so we substract number of "skipped:" from "passed:".
|
||||
|
||||
$$(if $$(wildcard $$($1_RESULT_FILE)), \
|
||||
$$(eval $1_PASSED := $$(shell $$(AWK) '{ gsub(/[,;]/, ""); \
|
||||
$$(eval $1_PASSED_AND_RUNTIME_SKIPPED := $$(shell $$(AWK) '{ gsub(/[,;]/, ""); \
|
||||
for (i=1; i<=NF; i++) { if ($$$$i == "passed:") \
|
||||
print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
|
||||
$$(if $$($1_PASSED), , $$(eval $1_PASSED := 0)) \
|
||||
$$(if $$($1_PASSED_AND_RUNTIME_SKIPPED), , $$(eval $1_PASSED_AND_RUNTIME_SKIPPED := 0)) \
|
||||
$$(eval $1_FAILED := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
|
||||
for (i=1; i<=NF; i++) { if ($$$$i == "failed:") \
|
||||
print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
|
||||
$$(if $$($1_FAILED), , $$(eval $1_FAILED := 0)) \
|
||||
$$(eval $1_RUNTIME_SKIPPED := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
|
||||
for (i=1; i<=NF; i++) { if ($$$$i == "skipped:") \
|
||||
print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
|
||||
$$(if $$($1_RUNTIME_SKIPPED), , $$(eval $1_RUNTIME_SKIPPED := 0)) \
|
||||
$$(eval $1_SKIPPED := $$(shell \
|
||||
$$(AWK) \
|
||||
'BEGIN { \
|
||||
overall_skipped = 0; \
|
||||
patterns[1] = "skipped"; \
|
||||
patterns[2] = "excluded"; \
|
||||
patterns[3] = "not in match-list"; \
|
||||
patterns[4] = "did not match keywords"; \
|
||||
patterns[5] = "did not meet module requirements"; \
|
||||
patterns[6] = "did not meet platform requirements"; \
|
||||
patterns[7] = "did not match prior status"; \
|
||||
patterns[8] = "did not meet time-limit requirements"; \
|
||||
} { \
|
||||
split($$$$0, arr, ";"); \
|
||||
for (item in arr) { \
|
||||
for (p in patterns) { \
|
||||
if (match(arr[item], patterns[p] ": [0-9]+")) { \
|
||||
overall_skipped += substr(arr[item], RSTART + length(patterns[p]) + 2, RLENGTH); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
print overall_skipped; \
|
||||
}' \
|
||||
$$($1_RESULT_FILE) \
|
||||
)) \
|
||||
$$(eval $1_ERROR := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
|
||||
for (i=1; i<=NF; i++) { if ($$$$i == "error:") \
|
||||
print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
|
||||
$$(if $$($1_ERROR), , $$(eval $1_ERROR := 0)) \
|
||||
\
|
||||
$$(eval $1_PASSED := $$(shell \
|
||||
$$(EXPR) $$($1_PASSED_AND_RUNTIME_SKIPPED) - $$($1_RUNTIME_SKIPPED))) \
|
||||
$$(eval $1_TOTAL := $$(shell \
|
||||
$$(EXPR) $$($1_PASSED) + $$($1_FAILED) + $$($1_ERROR))) \
|
||||
$$(EXPR) $$($1_PASSED) + $$($1_FAILED) + $$($1_ERROR) + $$($1_SKIPPED))) \
|
||||
, \
|
||||
$$(eval $1_PASSED := 0) \
|
||||
$$(eval $1_PASSED_AND_RUNTIME_SKIPPED := 0) \
|
||||
$$(eval $1_RUNTIME_SKIPPED := 0) \
|
||||
$$(eval $1_SKIPPED := 0) \
|
||||
$$(eval $1_FAILED := 0) \
|
||||
$$(eval $1_ERROR := 1) \
|
||||
$$(eval $1_TOTAL := 1) \
|
||||
@ -1043,8 +1211,6 @@ define SetupRunSpecialTestBody
|
||||
|| $$(ECHO) $$$$? > $$($1_EXITCODE) \
|
||||
))
|
||||
|
||||
$1_RESULT_FILE := $$($1_TEST_RESULTS_DIR)/gtest.txt
|
||||
|
||||
# We can not parse the various "special" tests.
|
||||
parse-test-$1: run-test-$1
|
||||
$$(call LogWarn, Finished running test '$$($1_TEST)')
|
||||
@ -1054,6 +1220,7 @@ define SetupRunSpecialTestBody
|
||||
$$(eval $1_PASSED := $$(shell \
|
||||
if [ `$(CAT) $$($1_EXITCODE)` = "0" ]; then $(ECHO) 1; else $(ECHO) 0; fi \
|
||||
))
|
||||
$$(eval $1_SKIPPED := 0)
|
||||
$$(eval $1_FAILED := $$(shell \
|
||||
if [ `$(CAT) $$($1_EXITCODE)` = "0" ]; then $(ECHO) 0; else $(ECHO) 1; fi \
|
||||
))
|
||||
@ -1087,7 +1254,7 @@ UseSpecialTestHandler = \
|
||||
# Now process each test to run and setup a proper make rule
|
||||
$(foreach test, $(TESTS_TO_RUN), \
|
||||
$(eval TEST_ID := $(shell $(ECHO) $(strip $(test)) | \
|
||||
$(TR) -cs '[a-z][A-Z][0-9]\n' '[_*1000]')) \
|
||||
$(TR) -cs '[a-z][A-Z][0-9]\n' '_')) \
|
||||
$(eval ALL_TEST_IDS += $(TEST_ID)) \
|
||||
$(if $(call UseCustomTestHandler, $(test)), \
|
||||
$(eval $(call SetupRunCustomTest, $(TEST_ID), \
|
||||
@ -1163,28 +1330,28 @@ run-test-report: post-run-test
|
||||
$(ECHO) >> $(TEST_SUMMARY) ==============================
|
||||
$(ECHO) >> $(TEST_SUMMARY) Test summary
|
||||
$(ECHO) >> $(TEST_SUMMARY) ==============================
|
||||
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s %5s %5s %5s %5s %2s\n" " " \
|
||||
TEST TOTAL PASS FAIL ERROR " "
|
||||
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s %5s %5s %5s %5s %5s %2s\n" " " \
|
||||
TEST TOTAL PASS FAIL ERROR SKIP " "
|
||||
$(foreach test, $(TESTS_TO_RUN), \
|
||||
$(eval TEST_ID := $(shell $(ECHO) $(strip $(test)) | \
|
||||
$(TR) -cs '[a-z][A-Z][0-9]\n' '[_*1000]')) \
|
||||
$(TR) -cs '[a-z][A-Z][0-9]\n' '_')) \
|
||||
$(ECHO) >> $(TEST_LAST_IDS) $(TEST_ID) $(NEWLINE) \
|
||||
$(eval NAME_PATTERN := $(shell $(ECHO) $(test) | $(TR) -c '\n' '[_*1000]')) \
|
||||
$(eval NAME_PATTERN := $(shell $(ECHO) $(test) | $(TR) -c '\n' '_')) \
|
||||
$(if $(filter __________________________________________________%, $(NAME_PATTERN)), \
|
||||
$(eval TEST_NAME := ) \
|
||||
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s\n" " " "$(test)" $(NEWLINE) \
|
||||
, \
|
||||
$(eval TEST_NAME := $(test)) \
|
||||
) \
|
||||
$(if $(filter $($(TEST_ID)_PASSED), $($(TEST_ID)_TOTAL)), \
|
||||
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s %5d %5d %5d %5d %2s\n" \
|
||||
" " "$(TEST_NAME)" $($(TEST_ID)_TOTAL) $($(TEST_ID)_PASSED) \
|
||||
$($(TEST_ID)_FAILED) $($(TEST_ID)_ERROR) " " $(NEWLINE) \
|
||||
, \
|
||||
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s %5d %5d %5d %5d %2s\n" \
|
||||
$(if $(filter-out 0, $($(TEST_ID)_FAILED) $($(TEST_ID)_ERROR)), \
|
||||
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s %5d %5d %5d %5d %5d %2s\n" \
|
||||
">>" "$(TEST_NAME)" $($(TEST_ID)_TOTAL) $($(TEST_ID)_PASSED) \
|
||||
$($(TEST_ID)_FAILED) $($(TEST_ID)_ERROR) "<<" $(NEWLINE) \
|
||||
$($(TEST_ID)_FAILED) $($(TEST_ID)_ERROR) $($(TEST_ID)_SKIPPED) "<<" $(NEWLINE) \
|
||||
$(eval TEST_FAILURE := true) \
|
||||
, \
|
||||
$(PRINTF) >> $(TEST_SUMMARY) "%2s %-49s %5d %5d %5d %5d %5d %2s\n" \
|
||||
" " "$(TEST_NAME)" $($(TEST_ID)_TOTAL) $($(TEST_ID)_PASSED) \
|
||||
$($(TEST_ID)_FAILED) $($(TEST_ID)_ERROR) $($(TEST_ID)_SKIPPED) " " $(NEWLINE) \
|
||||
) \
|
||||
)
|
||||
$(ECHO) >> $(TEST_SUMMARY) ==============================
|
||||
@ -1210,12 +1377,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 &
|
||||
|
||||
@ -1228,6 +1397,10 @@ ifeq ($(TEST_OPTS_JCOV), true)
|
||||
$(JAVA) -jar $(JCOV_HOME)/lib/jcov.jar GrabberManager -stop -stoptimeout 3600
|
||||
|
||||
JCOV_REPORT_TITLE := JDK code coverage report<br/>
|
||||
ifneq ($(JCOV_MODULES), )
|
||||
JCOV_MODULES_FILTER := $(foreach m, $(JCOV_MODULES), -include_module $m)
|
||||
JCOV_REPORT_TITLE += Included modules: $(JCOV_MODULES)<br>
|
||||
endif
|
||||
ifneq ($(JCOV_FILTERS), )
|
||||
JCOV_REPORT_TITLE += Code filters: $(JCOV_FILTERS)<br>
|
||||
endif
|
||||
@ -1235,11 +1408,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
|
||||
@ -1259,7 +1433,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)
|
||||
@ -1287,4 +1461,8 @@ endif
|
||||
|
||||
all: run-test
|
||||
|
||||
.PHONY: default all $(TARGETS)
|
||||
.PHONY: $(TARGETS)
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2017, 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,9 +24,11 @@
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Initial bootstrapping, copied and stripped down from Makefile and Init.gmk
|
||||
# Initial bootstrapping, copied and stripped down from Makefile and PreInit.gmk.
|
||||
################################################################################
|
||||
|
||||
IS_PREINIT_ENV := true
|
||||
|
||||
# In Cygwin, the MAKE variable gets prepended with the current directory if the
|
||||
# make executable is called using a Windows mixed path (c:/cygwin/bin/make.exe).
|
||||
ifneq ($(findstring :, $(MAKE)), )
|
||||
@ -57,7 +59,7 @@ TOPDIR := $(strip $(patsubst %/make/, %, $(dir $(makefile_path))))
|
||||
define SetupVariable
|
||||
ifeq ($$($1), )
|
||||
ifeq ($2, )
|
||||
$$(info Error: Prebuilt variable $1 is missing, needed for run-tests-prebuilt)
|
||||
$$(info Error: Prebuilt variable $1 is missing, needed for test-prebuilt)
|
||||
$$(error Cannot continue.)
|
||||
else ifeq ($2, OPTIONAL)
|
||||
ifneq ($$(findstring $$(LOG), info debug trace), )
|
||||
@ -135,10 +137,9 @@ $(eval $(call SetupVariable,JIB_JAR,OPTIONAL))
|
||||
# can include the prebuilt spec file ourselves, without an ephemeral spec
|
||||
# wrapper. This is required so we can include MakeBase which is needed for
|
||||
# CreateNewSpec.
|
||||
HAS_SPEC :=
|
||||
include $(TOPDIR)/make/InitSupport.gmk
|
||||
include $(TOPDIR)/make/PreInitSupport.gmk
|
||||
include $(TOPDIR)/make/common/LogUtils.gmk
|
||||
|
||||
$(eval $(call CheckDeprecatedEnvironment))
|
||||
$(eval $(call CheckInvalidMakeFlags))
|
||||
$(eval $(call ParseLogLevel))
|
||||
|
||||
@ -216,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), )
|
||||
@ -245,7 +246,7 @@ endif
|
||||
# Now we can include additional custom support.
|
||||
# This might define CUSTOM_NEW_SPEC_LINE
|
||||
ifneq ($(CUSTOM_MAKE_DIR), )
|
||||
include $(CUSTOM_MAKE_DIR)/RunTestsPrebuilt.gmk
|
||||
include $(CUSTOM_MAKE_DIR)/RunTestsPrebuilt-pre.gmk
|
||||
endif
|
||||
|
||||
NEW_SPEC := $(OUTPUTDIR)/run-test-spec.gmk
|
||||
@ -295,13 +296,10 @@ test-prebuilt:
|
||||
# is unfortunately not available at this point.
|
||||
$(call MakeDir, $(MAKESUPPORT_OUTPUTDIR)/failure-logs)
|
||||
@$(RM) -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error
|
||||
# The lazy initialization of the cache file in FindTests.gmk does not
|
||||
# always work with RunTests.gmk. To guarantee that the jtreg test groups
|
||||
# are always found and parsed, call FindTests.gmk stand alone once
|
||||
# before calling RunTests.gmk.
|
||||
@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/common/FindTests.gmk \
|
||||
SPEC=$(SPEC) FINDTESTS_STAND_ALONE=true
|
||||
@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
|
||||
# We need to fill the FindTest cache before entering RunTests.gmk.
|
||||
@cd $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) SPEC=$(SPEC) \
|
||||
-f GenerateFindTests.gmk
|
||||
@cd $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \
|
||||
TEST="$(TEST)"
|
||||
|
||||
test-prebuilt-with-exit-code: test-prebuilt
|
||||
|
||||
@ -63,7 +63,7 @@ TEST_JOBS ?= 0
|
||||
|
||||
# Use hard-coded values for java flags (one size, fits all!)
|
||||
JAVA_FLAGS := -Duser.language=en -Duser.country=US
|
||||
JAVA_FLAGS_BIG := -Xms64M -Xmx1600M
|
||||
JAVA_FLAGS_BIG := -Xms64M -Xmx2048M
|
||||
JAVA_FLAGS_SMALL := -XX:+UseSerialGC -Xms32M -Xmx512M -XX:TieredStopAtLevel=1
|
||||
BUILDJDK_JAVA_FLAGS_SMALL := -Xms32M -Xmx512M -XX:TieredStopAtLevel=1
|
||||
BUILD_JAVA_FLAGS := $(JAVA_FLAGS_BIG)
|
||||
@ -176,3 +176,19 @@ ULIMIT := ulimit
|
||||
ifeq ($(OPENJDK_BUILD_OS), windows)
|
||||
PATHTOOL := cygpath
|
||||
endif
|
||||
|
||||
# These settings are needed to run testing with jvmti agent
|
||||
ifeq ($(OPENJDK_BUILD_OS), linux)
|
||||
LIBRARY_PREFIX := lib
|
||||
SHARED_LIBRARY_SUFFIX := .so
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_BUILD_OS), windows)
|
||||
LIBRARY_PREFIX :=
|
||||
SHARED_LIBRARY_SUFFIX := .dll
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_BUILD_OS), macosx)
|
||||
LIBRARY_PREFIX := lib
|
||||
SHARED_LIBRARY_SUFFIX := .dylib
|
||||
endif
|
||||
|
||||
@ -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
|
||||
@ -23,10 +23,7 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
$(eval $(call IncludeCustomExtension, SourceRevision-pre.gmk))
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# Keep track of what source revision is used to create the build, by creating
|
||||
@ -38,6 +35,7 @@ $(eval $(call IncludeCustomExtension, SourceRevision-pre.gmk))
|
||||
# bundle. As a part of creating this source bundle, the current SCM revisions of
|
||||
# all repos will be stored in a file in the top dir, which is then used when
|
||||
# creating the tracker file.
|
||||
################################################################################
|
||||
|
||||
STORED_SOURCE_REVISION := $(TOPDIR)/.src-rev
|
||||
|
||||
@ -57,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)
|
||||
@ -156,10 +154,6 @@ endif
|
||||
|
||||
################################################################################
|
||||
|
||||
$(eval $(call IncludeCustomExtension, SourceRevision-post.gmk))
|
||||
|
||||
################################################################################
|
||||
|
||||
store-source-revision: $(STORE_SOURCE_REVISION_TARGET)
|
||||
|
||||
create-source-revision-tracker: $(CREATE_SOURCE_REVISION_TRACKER_TARGET)
|
||||
@ -167,3 +161,7 @@ create-source-revision-tracker: $(CREATE_SOURCE_REVISION_TRACKER_TARGET)
|
||||
FRC: # Force target
|
||||
|
||||
.PHONY: store-source-revision create-source-revision-tracker
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
211
make/StaticLibs.gmk
Normal file
211
make/StaticLibs.gmk
Normal file
@ -0,0 +1,211 @@
|
||||
#
|
||||
# Copyright (c) 2024, 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.
|
||||
#
|
||||
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
include CopyFiles.gmk
|
||||
include DebugInfoUtils.gmk
|
||||
include Modules.gmk
|
||||
include modules/LauncherCommon.gmk
|
||||
include Execute.gmk
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Create the static java launcher
|
||||
#
|
||||
################################################################################
|
||||
|
||||
STATIC_JDK_IMAGE_DIR := $(IMAGES_OUTPUTDIR)/static-jdk
|
||||
STATIC_LAUNCHER_OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/static-native/launcher
|
||||
HOTSPOT_STATIC_LIB_PATH := $(HOTSPOT_OUTPUTDIR)/*/libjvm/objs/static
|
||||
|
||||
ifneq ($(word 2, $(wildcard $(HOTSPOT_STATIC_LIB_PATH))), )
|
||||
$(error Cannot perform static linking when building more than one JVM library)
|
||||
endif
|
||||
|
||||
# Find all modules with static libraries
|
||||
STATIC_LIB_MODULES := $(patsubst $(SUPPORT_OUTPUTDIR)/modules_static-libs/%, \
|
||||
%, $(wildcard $(SUPPORT_OUTPUTDIR)/modules_static-libs/*))
|
||||
|
||||
# Filter out known broken libraries. This is a temporary measure until
|
||||
# proper support for these libraries can be provided.
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
# libsplashscreen has a name conflict with libawt in the function
|
||||
# BitmapToYXBandedRectangles, so we exclude it for now.
|
||||
BROKEN_STATIC_LIBS += splashscreen
|
||||
else ifeq ($(call isTargetOs, macosx), true)
|
||||
# libosxsecurity has a name conflict with libosxapp in the function
|
||||
# JavaStringToNSString, so we exclude it for now.
|
||||
BROKEN_STATIC_LIBS += osxsecurity
|
||||
else ifeq ($(call isTargetOs, windows), true)
|
||||
# libsplashscreen has a name conflict with libawt in the function
|
||||
# BitmapToYXBandedRectangles, so we exclude it for now.
|
||||
BROKEN_STATIC_LIBS += splashscreen
|
||||
# libsspi_bridge has name conflicts with sunmscapi
|
||||
BROKEN_STATIC_LIBS += sspi_bridge
|
||||
# dt_shmem define jdwpTransport_OnLoad which conflict with dt_socket
|
||||
BROKEN_STATIC_LIBS += dt_shmem
|
||||
else ifeq ($(call isTargetOs, aix), true)
|
||||
# libsplashscreen has a name conflict with libawt in the function
|
||||
# BitmapToYXBandedRectangles, so we exclude it for now.
|
||||
BROKEN_STATIC_LIBS += splashscreen
|
||||
endif
|
||||
|
||||
$(foreach module, $(STATIC_LIB_MODULES), \
|
||||
$(eval LIBS_$(module) := $(filter-out $(BROKEN_STATIC_LIBS), $(shell cat \
|
||||
$(SUPPORT_OUTPUTDIR)/modules_static-libs/$(module)/module-included-libs.txt))) \
|
||||
)
|
||||
|
||||
STATIC_LIB_FILES := $(foreach module, $(STATIC_LIB_MODULES), \
|
||||
$(foreach lib, $(LIBS_$(module)), \
|
||||
$(SUPPORT_OUTPUTDIR)/native/$(module)/lib$(lib)/static/$(LIBRARY_PREFIX)$(lib)$(STATIC_LIBRARY_SUFFIX)))
|
||||
|
||||
# Add Hotspot
|
||||
STATIC_LIB_FILES += $(wildcard $(HOTSPOT_STATIC_LIB_PATH)/$(LIBRARY_PREFIX)jvm$(STATIC_LIBRARY_SUFFIX))
|
||||
|
||||
# Figure out what external libraries are required to link these static JDK
|
||||
# libraries.
|
||||
LIB_FLAGS_FILES := $(addsuffix .lib-flags.txt, $(STATIC_LIB_FILES))
|
||||
|
||||
# Gather the lib flags from all individual libraries. There are many duplicates,
|
||||
# so sort and just keep unique instances. On macOS, a common pattern is
|
||||
# "-framework FooFramework", so we must make sure we keep the two words together.
|
||||
EXTERNAL_LIBS := $(strip $(shell $(CAT) $(LIB_FLAGS_FILES) | \
|
||||
$(SED) -e 's/-framework /-framework_/g' | $(TR) ' ' '\n' | $(SORT) -u | \
|
||||
$(SED) -e 's/-framework_/-framework /g'))
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
STATIC_LIBS := $(addprefix -force_load$(SPACE), $(STATIC_LIB_FILES))
|
||||
else ifeq ($(call isTargetOs, linux), true)
|
||||
STATIC_LIBS := -Wl,--export-dynamic -Wl,--whole-archive $(STATIC_LIB_FILES) -Wl,--no-whole-archive
|
||||
else ifeq ($(call isTargetOs, windows), true)
|
||||
STATIC_LIBS := $(addprefix -wholearchive:, $(STATIC_LIB_FILES))
|
||||
else ifeq ($(call isTargetOs, aix), true)
|
||||
# on AIX we have to generate export files for all static libs, because we have no whole-archive linker flag
|
||||
$(foreach lib, $(STATIC_LIB_FILES), \
|
||||
$(eval $(call SetupExecute, generate_export_list_$(notdir $(lib)), \
|
||||
INFO := Generating export list for $(notdir $(lib)), \
|
||||
DEPS := $(lib), \
|
||||
OUTPUT_FILE := $(lib).exp, \
|
||||
COMMAND := ( $(AR) $(ARFLAGS) -w $(lib) | $(GREP) -v '^\.' | $(AWK) '{print $$1}' | $(SORT) -u > $(lib).exp ), \
|
||||
)) \
|
||||
$(eval STATIC_LIB_EXPORT_FILES += $(lib).exp) \
|
||||
)
|
||||
STATIC_LIBS := -Wl,-bexpfull $(STATIC_LIB_FILES) $(addprefix -Wl$(COMMA)-bE:, $(STATIC_LIB_EXPORT_FILES))
|
||||
else
|
||||
$(error Unsupported platform)
|
||||
endif
|
||||
|
||||
$(eval $(call SetupBuildLauncher, java, \
|
||||
ENABLE_ARG_FILES := true, \
|
||||
EXPAND_CLASSPATH_WILDCARDS := true, \
|
||||
EXTRA_RCFLAGS := $(JAVA_RCFLAGS), \
|
||||
VERSION_INFO_RESOURCE := $(JAVA_VERSION_INFO_RESOURCE), \
|
||||
OPTIMIZATION := HIGH, \
|
||||
STATIC_LAUNCHER := true, \
|
||||
LDFLAGS := $(LDFLAGS_STATIC_JDK), \
|
||||
LIBS := $(STATIC_LIBS) $(EXTERNAL_LIBS), \
|
||||
LINK_TYPE := C++, \
|
||||
OUTPUT_DIR := $(STATIC_LAUNCHER_OUTPUT_DIR), \
|
||||
OBJECT_DIR := $(STATIC_LAUNCHER_OUTPUT_DIR), \
|
||||
))
|
||||
|
||||
$(java): $(STATIC_LIB_FILES)
|
||||
ifeq ($(call isTargetOs, aix), true)
|
||||
$(java): $(STATIC_LIB_EXPORT_FILES)
|
||||
endif
|
||||
|
||||
TARGETS += $(java)
|
||||
|
||||
JAVA_LAUNCHER := $(BUILD_LAUNCHER_java_TARGET)
|
||||
|
||||
static-launcher: $(java)
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Create the static-jdk image with the statically built java launcher
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# Until we get proper support in jlink for generating an image with static
|
||||
# builds, we need to create the image ourselves. We base it on a normal
|
||||
# dynamically linked JDK image.
|
||||
|
||||
# All these files/dirs should be copied as-is
|
||||
JDK_IMAGE_COPY_FILES := $(addprefix $(JDK_IMAGE_DIR)/, conf demo include jmods \
|
||||
legal man/man1/java.1 release README)
|
||||
|
||||
# We need to copy some files from lib, but not the dynamic libraries themselves
|
||||
ALL_LIB_FILES := $(call FindFiles, $(JDK_IMAGE_DIR)/lib)
|
||||
|
||||
# Remove all dynamic libraries from the list
|
||||
JDK_IMAGE_COPY_LIB_FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), $(ALL_LIB_FILES))
|
||||
# Remove all debug files from the list
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
JDK_IMAGE_COPY_LIB_FILES := $(call not-containing, .dSYM, $(JDK_IMAGE_COPY_LIB_FILES))
|
||||
else
|
||||
JDK_IMAGE_COPY_LIB_FILES := $(filter-out %.debuginfo %.pdb %.map, $(JDK_IMAGE_COPY_LIB_FILES))
|
||||
endif
|
||||
|
||||
static-jdk-info:
|
||||
$(call LogWarn, Creating static-jdk image)
|
||||
|
||||
$(eval $(call SetupCopyFiles, copy-from-jdk-image, \
|
||||
SRC := $(JDK_IMAGE_DIR), \
|
||||
DEST := $(STATIC_JDK_IMAGE_DIR), \
|
||||
FILES := $(call FindFiles, $(JDK_IMAGE_COPY_FILES)) \
|
||||
$(JDK_IMAGE_COPY_LIB_FILES), \
|
||||
))
|
||||
|
||||
TARGETS += $(copy-from-jdk-image)
|
||||
|
||||
$(copy-from-jdk-image): | static-jdk-info
|
||||
|
||||
$(eval $(call SetupCopyFiles, copy-static-launcher, \
|
||||
FILES := $(JAVA_LAUNCHER), \
|
||||
DEST := $(STATIC_JDK_IMAGE_DIR)/bin, \
|
||||
))
|
||||
|
||||
TARGETS += $(copy-static-launcher)
|
||||
|
||||
$(eval $(call SetupCopyFiles, copy-static-launcher-debuginfo, \
|
||||
SRC := $(STATIC_LAUNCHER_OUTPUT_DIR), \
|
||||
DEST := $(STATIC_JDK_IMAGE_DIR)/bin, \
|
||||
FILES := $(call FindDebuginfoFiles, $(STATIC_LAUNCHER_OUTPUT_DIR)), \
|
||||
))
|
||||
|
||||
TARGETS += $(copy-static-launcher-debuginfo)
|
||||
|
||||
static-jdk-image: $(copy-from-jdk-image) $(copy-static-launcher) $(copy-static-launcher-debuginfo)
|
||||
|
||||
TARGETS += static-jdk-image
|
||||
|
||||
.PHONY: static-launcher static-jdk-image
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2019, 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
|
||||
@ -23,13 +23,12 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# This makefile creates an image of the optional static versions of certain JDK
|
||||
# libraries.
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
################################################################################
|
||||
|
||||
include CopyFiles.gmk
|
||||
include Modules.gmk
|
||||
@ -38,8 +37,6 @@ ALL_MODULES = $(call FindAllModules)
|
||||
|
||||
################################################################################
|
||||
|
||||
TARGETS :=
|
||||
|
||||
ifneq ($(filter static-libs-image, $(MAKECMDGOALS)), )
|
||||
IMAGE_DEST_DIR = $(STATIC_LIBS_IMAGE_DIR)/lib
|
||||
else ifneq ($(filter static-libs-graal-image, $(MAKECMDGOALS)), )
|
||||
@ -72,11 +69,9 @@ ifneq ($(filter static-libs-image, $(MAKECMDGOALS)), )
|
||||
)
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
|
||||
static-libs-image: $(HOTSPOT_VARIANT_STATIC_LIBS_TARGETS) $(STATIC_LIBS_TARGETS)
|
||||
static-libs-graal-image: $(STATIC_LIBS_TARGETS)
|
||||
|
||||
all: $(TARGETS)
|
||||
################################################################################
|
||||
|
||||
.PHONY: all
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2017, 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
|
||||
@ -23,13 +23,7 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, TestImage-pre.gmk))
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
@ -54,4 +48,8 @@ TARGETS += $(BUILD_INFO_PROPERTIES) $(README)
|
||||
prepare-test-image: $(TARGETS)
|
||||
all: prepare-test-image
|
||||
|
||||
.PHONY: default all prepare-test-image
|
||||
.PHONY: prepare-test-image
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2020, 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
|
||||
@ -23,8 +23,10 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
ifndef _TOOLS_HOTSPOT_GMK
|
||||
_TOOLS_HOTSPOT_GMK := 1
|
||||
include MakeIncludeStart.gmk
|
||||
ifeq ($(INCLUDE), true)
|
||||
|
||||
################################################################################
|
||||
|
||||
include JavaCompilation.gmk
|
||||
|
||||
@ -44,4 +46,5 @@ TOOL_JFR_GEN := $(JAVA_SMALL) -cp $(HOTSPOT_TOOLS_OUTPUTDIR) \
|
||||
|
||||
################################################################################
|
||||
|
||||
endif # _TOOLS_HOTSPOT_GMK
|
||||
endif # include guard
|
||||
include MakeIncludeEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, 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
|
||||
@ -23,14 +23,13 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
ifndef _TOOLS_GMK
|
||||
_TOOLS_GMK := 1
|
||||
include MakeIncludeStart.gmk
|
||||
ifeq ($(INCLUDE), true)
|
||||
|
||||
################################################################################
|
||||
|
||||
include JavaCompilation.gmk
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, Tools.gmk))
|
||||
|
||||
################################################################################
|
||||
# To avoid reevaluating the compilation setup for the tools each time this file
|
||||
# is included, the actual compilation is handled by CompileTools.gmk. The
|
||||
@ -79,6 +78,9 @@ TOOL_GENERATECACERTS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_class
|
||||
TOOL_GENERATEEXTRAPROPERTIES = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
|
||||
build.tools.generateextraproperties.GenerateExtraProperties
|
||||
|
||||
TOOL_GENERATECASEFOLDING = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
|
||||
build.tools.generatecharacter.CaseFolding
|
||||
|
||||
TOOL_MAKEZIPREPRODUCIBLE = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
|
||||
build.tools.makezipreproducible.MakeZipReproducible
|
||||
|
||||
@ -128,6 +130,9 @@ TOOL_PUBLICSUFFIXLIST = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_clas
|
||||
TOOL_FIXUPPANDOC = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
|
||||
build.tools.fixuppandoc.Main
|
||||
|
||||
TOOL_VARHANDLEGUARDMETHODGENERATOR = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
|
||||
build.tools.methodhandle.VarHandleGuardMethodGenerator
|
||||
|
||||
################################################################################
|
||||
|
||||
# Executable javascript filter for man page generation using pandoc.
|
||||
@ -137,7 +142,5 @@ PANDOC_HTML_MANPAGE_FILTER := $(BUILDTOOLS_OUTPUTDIR)/manpages/pandoc-html-manpa
|
||||
|
||||
################################################################################
|
||||
|
||||
# Hook to include the corresponding custom post file, if present.
|
||||
$(eval $(call IncludeCustomExtension, ToolsJdk-post.gmk))
|
||||
|
||||
endif # _TOOLS_GMK
|
||||
endif # include guard
|
||||
include MakeIncludeEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 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
|
||||
@ -23,11 +23,10 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
# This must be the first rule
|
||||
default: all
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
|
||||
################################################################################
|
||||
@ -37,9 +36,13 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_LANGTOOLS, \
|
||||
COMPILER := bootjdk, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
|
||||
SRC := $(TOPDIR)/make/langtools/tools, \
|
||||
INCLUDES := compileproperties propertiesparser, \
|
||||
INCLUDES := compileproperties flagsgenerator propertiesparser, \
|
||||
COPY := .properties, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/langtools_tools_classes, \
|
||||
))
|
||||
|
||||
all: $(BUILD_TOOLS_LANGTOOLS)
|
||||
|
||||
################################################################################
|
||||
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2017, 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
|
||||
@ -23,17 +23,14 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include ProcessMarkdown.gmk
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# This makefile updates the generated build html documentation.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
include ProcessMarkdown.gmk
|
||||
|
||||
ifeq ($(ENABLE_PANDOC), false)
|
||||
$(info No pandoc executable was detected by configure)
|
||||
$(error Cannot continue)
|
||||
@ -55,10 +52,4 @@ TARGETS += $(md_docs)
|
||||
|
||||
################################################################################
|
||||
|
||||
$(eval $(call IncludeCustomExtension, UpdateBuildDocs.gmk))
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
.PHONY: all default
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2024, 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
|
||||
@ -23,15 +23,7 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
include CopyFiles.gmk
|
||||
include Execute.gmk
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# This file is responsible for updating the generated sleef source code files
|
||||
@ -40,6 +32,9 @@ include Execute.gmk
|
||||
# updated from upstream.
|
||||
################################################################################
|
||||
|
||||
include CopyFiles.gmk
|
||||
include Execute.gmk
|
||||
|
||||
ifneq ($(COMPILE_TYPE), cross)
|
||||
$(error Only cross-compilation of libsleef is currently supported)
|
||||
endif
|
||||
@ -86,8 +81,8 @@ SLEEF_CMAKE_FILE := toolchains/$(OPENJDK_TARGET_CPU)-$(SLEEF_TOOLCHAIN_TYPE).cma
|
||||
$(eval $(call SetupExecute, sleef_native_config, \
|
||||
INFO := Configuring native sleef build, \
|
||||
OUTPUT_DIR := $(SLEEF_NATIVE_BUILD_DIR), \
|
||||
COMMAND := cd $(SLEEF_SOURCE_DIR) && $(CMAKE) -S . -B \
|
||||
$(SLEEF_NATIVE_BUILD_DIR), \
|
||||
WORKING_DIR := $(SLEEF_SOURCE_DIR), \
|
||||
COMMAND := $(CMAKE) -S . -B $(SLEEF_NATIVE_BUILD_DIR), \
|
||||
))
|
||||
|
||||
TARGETS := $(sleef_native_config)
|
||||
@ -96,8 +91,8 @@ $(eval $(call SetupExecute, sleef_native_build, \
|
||||
INFO := Building native sleef, \
|
||||
DEPS := $(sleef_native_config), \
|
||||
OUTPUT_DIR := $(SLEEF_NATIVE_BUILD_DIR), \
|
||||
COMMAND := cd $(SLEEF_SOURCE_DIR) && $(CMAKE) --build \
|
||||
$(SLEEF_NATIVE_BUILD_DIR) -j, \
|
||||
WORKING_DIR := $(SLEEF_SOURCE_DIR), \
|
||||
COMMAND := $(CMAKE) --build $(SLEEF_NATIVE_BUILD_DIR) -j, \
|
||||
))
|
||||
|
||||
TARGETS := $(sleef_native_build)
|
||||
@ -106,8 +101,8 @@ $(eval $(call SetupExecute, sleef_cross_config, \
|
||||
INFO := Configuring cross-compiling sleef build, \
|
||||
DEPS := $(sleef_native_build), \
|
||||
OUTPUT_DIR := $(SLEEF_CROSS_BUILD_DIR), \
|
||||
COMMAND := cd $(SLEEF_SOURCE_DIR) && $(CMAKE) -S . -B \
|
||||
$(SLEEF_CROSS_BUILD_DIR) \
|
||||
WORKING_DIR := $(SLEEF_SOURCE_DIR), \
|
||||
COMMAND := $(CMAKE) -S . -B $(SLEEF_CROSS_BUILD_DIR) \
|
||||
-DCMAKE_C_COMPILER=$(CC) \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$(SLEEF_CMAKE_FILE) \
|
||||
-DNATIVE_BUILD_DIR=$(SLEEF_NATIVE_BUILD_DIR) \
|
||||
@ -121,8 +116,8 @@ $(eval $(call SetupExecute, sleef_cross_build, \
|
||||
INFO := Building cross-compiling sleef, \
|
||||
DEPS := $(sleef_cross_config), \
|
||||
OUTPUT_DIR := $(SLEEF_NATIVE_BUILD_DIR), \
|
||||
COMMAND := cd $(SLEEF_SOURCE_DIR) && $(CMAKE) --build \
|
||||
$(SLEEF_CROSS_BUILD_DIR) -j, \
|
||||
WORKING_DIR := $(SLEEF_SOURCE_DIR), \
|
||||
COMMAND := $(CMAKE) --build $(SLEEF_CROSS_BUILD_DIR) -j, \
|
||||
))
|
||||
|
||||
TARGETS := $(sleef_cross_build)
|
||||
@ -148,6 +143,4 @@ TARGETS := $(copy_generated_sleef_source)
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
.PHONY: all default
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 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
|
||||
@ -23,15 +23,7 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include Execute.gmk
|
||||
include JdkNativeCompilation.gmk
|
||||
include ToolsJdk.gmk
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
# This file is responsible for extracting the x11 native struct offsets to
|
||||
@ -43,6 +35,10 @@ include ToolsJdk.gmk
|
||||
# GensrcX11Wrappers.gmk to generate the Java code during the build.
|
||||
################################################################################
|
||||
|
||||
include Execute.gmk
|
||||
include JdkNativeCompilation.gmk
|
||||
include $(TOPDIR)/make/ToolsJdk.gmk
|
||||
|
||||
ifeq ($(COMPILE_TYPE), cross)
|
||||
$(error It is not possible to update the x11wrappers when cross-compiling)
|
||||
endif
|
||||
@ -108,6 +104,4 @@ TARGETS += $(run_wrappergen) wrapper-information
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
.PHONY: all default
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 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
|
||||
@ -23,11 +23,11 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
include MakeFileStart.gmk
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
################################################################################
|
||||
|
||||
include ZipArchive.gmk
|
||||
|
||||
################################################################################
|
||||
#
|
||||
@ -100,6 +100,4 @@ endif
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
.PHONY: default all
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 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
|
||||
@ -23,19 +23,16 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
default: all
|
||||
include MakeFileStart.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
include Modules.gmk
|
||||
include ZipArchive.gmk
|
||||
|
||||
SRC_ZIP_WORK_DIR := $(SUPPORT_OUTPUTDIR)/src
|
||||
$(if $(filter $(TOPDIR)/%, $(SUPPORT_OUTPUTDIR)), $(eval SRC_ZIP_BASE := $(TOPDIR)), $(eval SRC_ZIP_BASE := $(SUPPORT_OUTPUTDIR)))
|
||||
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, ZipSource.gmk))
|
||||
|
||||
################################################################################
|
||||
# Create the directory structure for src.zip using symlinks.
|
||||
# <module>/<package>/<file>.java
|
||||
@ -95,8 +92,8 @@ zip: $(SRC_ZIP_SRCS)
|
||||
|
||||
TARGETS += zip
|
||||
|
||||
.PHONY: zip
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
.PHONY: default all zip
|
||||
include MakeFileEnd.gmk
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
|
||||
@ -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,15 +75,25 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
|
||||
AC_MSG_NOTICE([Rewriting ORIGINAL_PATH to $REWRITTEN_PATH])
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_TARGET_CPU" = xx86 && test "x$with_jvm_variants" != xzero; then
|
||||
AC_MSG_ERROR([32-bit x86 builds are not supported])
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||
BASIC_SETUP_PATHS_WINDOWS
|
||||
fi
|
||||
|
||||
# We get the top-level directory from the supporting wrappers.
|
||||
BASIC_WINDOWS_VERIFY_DIR($TOPDIR, source)
|
||||
orig_topdir="$TOPDIR"
|
||||
UTIL_FIXUP_PATH(TOPDIR)
|
||||
AC_MSG_CHECKING([for top-level directory])
|
||||
AC_MSG_RESULT([$TOPDIR])
|
||||
if test "x$TOPDIR" != "x$orig_topdir"; then
|
||||
AC_MSG_WARN([Your top dir was originally represented as $orig_topdir,])
|
||||
AC_MSG_WARN([but after rewriting it became $TOPDIR.])
|
||||
AC_MSG_WARN([This typically means you have characters like space in the path, which can cause all kind of trouble.])
|
||||
fi
|
||||
AC_SUBST(TOPDIR)
|
||||
|
||||
if test "x$CUSTOM_ROOT" != x; then
|
||||
@ -124,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
|
||||
@ -389,11 +415,21 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
|
||||
[ CONF_NAME=${with_conf_name} ])
|
||||
|
||||
# Test from where we are running configure, in or outside of src root.
|
||||
if test "x$OPENJDK_BUILD_OS" = xwindows || test "x$OPENJDK_BUILD_OS" = "xmacosx"; then
|
||||
# These systems have case insensitive paths, so convert them to lower case.
|
||||
[ cmp_configure_start_dir=`$ECHO $CONFIGURE_START_DIR | $TR '[:upper:]' '[:lower:]'` ]
|
||||
[ cmp_topdir=`$ECHO $TOPDIR | $TR '[:upper:]' '[:lower:]'` ]
|
||||
[ cmp_custom_root=`$ECHO $CUSTOM_ROOT | $TR '[:upper:]' '[:lower:]'` ]
|
||||
else
|
||||
cmp_configure_start_dir="$CONFIGURE_START_DIR"
|
||||
cmp_topdir="$TOPDIR"
|
||||
cmp_custom_root="$CUSTOM_ROOT"
|
||||
fi
|
||||
AC_MSG_CHECKING([where to store configuration])
|
||||
if test "x$CONFIGURE_START_DIR" = "x$TOPDIR" \
|
||||
|| test "x$CONFIGURE_START_DIR" = "x$CUSTOM_ROOT" \
|
||||
|| test "x$CONFIGURE_START_DIR" = "x$TOPDIR/make/autoconf" \
|
||||
|| test "x$CONFIGURE_START_DIR" = "x$TOPDIR/make" ; then
|
||||
if test "x$cmp_configure_start_dir" = "x$cmp_topdir" \
|
||||
|| test "x$cmp_configure_start_dir" = "x$cmp_custom_root" \
|
||||
|| test "x$cmp_configure_start_dir" = "x$cmp_topdir/make/autoconf" \
|
||||
|| test "x$cmp_configure_start_dir" = "x$cmp_topdir/make" ; then
|
||||
# We are running configure from the src root.
|
||||
# Create a default ./build/target-variant-debuglevel output root.
|
||||
if test "x${CONF_NAME}" = x; then
|
||||
@ -414,7 +450,12 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
|
||||
# If configuration is situated in normal build directory, just use the build
|
||||
# directory name as configuration name, otherwise use the complete path.
|
||||
if test "x${CONF_NAME}" = x; then
|
||||
CONF_NAME=`$ECHO $CONFIGURE_START_DIR | $SED -e "s!^${TOPDIR}/build/!!"`
|
||||
[ if [[ "$cmp_configure_start_dir" =~ ^${cmp_topdir}/build/[^/]+$ ||
|
||||
"$cmp_configure_start_dir" =~ ^${cmp_custom_root}/build/[^/]+$ ]]; then ]
|
||||
CONF_NAME="${CONFIGURE_START_DIR##*/}"
|
||||
else
|
||||
CONF_NAME="$CONFIGURE_START_DIR"
|
||||
fi
|
||||
fi
|
||||
OUTPUTDIR="$CONFIGURE_START_DIR"
|
||||
AC_MSG_RESULT([in current directory])
|
||||
@ -540,9 +581,6 @@ AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES],
|
||||
|
||||
BASIC_CHECK_SRC_PERMS
|
||||
|
||||
# Check if the user has any old-style ALT_ variables set.
|
||||
FOUND_ALT_VARIABLES=`env | grep ^ALT_`
|
||||
|
||||
# Before generating output files, test if they exist. If they do, this is a reconfigure.
|
||||
# Since we can't properly handle the dependencies for this, warn the user about the situation
|
||||
if test -e $OUTPUTDIR/spec.gmk; then
|
||||
|
||||
@ -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
|
||||
@ -57,6 +57,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
|
||||
UTIL_LOOKUP_PROGS(LOCALE, locale)
|
||||
UTIL_LOOKUP_PROGS(PATHTOOL, cygpath wslpath)
|
||||
UTIL_LOOKUP_PROGS(CMD, cmd.exe, $PATH:/cygdrive/c/windows/system32:/mnt/c/windows/system32:/c/windows/system32)
|
||||
UTIL_LOOKUP_PROGS(LSB_RELEASE, lsb_release)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
@ -106,9 +107,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
|
||||
UTIL_LOOKUP_PROGS(READLINK, greadlink readlink)
|
||||
UTIL_LOOKUP_PROGS(WHOAMI, whoami)
|
||||
|
||||
# Tools only needed on some platforms
|
||||
UTIL_LOOKUP_PROGS(LSB_RELEASE, lsb_release)
|
||||
|
||||
# For compare.sh only
|
||||
UTIL_LOOKUP_PROGS(CMP, cmp)
|
||||
UTIL_LOOKUP_PROGS(UNIQ, uniq)
|
||||
@ -470,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
|
||||
|
||||
@ -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 '"[$]@"'
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, 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.
|
||||
@ -393,11 +395,9 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
|
||||
|
||||
# When compiling code to be executed by the Boot JDK, force compatibility with the
|
||||
# oldest supported bootjdk.
|
||||
OLDEST_BOOT_JDK=`$ECHO $DEFAULT_ACCEPTABLE_BOOT_VERSIONS \
|
||||
OLDEST_BOOT_JDK_VERSION=`$ECHO $DEFAULT_ACCEPTABLE_BOOT_VERSIONS \
|
||||
| $TR " " "\n" | $SORT -n | $HEAD -n1`
|
||||
# -Xlint:-options is added to avoid "warning: [options] system modules path not set in conjunction with -source"
|
||||
BOOT_JDK_SOURCETARGET="-source $OLDEST_BOOT_JDK -target $OLDEST_BOOT_JDK -Xlint:-options"
|
||||
AC_SUBST(BOOT_JDK_SOURCETARGET)
|
||||
AC_SUBST(OLDEST_BOOT_JDK_VERSION)
|
||||
|
||||
# Check if the boot jdk is 32 or 64 bit
|
||||
if $JAVA -version 2>&1 | $GREP -q "64-Bit"; then
|
||||
@ -470,7 +470,7 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
|
||||
# Maximum amount of heap memory.
|
||||
JVM_HEAP_LIMIT_32="768"
|
||||
# Running a 64 bit JVM allows for and requires a bigger heap
|
||||
JVM_HEAP_LIMIT_64="1600"
|
||||
JVM_HEAP_LIMIT_64="2048"
|
||||
JVM_HEAP_LIMIT_GLOBAL=`expr $MEMORY_SIZE / 2`
|
||||
if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "$JVM_HEAP_LIMIT_32"; then
|
||||
JVM_HEAP_LIMIT_32=$JVM_HEAP_LIMIT_GLOBAL
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
|
||||
12
make/autoconf/build-aux/config.guess
vendored
12
make/autoconf/build-aux/config.guess
vendored
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
@ -53,10 +53,10 @@ if [ "x$OUT" = x ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Test and fix cygwin on x86_64
|
||||
echo $OUT | grep 86-pc-cygwin > /dev/null 2> /dev/null
|
||||
# Test and fix cygwin/msys CPUs
|
||||
echo $OUT | grep -e "-pc-cygwin" > /dev/null 2> /dev/null
|
||||
if test $? != 0; then
|
||||
echo $OUT | grep 86-pc-mingw > /dev/null 2> /dev/null
|
||||
echo $OUT | grep -e "-pc-mingw" > /dev/null 2> /dev/null
|
||||
fi
|
||||
if test $? = 0; then
|
||||
case `echo $PROCESSOR_IDENTIFIER | cut -f1 -d' '` in
|
||||
@ -64,6 +64,10 @@ if test $? = 0; then
|
||||
REAL_CPU=x86_64
|
||||
OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'`
|
||||
;;
|
||||
ARMv8)
|
||||
REAL_CPU=aarch64
|
||||
OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'`
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
||||
|
||||
#
|
||||
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 2024, 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
|
||||
|
||||
@ -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
|
||||
|
||||
8
make/autoconf/configure
vendored
8
make/autoconf/configure
vendored
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 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
|
||||
@ -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
|
||||
@ -364,7 +366,7 @@ EOT
|
||||
|
||||
# Print additional help, e.g. a list of toolchains and JVM features.
|
||||
# This must be done by the autoconf script.
|
||||
( CONFIGURE_PRINT_ADDITIONAL_HELP=true . $generated_script PRINTF=printf )
|
||||
( CONFIGURE_PRINT_ADDITIONAL_HELP=true . $generated_script PRINTF=printf ECHO=echo )
|
||||
|
||||
cat <<EOT
|
||||
|
||||
|
||||
@ -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
|
||||
@ -174,9 +174,6 @@ SRCDIRS_SETUP_IMPORT_MODULES
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# See if we are doing a complete static build or not
|
||||
JDKOPT_SETUP_STATIC_BUILD
|
||||
|
||||
# First determine the toolchain type (compiler family)
|
||||
TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE
|
||||
|
||||
@ -224,6 +221,9 @@ JDKOPT_SETUP_UNDEFINED_BEHAVIOR_SANITIZER
|
||||
# LeakSanitizer
|
||||
JDKOPT_SETUP_LEAK_SANITIZER
|
||||
|
||||
# Setup static analyzer
|
||||
JDKOPT_SETUP_STATIC_ANALYZER
|
||||
|
||||
# Fallback linker
|
||||
# This needs to go before 'LIB_DETERMINE_DEPENDENCIES'
|
||||
JDKOPT_SETUP_FALLBACK_LINKER
|
||||
@ -259,10 +259,12 @@ LIB_TESTS_ENABLE_DISABLE_JTREG_TEST_THREAD_FACTORY
|
||||
|
||||
JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST
|
||||
JDKOPT_EXCLUDE_TRANSLATIONS
|
||||
JDKOPT_ENABLE_DISABLE_MANPAGES
|
||||
JDKOPT_ENABLE_DISABLE_CDS_ARCHIVE
|
||||
JDKOPT_ENABLE_DISABLE_CDS_ARCHIVE_COH
|
||||
JDKOPT_ENABLE_DISABLE_COMPATIBLE_CDS_ALIGNMENT
|
||||
JDKOPT_SETUP_MACOSX_SIGNING
|
||||
JDKOPT_SETUP_SIGNING_HOOK
|
||||
JDKOPT_SETUP_JAVA_WARNINGS
|
||||
|
||||
################################################################################
|
||||
#
|
||||
|
||||
@ -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
|
||||
@ -235,9 +235,10 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
||||
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
|
||||
|
||||
# Additional warnings that are not activated by -Wall and -Wextra
|
||||
WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wreturn-type -Wsign-compare \
|
||||
-Wtrampolines -Wundef -Wunused-const-variable=1 -Wunused-function \
|
||||
-Wunused-result -Wunused-value"
|
||||
WARNINGS_ENABLE_ADDITIONAL="-Winvalid-pch -Wpointer-arith -Wreturn-type \
|
||||
-Wsign-compare -Wtrampolines -Wtype-limits -Wundef -Wuninitialized \
|
||||
-Wunused-const-variable=1 -Wunused-function -Wunused-result \
|
||||
-Wunused-value"
|
||||
WARNINGS_ENABLE_ADDITIONAL_CXX="-Woverloaded-virtual -Wreorder"
|
||||
WARNINGS_ENABLE_ALL_CFLAGS="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
|
||||
WARNINGS_ENABLE_ALL_CXXFLAGS="$WARNINGS_ENABLE_ALL_CFLAGS $WARNINGS_ENABLE_ADDITIONAL_CXX"
|
||||
@ -277,7 +278,7 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
||||
AC_DEFUN([FLAGS_SETUP_QUALITY_CHECKS],
|
||||
[
|
||||
# bounds, memory and behavior checking options
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
case $DEBUG_LEVEL in
|
||||
release )
|
||||
# no adjustment
|
||||
@ -302,7 +303,7 @@ AC_DEFUN([FLAGS_SETUP_QUALITY_CHECKS],
|
||||
|
||||
AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
|
||||
[
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
C_O_FLAG_HIGHEST_JVM="-O3"
|
||||
C_O_FLAG_HIGHEST="-O3"
|
||||
C_O_FLAG_HI="-O3"
|
||||
@ -311,6 +312,13 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
|
||||
C_O_FLAG_DEBUG="-O0"
|
||||
C_O_FLAG_DEBUG_JVM="-O0"
|
||||
C_O_FLAG_NONE="-O0"
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
C_O_FLAG_HIGHEST_JVM="${C_O_FLAG_HIGHEST_JVM} -finline-functions"
|
||||
C_O_FLAG_HIGHEST="${C_O_FLAG_HIGHEST} -finline-functions"
|
||||
C_O_FLAG_HI="${C_O_FLAG_HI} -finline-functions"
|
||||
fi
|
||||
|
||||
# -D_FORTIFY_SOURCE=2 hardening option needs optimization (at least -O1) enabled
|
||||
# set for lower O-levels -U_FORTIFY_SOURCE to overwrite previous settings
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux -a "x$DEBUG_LEVEL" = "xfastdebug"; then
|
||||
@ -331,21 +339,6 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
|
||||
C_O_FLAG_DEBUG_JVM="${C_O_FLAG_DEBUG_JVM} ${DISABLE_FORTIFY_CFLAGS}"
|
||||
C_O_FLAG_NONE="${C_O_FLAG_NONE} ${DISABLE_FORTIFY_CFLAGS}"
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
C_O_FLAG_HIGHEST_JVM="-O3 -finline-functions"
|
||||
C_O_FLAG_HIGHEST="-O3 -finline-functions"
|
||||
C_O_FLAG_HI="-O3 -finline-functions"
|
||||
else
|
||||
C_O_FLAG_HIGHEST_JVM="-O3"
|
||||
C_O_FLAG_HIGHEST="-O3"
|
||||
C_O_FLAG_HI="-O3"
|
||||
fi
|
||||
C_O_FLAG_NORM="-O2"
|
||||
C_O_FLAG_DEBUG_JVM="-O0"
|
||||
C_O_FLAG_SIZE="-Os"
|
||||
C_O_FLAG_DEBUG="-O0"
|
||||
C_O_FLAG_NONE="-O0"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
C_O_FLAG_HIGHEST_JVM="-O2 -Oy-"
|
||||
C_O_FLAG_HIGHEST="-O2"
|
||||
@ -354,7 +347,7 @@ AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
|
||||
C_O_FLAG_DEBUG="-Od"
|
||||
C_O_FLAG_DEBUG_JVM=""
|
||||
C_O_FLAG_NONE="-Od"
|
||||
C_O_FLAG_SIZE="-Os"
|
||||
C_O_FLAG_SIZE="-O1"
|
||||
fi
|
||||
|
||||
# Now copy to C++ flags
|
||||
@ -489,6 +482,16 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
else
|
||||
DEBUG_CFLAGS_JDK="-DDEBUG"
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang ; then
|
||||
INIT_PATTERN_FLAG="-ftrivial-auto-var-init=pattern"
|
||||
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$INIT_PATTERN_FLAG],
|
||||
IF_TRUE: [
|
||||
DEBUG_CFLAGS_JDK="$DEBUG_CFLAGS_JDK $INIT_PATTERN_FLAG"
|
||||
DEBUG_CFLAGS_JVM="$INIT_PATTERN_FLAG"
|
||||
]
|
||||
)
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
DEBUG_CFLAGS_JVM="-fpic -mcmodel=large"
|
||||
fi
|
||||
@ -524,12 +527,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
-fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer"
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
# clang compiler on aix needs -ffunction-sections
|
||||
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -ftls-model -fno-math-errno -fstack-protector"
|
||||
TOOLCHAIN_CFLAGS_JDK="-ffunction-sections -fsigned-char -fstack-protector"
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fstack-protector"
|
||||
TOOLCHAIN_CFLAGS_JDK="-fvisibility=hidden -pipe -fstack-protector"
|
||||
@ -549,7 +546,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
# Restrict the debug information created by Clang to avoid
|
||||
# too big object files and speed the build up a little bit
|
||||
# (see http://llvm.org/bugs/show_bug.cgi?id=7554)
|
||||
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -flimit-debug-info"
|
||||
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -flimit-debug-info -fstack-protector"
|
||||
|
||||
# In principle the stack alignment below is cpu- and ABI-dependent and
|
||||
# should agree with values of StackAlignmentInBytes in various
|
||||
@ -567,15 +564,29 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
TOOLCHAIN_CFLAGS_JDK="-pipe"
|
||||
TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX
|
||||
fi
|
||||
TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -fvisibility=hidden"
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -ftls-model -fno-math-errno"
|
||||
TOOLCHAIN_CFLAGS_JDK="-ffunction-sections -fsigned-char"
|
||||
fi
|
||||
|
||||
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 -permissive- -utf-8 -MP"
|
||||
TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:preprocessor -Zc:inline -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"
|
||||
@ -648,23 +659,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
# Linking is different on macOS
|
||||
JVM_PICFLAG=""
|
||||
fi
|
||||
|
||||
# Extra flags needed when building optional static versions of certain
|
||||
# JDK libraries.
|
||||
STATIC_LIBS_CFLAGS="-DSTATIC_BUILD=1"
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS -ffunction-sections -fdata-sections \
|
||||
-DJNIEXPORT='__attribute__((visibility(\"default\")))'"
|
||||
else
|
||||
STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS -DJNIEXPORT="
|
||||
fi
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
# Disable relax-relocation to enable compatibility with older linkers
|
||||
RELAX_RELOCATIONS_FLAG="-Xassembler -mrelax-relocations=no"
|
||||
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${RELAX_RELOCATIONS_FLAG}],
|
||||
IF_TRUE: [STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS ${RELAX_RELOCATIONS_FLAG}"])
|
||||
fi
|
||||
AC_SUBST(STATIC_LIBS_CFLAGS)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
@ -735,15 +729,23 @@ 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
|
||||
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -mminimal-toc -mcpu=powerpc64 -mtune=power5"
|
||||
$1_CFLAGS_CPU="-mcpu=power8 -mtune=power8"
|
||||
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -mminimal-toc"
|
||||
elif test "x$FLAGS_CPU" = xppc64le; then
|
||||
# Little endian machine uses ELFv2 ABI.
|
||||
# Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI.
|
||||
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8"
|
||||
# Use Power8 for target cpu, this is the first CPU to support PPC64 LE with ELFv2 ABI.
|
||||
# Use Power10 for tuning target, this is supported by gcc >= 10
|
||||
POWER_TUNE_VERSION="-mtune=power10"
|
||||
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${POWER_TUNE_VERSION}],
|
||||
IF_FALSE: [
|
||||
POWER_TUNE_VERSION="-mtune=power8"
|
||||
]
|
||||
)
|
||||
$1_CFLAGS_CPU="-mcpu=power8 ${POWER_TUNE_VERSION}"
|
||||
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2"
|
||||
fi
|
||||
elif test "x$FLAGS_CPU" = xs390x; then
|
||||
$1_CFLAGS_CPU="-mbackchain -march=z10"
|
||||
@ -761,6 +763,11 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
# for all archs except arm and ppc, prevent gcc to omit frame pointer
|
||||
$1_CFLAGS_CPU_JDK="${$1_CFLAGS_CPU_JDK} -fno-omit-frame-pointer"
|
||||
fi
|
||||
if test "x$FLAGS_CPU" = xppc64le; then
|
||||
# Little endian machine uses ELFv2 ABI.
|
||||
# Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI.
|
||||
$1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power10"
|
||||
fi
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
$1_CFLAGS_CPU="-mcpu=pwr8"
|
||||
@ -779,10 +786,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
FLAGS_SETUP_GCC6_COMPILER_FLAGS($1, $3)
|
||||
$1_TOOLCHAIN_CFLAGS="${$1_GCC6_CFLAGS}"
|
||||
|
||||
$1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized"
|
||||
# This flag is required since GCC 6 as undefined behavior in OpenJDK code
|
||||
# runs afoul of the more aggressive versions of this optimization.
|
||||
$1_TOOLCHAIN_CFLAGS="-fno-lifetime-dse"
|
||||
fi
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
@ -856,6 +862,22 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
|
||||
FLAGS_SETUP_BRANCH_PROTECTION
|
||||
|
||||
if test "x$FLAGS_CPU" = xriscv64; then
|
||||
AC_MSG_CHECKING([if RVV/vector sigcontext supported])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <linux/ptrace.h>],
|
||||
[
|
||||
return (int)sizeof(struct __riscv_v_ext_state);
|
||||
])],
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
],
|
||||
[
|
||||
$1_DEFINES_CPU_JVM="${$1_DEFINES_CPU_JVM} -DNO_RVV_SIGCONTEXT"
|
||||
AC_MSG_RESULT([no])
|
||||
]
|
||||
)
|
||||
fi
|
||||
|
||||
# EXPORT to API
|
||||
CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM \
|
||||
$TOOLCHAIN_CFLAGS_JVM ${$1_TOOLCHAIN_CFLAGS_JVM} \
|
||||
@ -912,20 +934,48 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
IF_FALSE: [$2FDLIBM_CFLAGS=""])
|
||||
fi
|
||||
AC_SUBST($2FDLIBM_CFLAGS)
|
||||
])
|
||||
|
||||
# FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX])
|
||||
# Arguments:
|
||||
# $1 - Prefix for each variable defined.
|
||||
# $2 - Prefix for compiler variables (either BUILD_ or nothing).
|
||||
AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS],
|
||||
[
|
||||
# This flag is required for GCC 6 builds as undefined behavior in OpenJDK code
|
||||
# runs afoul of the more aggressive versions of this optimization.
|
||||
NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
|
||||
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG],
|
||||
PREFIX: $2, IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""])
|
||||
$1_GCC6_CFLAGS="${NO_LIFETIME_DSE_CFLAG}"
|
||||
# Check whether the compiler supports the Arm C Language Extensions (ACLE)
|
||||
# for SVE. Set SVE_CFLAGS to -march=armv8-a+sve if it does.
|
||||
# ACLE and this flag are required to build the aarch64 SVE related functions in
|
||||
# libvectormath. Apple Silicon does not support SVE; use macOS as a proxy for
|
||||
# that check.
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xaarch64" && test "x$OPENJDK_TARGET_OS" = "xlinux"; then
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
AC_LANG_PUSH(C)
|
||||
OLD_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -march=armv8-a+sve"
|
||||
AC_MSG_CHECKING([if Arm SVE ACLE is supported])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <arm_sve.h>],
|
||||
[
|
||||
svint32_t r = svdup_n_s32(1);
|
||||
return 0;
|
||||
])],
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
$2SVE_CFLAGS="-march=armv8-a+sve"
|
||||
# Switching the initialization mode with gcc from 'pattern' to 'zero'
|
||||
# avoids the use of unsupported `__builtin_clear_padding` for variable
|
||||
# length aggregates
|
||||
if test "x$DEBUG_LEVEL" != xrelease && test "x$TOOLCHAIN_TYPE" = xgcc ; then
|
||||
INIT_ZERO_FLAG="-ftrivial-auto-var-init=zero"
|
||||
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$INIT_ZERO_FLAG],
|
||||
IF_TRUE: [
|
||||
$2SVE_CFLAGS="${$2SVE_CFLAGS} $INIT_ZERO_FLAG"
|
||||
]
|
||||
)
|
||||
fi
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT([no])
|
||||
$2SVE_CFLAGS=""
|
||||
]
|
||||
)
|
||||
CFLAGS="$OLD_CFLAGS"
|
||||
AC_LANG_POP(C)
|
||||
fi
|
||||
fi
|
||||
AC_SUBST($2SVE_CFLAGS)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([FLAGS_SETUP_BRANCH_PROTECTION],
|
||||
|
||||
@ -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
|
||||
@ -73,10 +73,12 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
# Clang needs the lld linker to work correctly
|
||||
BASIC_LDFLAGS="-fuse-ld=lld -Wl,--exclude-libs,ALL"
|
||||
UTIL_REQUIRE_PROGS(LLD, lld)
|
||||
if test "x$CXX_IS_USER_SUPPLIED" = xfalse && test "x$CC_IS_USER_SUPPLIED" = xfalse; then
|
||||
UTIL_REQUIRE_PROGS(LLD, lld, $TOOLCHAIN_PATH:$PATH)
|
||||
fi
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
BASIC_LDFLAGS="-Wl,-b64 -Wl,-brtl -Wl,-bnorwexec -Wl,-bnolibpath -Wl,-bnoexpall \
|
||||
BASIC_LDFLAGS="-Wl,-b64 -Wl,-brtl -Wl,-bnorwexec -Wl,-blibpath:/usr/lib:lib -Wl,-bnoexpall \
|
||||
-Wl,-bernotok -Wl,-bdatapsize:64k -Wl,-btextpsize:64k -Wl,-bstackpsize:64k"
|
||||
BASIC_LDFLAGS_JVM_ONLY="$BASIC_LDFLAGS_JVM_ONLY -Wl,-lC_r -Wl,-bbigtoc"
|
||||
fi
|
||||
@ -98,7 +100,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
# FIXME: We should really generalize SET_SHARED_LIBRARY_ORIGIN instead.
|
||||
OS_LDFLAGS_JVM_ONLY="-Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/.."
|
||||
OS_LDFLAGS="-mmacosx-version-min=$MACOSX_VERSION_MIN"
|
||||
OS_LDFLAGS="-mmacosx-version-min=$MACOSX_VERSION_MIN -Wl,-reproducible"
|
||||
fi
|
||||
|
||||
# Setup debug level-dependent LDFLAGS
|
||||
@ -190,18 +192,23 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_CPU_DEP],
|
||||
# Export variables according to old definitions, prefix with $2 if present.
|
||||
LDFLAGS_JDK_COMMON="$BASIC_LDFLAGS $BASIC_LDFLAGS_JDK_ONLY \
|
||||
$OS_LDFLAGS $DEBUGLEVEL_LDFLAGS_JDK_ONLY ${$2EXTRA_LDFLAGS}"
|
||||
$2LDFLAGS_JDKLIB="$LDFLAGS_JDK_COMMON $BASIC_LDFLAGS_JDK_LIB_ONLY \
|
||||
$2LDFLAGS_JDKLIB="$LDFLAGS_JDK_COMMON \
|
||||
$SHARED_LIBRARY_FLAGS $REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
|
||||
$2LDFLAGS_JDKEXE="$LDFLAGS_JDK_COMMON $EXECUTABLE_LDFLAGS \
|
||||
${$1_CPU_EXECUTABLE_LDFLAGS} $REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
|
||||
|
||||
$2LDFLAGS_STATIC_JDK="$BASIC_LDFLAGS $OS_LDFLAGS ${$2EXTRA_LDFLAGS} \
|
||||
$REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
|
||||
|
||||
$2JVM_LDFLAGS="$BASIC_LDFLAGS $BASIC_LDFLAGS_JVM_ONLY $OS_LDFLAGS $OS_LDFLAGS_JVM_ONLY \
|
||||
$DEBUGLEVEL_LDFLAGS $DEBUGLEVEL_LDFLAGS_JVM_ONLY $BASIC_LDFLAGS_ONLYCXX \
|
||||
$DEBUGLEVEL_LDFLAGS $DEBUGLEVEL_LDFLAGS_JVM_ONLY \
|
||||
${$1_CPU_LDFLAGS} ${$1_CPU_LDFLAGS_JVM_ONLY} ${$2EXTRA_LDFLAGS} \
|
||||
$REPRODUCIBLE_LDFLAGS $FILE_MACRO_LDFLAGS"
|
||||
|
||||
AC_SUBST($2LDFLAGS_JDKLIB)
|
||||
AC_SUBST($2LDFLAGS_JDKEXE)
|
||||
|
||||
AC_SUBST($2LDFLAGS_STATIC_JDK)
|
||||
|
||||
AC_SUBST($2JVM_LDFLAGS)
|
||||
])
|
||||
|
||||
@ -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
|
||||
@ -115,7 +115,11 @@ AC_DEFUN([FLAGS_SETUP_ASFLAGS],
|
||||
# Force preprocessor to run, just to make sure
|
||||
BASIC_ASFLAGS="-x assembler-with-cpp"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
BASIC_ASFLAGS="-nologo -c"
|
||||
if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
|
||||
BASIC_ASFLAGS="-nologo"
|
||||
else
|
||||
BASIC_ASFLAGS="-nologo -c"
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(BASIC_ASFLAGS)
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user