mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-20 23:41:44 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
082e7010fe | ||
|
|
bb516821ba | ||
|
|
d9821157ff |
4
.github/actions/do-build/action.yml
vendored
4
.github/actions/do-build/action.yml
vendored
@@ -66,7 +66,7 @@ runs:
|
||||
shell: bash
|
||||
|
||||
- name: 'Upload build logs'
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: failure-logs-${{ inputs.platform }}${{ inputs.debug-suffix }}
|
||||
path: failure-logs
|
||||
@@ -74,7 +74,7 @@ runs:
|
||||
|
||||
# This is the best way I found to abort the job with an error message
|
||||
- name: 'Notify about build failures'
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: core.setFailed('Build failed. See summary for details.')
|
||||
if: steps.check.outputs.failure == 'true'
|
||||
|
||||
2
.github/actions/get-bootjdk/action.yml
vendored
2
.github/actions/get-bootjdk/action.yml
vendored
@@ -65,7 +65,7 @@ runs:
|
||||
|
||||
- name: 'Check cache for BootJDK'
|
||||
id: get-cached-bootjdk
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: bootjdk/jdk
|
||||
key: boot-jdk-${{ inputs.platform }}-${{ steps.sha256.outputs.value }}
|
||||
|
||||
4
.github/actions/get-bundles/action.yml
vendored
4
.github/actions/get-bundles/action.yml
vendored
@@ -48,14 +48,14 @@ runs:
|
||||
steps:
|
||||
- name: 'Download bundles artifact'
|
||||
id: download-bundles
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}
|
||||
path: bundles
|
||||
continue-on-error: true
|
||||
|
||||
- name: 'Download bundles artifact (retry)'
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}
|
||||
path: bundles
|
||||
|
||||
2
.github/actions/get-jtreg/action.yml
vendored
2
.github/actions/get-jtreg/action.yml
vendored
@@ -41,7 +41,7 @@ runs:
|
||||
|
||||
- name: 'Check cache for JTReg'
|
||||
id: get-cached-jtreg
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: jtreg/installed
|
||||
key: jtreg-${{ steps.version.outputs.value }}
|
||||
|
||||
3
.github/actions/get-msys2/action.yml
vendored
3
.github/actions/get-msys2/action.yml
vendored
@@ -30,7 +30,8 @@ runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: 'Install MSYS2'
|
||||
uses: msys2/setup-msys2@v2.22.0
|
||||
# use a specific release of msys2/setup-msys2 to prevent jtreg build failures on newer release
|
||||
uses: msys2/setup-msys2@7efe20baefed56359985e327d329042cde2434ff
|
||||
with:
|
||||
install: 'autoconf tar unzip zip make'
|
||||
path-type: minimal
|
||||
|
||||
2
.github/actions/upload-bundles/action.yml
vendored
2
.github/actions/upload-bundles/action.yml
vendored
@@ -69,7 +69,7 @@ runs:
|
||||
shell: bash
|
||||
|
||||
- name: 'Upload bundles artifact'
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}
|
||||
path: bundles
|
||||
|
||||
26
.github/workflows/build-cross-compile.yml
vendored
26
.github/workflows/build-cross-compile.yml
vendored
@@ -61,32 +61,27 @@ jobs:
|
||||
debian-arch: arm64
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
tolerate-sysroot-errors: false
|
||||
- target-cpu: arm
|
||||
gnu-arch: arm
|
||||
debian-arch: armhf
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
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
|
||||
tolerate-sysroot-errors: false
|
||||
- target-cpu: ppc64le
|
||||
gnu-arch: powerpc64le
|
||||
debian-arch: ppc64el
|
||||
debian-repository: https://httpredir.debian.org/debian/
|
||||
debian-version: bullseye
|
||||
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
|
||||
|
||||
steps:
|
||||
- name: 'Checkout the JDK source'
|
||||
@@ -98,6 +93,13 @@ jobs:
|
||||
with:
|
||||
platform: linux-x64
|
||||
|
||||
# Use linux-x64 JDK bundle as build JDK
|
||||
- name: 'Get build JDK'
|
||||
id: buildjdk
|
||||
uses: ./.github/actions/get-bundles
|
||||
with:
|
||||
platform: linux-x64
|
||||
|
||||
- name: 'Get GTest'
|
||||
id: gtest
|
||||
uses: ./.github/actions/get-gtest
|
||||
@@ -118,7 +120,7 @@ jobs:
|
||||
|
||||
- name: 'Check cache for sysroot'
|
||||
id: get-cached-sysroot
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: sysroot
|
||||
key: sysroot-${{ matrix.debian-arch }}-${{ hashFiles('./.github/workflows/build-cross-compile.yml') }}
|
||||
@@ -128,7 +130,6 @@ jobs:
|
||||
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
|
||||
- name: 'Create sysroot'
|
||||
id: create-sysroot
|
||||
run: >
|
||||
sudo debootstrap
|
||||
--arch=${{ matrix.debian-arch }}
|
||||
@@ -139,7 +140,6 @@ jobs:
|
||||
${{ matrix.debian-version }}
|
||||
sysroot
|
||||
${{ matrix.debian-repository }}
|
||||
continue-on-error: ${{ matrix.tolerate-sysroot-errors }}
|
||||
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
|
||||
- name: 'Prepare sysroot'
|
||||
@@ -151,12 +151,7 @@ jobs:
|
||||
rm -rf sysroot/usr/{sbin,bin,share}
|
||||
rm -rf sysroot/usr/lib/{apt,gcc,udev,systemd}
|
||||
rm -rf sysroot/usr/libexec/gcc
|
||||
if: steps.create-sysroot.outcome == 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
|
||||
- name: 'Remove broken sysroot'
|
||||
run: |
|
||||
sudo rm -rf sysroot/
|
||||
if: steps.create-sysroot.outcome != 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
|
||||
|
||||
- name: 'Configure'
|
||||
run: >
|
||||
@@ -170,6 +165,7 @@ jobs:
|
||||
--disable-precompiled-headers
|
||||
--openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
|
||||
--with-sysroot=sysroot
|
||||
--with-build-jdk=${{ steps.buildjdk.outputs.jdk-path }}
|
||||
--with-jmod-compress=zip-1
|
||||
CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-${{ inputs.gcc-major-version }}
|
||||
CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-${{ inputs.gcc-major-version }}
|
||||
@@ -177,7 +173,6 @@ jobs:
|
||||
echo "Dumping config.log:" &&
|
||||
cat config.log &&
|
||||
exit 1)
|
||||
if: steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true'
|
||||
|
||||
- name: 'Build'
|
||||
id: build
|
||||
@@ -185,4 +180,3 @@ 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'
|
||||
|
||||
63
.github/workflows/main.yml
vendored
63
.github/workflows/main.yml
vendored
@@ -31,7 +31,7 @@ on:
|
||||
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, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
|
||||
default: 'linux-x64, linux-x86, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
|
||||
configure-arguments:
|
||||
description: 'Additional configure arguments'
|
||||
required: false
|
||||
@@ -54,7 +54,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
linux-x64: ${{ steps.include.outputs.linux-x64 }}
|
||||
linux-x86-hs: ${{ steps.include.outputs.linux-x86-hs }}
|
||||
linux-x86: ${{ steps.include.outputs.linux-x86 }}
|
||||
# additional build options for linux-x64 are disabled
|
||||
# linux-x64-variants: ${{ steps.include.outputs.linux-x64-variants }}
|
||||
linux-cross-compile: ${{ steps.include.outputs.linux-cross-compile }}
|
||||
@@ -107,7 +107,7 @@ jobs:
|
||||
}
|
||||
|
||||
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-x86=$(check_platform linux-x86 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 "macos-x64=$(check_platform macos-x64 macos x64)" >> $GITHUB_OUTPUT
|
||||
@@ -129,15 +129,15 @@ jobs:
|
||||
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'
|
||||
# The linux-x64 jdk bundle is used as buildjdk for the cross-compile job
|
||||
if: needs.select.outputs.linux-x64 == 'true' || needs.select.outputs.linux-cross-compile == 'true'
|
||||
|
||||
build-linux-x86-hs:
|
||||
name: linux-x86-hs
|
||||
build-linux-x86:
|
||||
name: linux-x86
|
||||
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'
|
||||
@@ -147,7 +147,7 @@ jobs:
|
||||
extra-conf-options: '--with-target-bits=32'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-x86-hs == 'true'
|
||||
if: needs.select.outputs.linux-x86 == 'true'
|
||||
|
||||
build-linux-x64-hs-nopch:
|
||||
name: linux-x64-hs-nopch
|
||||
@@ -210,6 +210,7 @@ jobs:
|
||||
name: linux-cross-compile
|
||||
needs:
|
||||
- select
|
||||
- build-linux-x64
|
||||
uses: ./.github/workflows/build-cross-compile.yml
|
||||
with:
|
||||
gcc-major-version: '10'
|
||||
@@ -297,6 +298,16 @@ jobs:
|
||||
bootjdk-platform: linux-x64
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
test-linux-x86:
|
||||
name: linux-x86
|
||||
needs:
|
||||
- build-linux-x86
|
||||
uses: ./.github/workflows/test.yml
|
||||
with:
|
||||
platform: linux-x86
|
||||
bootjdk-platform: linux-x64
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
test-macos-x64:
|
||||
name: macos-x64
|
||||
needs:
|
||||
@@ -334,7 +345,7 @@ jobs:
|
||||
if: always()
|
||||
needs:
|
||||
- build-linux-x64
|
||||
- build-linux-x86-hs
|
||||
- build-linux-x86
|
||||
- build-linux-x64-hs-nopch
|
||||
- build-linux-x64-hs-zero
|
||||
- build-linux-x64-hs-minimal
|
||||
@@ -345,27 +356,31 @@ jobs:
|
||||
- build-windows-x64
|
||||
- build-windows-aarch64
|
||||
- test-linux-x64
|
||||
- test-linux-x86
|
||||
- test-macos-x64
|
||||
- test-windows-x64
|
||||
|
||||
steps:
|
||||
# Hack to get hold of the api environment variables that are only defined for actions
|
||||
- name: 'Get API configuration'
|
||||
id: api
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }'
|
||||
|
||||
- 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')"
|
||||
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" \
|
||||
ALL_ARTIFACT_URLS="$(curl -s \
|
||||
-H 'Accept: application/json;api-version=6.0-preview' \
|
||||
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
|
||||
'${{ fromJson(steps.api.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview')"
|
||||
BUNDLE_ARTIFACT_URLS="$(echo "$ALL_ARTIFACT_URLS" | jq -r -c '.value | map(select(.name|startswith("bundles-"))) | .[].url')"
|
||||
for url in $BUNDLE_ARTIFACT_URLS; do
|
||||
echo "Removing $url"
|
||||
curl -s \
|
||||
-H 'Accept: application/json;api-version=6.0-preview' \
|
||||
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
|
||||
-X DELETE "$url" \
|
||||
|| echo "Failed to remove bundle"
|
||||
done
|
||||
|
||||
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -211,7 +211,7 @@ jobs:
|
||||
if: always()
|
||||
|
||||
- name: 'Upload test results'
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: results
|
||||
name: ${{ steps.package.outputs.artifact-name }}
|
||||
@@ -219,7 +219,7 @@ jobs:
|
||||
|
||||
# This is the best way I found to abort the job with an error message
|
||||
- name: 'Notify about test failures'
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: core.setFailed('${{ steps.run-tests.outputs.error-message }}')
|
||||
if: steps.run-tests.outputs.failure == 'true'
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -23,4 +23,3 @@ NashornProfile.txt
|
||||
/.cproject
|
||||
/compile_commands.json
|
||||
/.cache
|
||||
/jbr-api/
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
[general]
|
||||
project=jdk-updates
|
||||
jbs=JDK
|
||||
version=21.0.5
|
||||
version=21.0.3
|
||||
|
||||
[checks]
|
||||
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
|
||||
warning=issuestitle,binary
|
||||
|
||||
[repository]
|
||||
tags=(?:jdk-(?:[1-9]([0-9]*)(?:\.(?:0|[1-9][0-9]*)){0,4})(?:\+(?:(?:[0-9]+))|(?:-ga)))|(?:jdk[4-9](?:u\d{1,3})?-(?:(?:b\d{2,3})|(?:ga)))|(?:hs\d\d(?:\.\d{1,2})?-b\d\d)
|
||||
|
||||
40
README.md
40
README.md
@@ -110,32 +110,34 @@ coverage of all the details.
|
||||
### Linux (Docker)
|
||||
Create a container:
|
||||
```
|
||||
$ cd ./jb/project/docker/
|
||||
$ ./mkdocker_x64.sh
|
||||
$ cd jb/project/docker
|
||||
$ docker build .
|
||||
...
|
||||
Successfully built 942ea9900054
|
||||
```
|
||||
Run these commands in the new container:
|
||||
```
|
||||
$ docker run -v `pwd`../../../../:/JetBrainsRuntime -it jetbrains/runtime:oraclelinux8_x64
|
||||
# yum install java-21-openjdk-devel
|
||||
$ docker run -v `pwd`../../../../:/JetBrainsRuntime -it 942ea9900054
|
||||
# cd /JetBrainsRuntime
|
||||
# BOOT_JDK=/usr/lib/jvm/java-21/ ./jb/project/tools/linux/scripts/mkimages_x64.sh 99 nomod
|
||||
# sh ./configure
|
||||
# make images CONF=linux-x86_64-normal-server-release
|
||||
```
|
||||
|
||||
### Ubuntu Linux
|
||||
Install the necessary tools, libraries, and headers with:
|
||||
```
|
||||
$ sudo wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | tee /etc/apt/trusted.gpg.d/lunarg.asc
|
||||
$ sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-noble.list https://packages.lunarg.com/vulkan/lunarg-vulkan-noble.list
|
||||
$ sudo apt update
|
||||
$ sudo apt-get -y install openjdk-21-jdk file zip unzip autoconf make build-essential libx11-dev libxext-dev libxrender-dev \
|
||||
libxtst-dev libxt-dev libxrandr-dev libcups2-dev libfontconfig1-dev libasound2-dev libspeechd-dev libwayland-dev \
|
||||
libxkbcommon-x11-0 vulkan-sdk vulkan-utility-libraries-dev
|
||||
$ sudo apt-get install autoconf make build-essential libx11-dev libxext-dev libxrender-dev \
|
||||
libxtst-dev libxt-dev libxrandr-dev libcups2-dev libfontconfig1-dev libasound2-dev libwayland-dev \
|
||||
libxkbcommon-x11-0
|
||||
```
|
||||
Get Java 19 (for instance, [Azul Zulu Builds of OpenJDK 19](https://www.azul.com/downloads/?version=java-19-sts&os=linux&package=jdk)).
|
||||
|
||||
Then run the following:
|
||||
```
|
||||
$ cd /JetBrainsRuntime
|
||||
$ BOOT_JDK=/usr/lib/jvm/java-21-openjdk-amd64 ./jb/project/tools/linux/scripts/mkimages_x64.sh 99 nomod
|
||||
$ cd JetBrainsRuntime
|
||||
$ git checkout main
|
||||
$ sh ./configure
|
||||
$ make images
|
||||
```
|
||||
This will build the release configuration under `./build/linux-x86_64-server-release/`.
|
||||
|
||||
@@ -167,18 +169,6 @@ $ make images
|
||||
```
|
||||
This will build the release configuration under `./build/windows-x86_64-server-release/`.
|
||||
|
||||
#### Enable optional NVDA screen reader support
|
||||
If you want to add support of a11y announcing via [NVDA screen reader](https://www.nvaccess.org/about-nvda/),
|
||||
you will need to bundle the NVDA Controller Client library.
|
||||
You can do it with the following steps:
|
||||
1. Download the NVDA Controller Client library. You can find the link in its official README [here](https://github.com/nvaccess/nvda/blob/master/extras/controllerClient/readme.md)
|
||||
2. Pass the path to the unpacked package to `configure` via an additional flag `--with-nvdacontrollerclient=<path>`.
|
||||
The build system will search the required library files under `<path>/<target-arch>`.
|
||||
|
||||
#### Disable optional JAWS screen reader support
|
||||
JBR is built with built-in support of JAWS screen reader.
|
||||
If you want to disable it, run `configure` with the additional flag `--disable-jaws-client`.
|
||||
|
||||
### macOS
|
||||
Install the following:
|
||||
* Xcode command line developer tools and `autoconf` via [Homebrew](https://brew.sh/).
|
||||
|
||||
@@ -179,9 +179,8 @@ more tab-completion friendly. For more complex test runs, the
|
||||
<p>The test specifications given in <code>TEST</code> is parsed into
|
||||
fully qualified test descriptors, which clearly and unambigously show
|
||||
which tests will be run. As an example, <code>:tier1</code> will expand
|
||||
to include all subcomponent test directories that define `tier1`,
|
||||
for example:
|
||||
<code>jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1 jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1 ...</code>.
|
||||
to
|
||||
<code>jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1 jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1 jtreg:$(TOPDIR)/test/nashorn:tier1 jtreg:$(TOPDIR)/test/jaxp:tier1</code>.
|
||||
You can always submit a list of fully qualified test descriptors in the
|
||||
<code>TEST</code> variable if you want to shortcut the parser.</p>
|
||||
<h3 id="common-test-groups">Common Test Groups</h3>
|
||||
|
||||
@@ -102,11 +102,11 @@ test runs, the `test TEST="x"` solution needs to be used.
|
||||
|
||||
The test specifications given in `TEST` is parsed into fully qualified test
|
||||
descriptors, which clearly and unambigously show which tests will be run. As an
|
||||
example, `:tier1` will expand to include all subcomponent test directories
|
||||
that define `tier1`, for example: `jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1
|
||||
jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1 ...`. You
|
||||
can always submit a list of fully qualified test descriptors in the `TEST`
|
||||
variable if you want to shortcut the parser.
|
||||
example, `:tier1` will expand to `jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1
|
||||
jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1
|
||||
jtreg:$(TOPDIR)/test/nashorn:tier1 jtreg:$(TOPDIR)/test/jaxp:tier1`. You can
|
||||
always submit a list of fully qualified test descriptors in the `TEST` variable
|
||||
if you want to shortcut the parser.
|
||||
|
||||
### Common Test Groups
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
1.0.2
|
||||
46
jb/project/docker/Dockerfile.aarch64
Normal file
46
jb/project/docker/Dockerfile.aarch64
Normal file
@@ -0,0 +1,46 @@
|
||||
# NOTE: This Dockerfile is meant to be used from the mkdocker_aarch64.sh script.
|
||||
|
||||
# Pull a concrete version of Linux that does NOT recieve updates after it's
|
||||
# been created. This is so that the image is as stable as possible to make
|
||||
# image creation reproducible.
|
||||
# NB: this also means there may be no security-related fixes there, need to
|
||||
# move the version to the next manually.
|
||||
|
||||
# jetbrains/runtime:jbr17env_aarch64
|
||||
FROM arm64v8/centos:7
|
||||
|
||||
# Install the necessary build tools
|
||||
RUN yum -y update; \
|
||||
yum -y install centos-release-scl; \
|
||||
yum -y install devtoolset-10-10.1-0.el7; \
|
||||
yum -y install \
|
||||
alsa-lib-devel-1.1.8-1.el7.aarch64 \
|
||||
autoconf-2.69-11.el7.noarch \
|
||||
automake-1.13.4-3.el7.noarch \
|
||||
bzip2-1.0.6-13.el7.aarch64 \
|
||||
cups-devel-1.6.3-51.el7.aarch64 \
|
||||
file-5.11-37.el7.aarch64 \
|
||||
fontconfig-devel-2.13.0-4.3.el7.aarch64 \
|
||||
freetype-devel-2.8-14.el7_9.1.aarch64 \
|
||||
giflib-devel-4.1.6-9.el7.aarch64 \
|
||||
git-1.8.3.1-24.el7_9.aarch64 \
|
||||
libtool-2.4.2-22.el7_3.aarch64 \
|
||||
libXi-devel-1.7.9-1.el7.aarch64 \
|
||||
libXrandr-devel-1.5.1-2.el7.aarch64 \
|
||||
libXrender-devel-0.9.10-1.el7.aarch64 \
|
||||
libXt-devel-1.1.5-3.el7.aarch64 \
|
||||
libXtst-devel-1.2.3-1.el7.aarch64 \
|
||||
make-3.82-24.el7.aarch64 \
|
||||
rsync-3.1.2-12.el7_9.aarch64 \
|
||||
tar-1.26-35.el7.aarch64 \
|
||||
unzip-6.0-24.el7_9.aarch64 \
|
||||
wayland-devel-1.15.0-1.el7 \
|
||||
zip-3.0-11.el7.aarch64; \
|
||||
yum -y clean all
|
||||
|
||||
ENV PATH="/opt/rh/devtoolset-10/root/usr/bin:${PATH}"
|
||||
ENV LD_LIBRARY_PATH="/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib"
|
||||
ENV PKG_CONFIG_PATH="/opt/rh/devtoolset-10/root/usr/lib64/pkgconfig"
|
||||
|
||||
RUN git config --global user.email "teamcity@jetbrains.com" && \
|
||||
git config --global user.name "builduser"
|
||||
43
jb/project/docker/Dockerfile.musl_aarch64
Normal file
43
jb/project/docker/Dockerfile.musl_aarch64
Normal file
@@ -0,0 +1,43 @@
|
||||
# NOTE: This Dockerfile is meant to be used from the mkdocker_musl_aarch64.sh script.
|
||||
|
||||
# Pull a concrete version of Linux that does NOT recieve updates after it's
|
||||
# been created. This is so that the image is as stable as possible to make
|
||||
# image creation reproducible.
|
||||
# NB: this also means there may be no security-related fixes there, need to
|
||||
# move the version to the next manually.
|
||||
FROM arm64v8/alpine:3.12
|
||||
|
||||
# Install the necessary build tools
|
||||
RUN apk --no-cache add --update \
|
||||
alsa-lib-dev=1.2.2-r0 \
|
||||
autoconf=2.69-r2 \
|
||||
bash=5.0.17-r0 \
|
||||
build-base=0.5-r2 \
|
||||
bzip2=1.0.8-r1 \
|
||||
cups-dev=2.3.3-r0 \
|
||||
file=5.38-r0 \
|
||||
fontconfig=2.13.1-r2 \
|
||||
fontconfig-dev=2.13.1-r2 \
|
||||
freetype-dev=2.10.4-r2 \
|
||||
git=2.26.3-r1 \
|
||||
grep=3.4-r0 \
|
||||
libx11-dev=1.6.12-r1 \
|
||||
libxext-dev=1.3.4-r0 \
|
||||
libxrandr-dev=1.5.2-r0 \
|
||||
libxrender-dev=0.9.10-r3 \
|
||||
libxt-dev=1.2.0-r0 \
|
||||
libxtst-dev=1.2.3-r3 \
|
||||
linux-headers=5.4.5-r1 \
|
||||
rsync=3.1.3-r3 \
|
||||
tar=1.32-r2 \
|
||||
wayland-dev=1.18.0-r4 \
|
||||
zip=3.0-r8
|
||||
|
||||
|
||||
# Set up boot JDK for building
|
||||
COPY boot_jdk_musl_aarch64.tar.gz /jdk20/
|
||||
RUN cd /jdk20 && tar --strip-components=1 -xzf boot_jdk_musl_aarch64.tar.gz && rm /jdk20/boot_jdk_musl_aarch64.tar.gz
|
||||
ENV BOOT_JDK=/jdk20
|
||||
|
||||
RUN git config --global user.email "teamcity@jetbrains.com" && \
|
||||
git config --global user.name "builduser"
|
||||
@@ -1,4 +1,4 @@
|
||||
# NOTE: This Dockerfile is meant to be used from the mkdocker_musl_<arch>.sh script.
|
||||
# NOTE: This Dockerfile is meant to be used from the mkdocker_musl_x64.sh script.
|
||||
|
||||
# Pull a concrete version of Linux that does NOT recieve updates after it's
|
||||
# been created. This is so that the image is as stable as possible to make
|
||||
@@ -31,12 +31,12 @@ RUN apk --no-cache add --update \
|
||||
rsync=3.2.5-r0 \
|
||||
tar=1.34-r1 \
|
||||
wayland-dev=1.19.0-r0 \
|
||||
zip=3.0-r9 \
|
||||
vulkan-headers=1.2.170-r0 \
|
||||
vulkan-loader-dev=1.2.170-r1 \
|
||||
glslang=8.13.3743-r1
|
||||
zip=3.0-r9
|
||||
|
||||
# Set up boot JDK for building
|
||||
COPY boot_jdk_musl_amd64.tar.gz /jdk20/
|
||||
RUN cd /jdk20 && tar --strip-components=1 -xzf boot_jdk_musl_amd64.tar.gz && rm /jdk20/boot_jdk_musl_amd64.tar.gz
|
||||
ENV BOOT_JDK=/jdk20
|
||||
|
||||
RUN git config --global user.email "teamcity@jetbrains.com" && \
|
||||
git config --global user.name "builduser" && \
|
||||
git config --global --add safe.directory '*' && \
|
||||
git config --global http.postBuffer 524288000
|
||||
git config --global user.name "builduser"
|
||||
@@ -1,63 +0,0 @@
|
||||
# NOTE: This Dockerfile is meant to be used from the mkdocker_<arch>.sh script.
|
||||
|
||||
# Pull a concrete version of Linux that does NOT recieve updates after it's
|
||||
# been created. This is so that the image is as stable as possible to make
|
||||
# image creation reproducible.
|
||||
# NB: this also means there may be no security-related fixes there, need to
|
||||
# move the version to the next manually.
|
||||
|
||||
FROM oraclelinux:8
|
||||
|
||||
# Install the necessary build tools
|
||||
RUN yum -y update; \
|
||||
yum -y install gcc-toolset-10-10.1-0.el8; \
|
||||
yum -y install \
|
||||
alsa-lib-devel-1.1.9-4.el8 \
|
||||
autoconf-2.69-29.el8_10.1 \
|
||||
automake-1.16.1-6.el8 \
|
||||
bzip2-libs-1.0.6-26.el8 \
|
||||
cups-devel-2.2.6-60.el8_10 \
|
||||
file-5.33-26.el8 \
|
||||
fontconfig-devel-2.13.1-4.el8 \
|
||||
freetype-devel-2.9.1-9.el8 \
|
||||
gcc-c++-8.5.0-22.0.1.el8_10 \
|
||||
git-2.43.5-1.el8_10 \
|
||||
git-core-2.43.5-1.el8_10 \
|
||||
libtool-2.4.6-25.el8 \
|
||||
libXi-devel-1.7.10-1.el8 \
|
||||
libXrandr-devel-1.5.2-1.el8 \
|
||||
libXrender-devel-0.9.10-7.el8 \
|
||||
libXt-devel-1.1.5-12.el8 \
|
||||
libXtst-devel-1.2.3-7.el8 \
|
||||
make-devel-4.2.1-11.el8 \
|
||||
rsync-3.1.3-19.el8_7.1 \
|
||||
unzip-6.0-46.el8 \
|
||||
wayland-devel-1.21.0-1.el8 \
|
||||
python36-3.6.8-39.module+el8.10.0+90274+07ba55de \
|
||||
cmake-3.26.5-2.el8 \
|
||||
vulkan-headers-1.3.250.1-1.el8 \
|
||||
vulkan-loader-devel-1.3.250.1-1.el8 \
|
||||
vulkan-validation-layers-1.3.250.1-1.el8; \
|
||||
yum -y clean all
|
||||
|
||||
RUN git config --global user.email "teamcity@jetbrains.com" && \
|
||||
git config --global user.name "builduser" && \
|
||||
git config --global --add safe.directory '*' && \
|
||||
git config --global http.postBuffer 524288000
|
||||
|
||||
# Build GLSLC
|
||||
RUN git clone https://github.com/google/shaderc --branch v2023.6 \
|
||||
&& cd shaderc \
|
||||
&& ./utils/git-sync-deps \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
||||
-DSHADERC_SKIP_TESTS=ON \
|
||||
-DSHADERC_SKIP_EXAMPLES=ON \
|
||||
-DSHADERC_SKIP_COPYRIGHT_CHECK=ON \
|
||||
-DSPIRV_SKIP_EXECUTABLES=ON \
|
||||
-DENABLE_SPVREMAPPER=OFF \
|
||||
.. \
|
||||
&& make install
|
||||
@@ -46,5 +46,10 @@ RUN linux32 \
|
||||
apt-get clean -qy && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Set up boot JDK for building
|
||||
COPY boot_jdk_x86.tar.gz /jdk17/
|
||||
RUN cd /jdk17 && tar --strip-components=1 -xzf boot_jdk_x86.tar.gz && rm /jdk17/boot_jdk_x86.tar.gz
|
||||
ENV BOOT_JDK=/jdk17
|
||||
|
||||
RUN git config --global user.email "teamcity@jetbrains.com" && \
|
||||
git config --global user.name "builduser"
|
||||
73
jb/project/docker/Dockerfile.x86_64
Normal file
73
jb/project/docker/Dockerfile.x86_64
Normal file
@@ -0,0 +1,73 @@
|
||||
# jetbrains/runtime:jbr17env_x86_64
|
||||
FROM centos:7
|
||||
RUN yum -y install centos-release-scl; \
|
||||
yum -y install devtoolset-10-10.1-0.el7; \
|
||||
yum -y install \
|
||||
alsa-lib-devel-1.1.8-1.el7 \
|
||||
autoconf-2.69-11.el7 \
|
||||
automake-1.13.4-3.el7 \
|
||||
bzip2-1.0.6-13.el7 \
|
||||
cups-devel-1.6.3-51.el7 \
|
||||
file-5.11-37.el7 \
|
||||
fontconfig-devel-2.13.0-4.3.el7 \
|
||||
freetype-devel-2.8-14.el7_9.1 \
|
||||
giflib-devel-4.1.6-9.el7 \
|
||||
git-1.8.3.1-24.el7_9 \
|
||||
libtool-2.4.2-22.el7_3 \
|
||||
libXi-devel-1.7.9-1.el7 \
|
||||
libXrandr-devel-1.5.1-2.el7 \
|
||||
libXrender-devel-0.9.10-1.el7 \
|
||||
libXt-devel-1.1.5-3.el7 \
|
||||
libXtst-devel-1.2.3-1.el7 \
|
||||
make-3.82-24.el7 \
|
||||
tar-1.26-35.el7 \
|
||||
unzip-6.0-24.el7_9 \
|
||||
wayland-devel-1.15.0-1.el7 \
|
||||
wget-1.14-18.el7_6.1 \
|
||||
which-2.20-7.el7 \
|
||||
zip-3.0-11.el7 \
|
||||
python3-3.6.8-17.el7
|
||||
|
||||
RUN mkdir .git && \
|
||||
git config user.email "teamcity@jetbrains.com" && \
|
||||
git config user.name "builduser"
|
||||
|
||||
ENV LD_LIBRARY_PATH="/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib"
|
||||
ENV PATH="/opt/rh/devtoolset-10/root/usr/bin::${PATH}"
|
||||
ENV PKG_CONFIG_PATH="/opt/rh/devtoolset-10/root/usr/lib64/pkgconfig"
|
||||
|
||||
# Build GLSLC
|
||||
RUN curl -OL https://github.com/Kitware/CMake/releases/download/v3.27.5/cmake-3.27.5-linux-x86_64.tar.gz \
|
||||
&& echo 138c68addae825b16ed78d792dafef5e0960194833f48bd77e7e0429c6bc081c *cmake-3.27.5-linux-x86_64.tar.gz | sha256sum -c - \
|
||||
&& tar -xzf cmake-3.27.5-linux-x86_64.tar.gz \
|
||||
&& rm cmake-3.27.5-linux-x86_64.tar.gz \
|
||||
&& git clone https://github.com/google/shaderc --branch v2023.6 \
|
||||
&& cd shaderc \
|
||||
&& ./utils/git-sync-deps \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& /cmake-3.27.5-linux-x86_64/bin/cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
||||
-DSHADERC_SKIP_TESTS=ON \
|
||||
-DSHADERC_SKIP_EXAMPLES=ON \
|
||||
-DSHADERC_SKIP_COPYRIGHT_CHECK=ON \
|
||||
.. \
|
||||
&& make install
|
||||
ENV PATH="/cmake-3.27.5-linux-x86_64/bin::${PATH}"
|
||||
|
||||
# Checkout Vulkan headers
|
||||
RUN mkdir /vulkan \
|
||||
&& cd /vulkan \
|
||||
&& git init \
|
||||
&& git remote add -f origin https://github.com/KhronosGroup/Vulkan-Headers.git \
|
||||
&& git fetch origin \
|
||||
&& git checkout v1.3.265 -- include \
|
||||
&& rm -r .git \
|
||||
&& mkdir /vulkan_hpp \
|
||||
&& cd /vulkan_hpp \
|
||||
&& git init \
|
||||
&& git remote add -f origin https://github.com/KhronosGroup/Vulkan-Hpp.git \
|
||||
&& git fetch origin \
|
||||
&& git checkout v1.3.265 -- vulkan \
|
||||
&& rm -r .git
|
||||
@@ -1,14 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
# This script creates a Docker image suitable for building AArch64 variant
|
||||
# of the JetBrains Runtime "dev" version.
|
||||
|
||||
docker build \
|
||||
--platform=linux/aarch64 \
|
||||
-t registry.jetbrains.team/p/jbre/containers/oraclelinux8_aarch64:latest \
|
||||
--no-cache \
|
||||
-f Dockerfile.oraclelinux .
|
||||
BOOT_JDK_REMOTE_FILE=zulu17.30.15-ca-jdk17.0.1-linux_aarch64.tar.gz
|
||||
BOOT_JDK_SHA=4d9c9116eb0cdd2d7fb220d6d27059f4bf1b7e95cc93d5512bd8ce3791af86c7
|
||||
BOOT_JDK_LOCAL_FILE=boot_jdk.tar.gz
|
||||
|
||||
if [ ! -f $BOOT_JDK_LOCAL_FILE ]; then
|
||||
# Obtain "boot JDK" from outside of the container.
|
||||
wget -nc https://cdn.azul.com/zulu/bin/${BOOT_JDK_REMOTE_FILE} -O $BOOT_JDK_LOCAL_FILE
|
||||
else
|
||||
echo "boot JDK \"$BOOT_JDK_LOCAL_FILE\" present, skipping download"
|
||||
fi
|
||||
|
||||
# Verify that what we've downloaded can be trusted.
|
||||
sha256sum -c - <<EOF
|
||||
$BOOT_JDK_SHA *$BOOT_JDK_LOCAL_FILE
|
||||
EOF
|
||||
|
||||
docker build -t jbrdevenv_arm64v8 -f Dockerfile.aarch64 .
|
||||
|
||||
# NB: the resulting container can (and should) be used without the network
|
||||
# connection (--network none) during build in order to reduce the chance
|
||||
|
||||
@@ -1,14 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euxo pipefail
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
# This script creates a Docker image suitable for building musl AArch64 variant
|
||||
# of the JetBrains Runtime version 21.
|
||||
|
||||
docker build \
|
||||
--platform=linux/aarch64 \
|
||||
-t registry.jetbrains.team/p/jbre/containers/alpine14_aarch64:latest \
|
||||
--no-cache \
|
||||
-f Dockerfile.alpine .
|
||||
BOOT_JDK_REMOTE_FILE=zulu20.32.11-ca-jdk20.0.2-linux_musl_aarch64.tar.gz
|
||||
BOOT_JDK_SHA=eec57cf744c2438f695221f041d4804de3033ad33b6dba769d3359813ba3f90d
|
||||
BOOT_JDK_LOCAL_FILE=boot_jdk_musl_aarch64.tar.gz
|
||||
|
||||
if [ ! -f $BOOT_JDK_LOCAL_FILE ]; then
|
||||
# Obtain "boot JDK" from outside of the container.
|
||||
wget -nc https://cdn.azul.com/zulu/bin/${BOOT_JDK_REMOTE_FILE} -O $BOOT_JDK_LOCAL_FILE
|
||||
else
|
||||
echo "boot JDK \"$BOOT_JDK_LOCAL_FILE\" present, skipping download"
|
||||
fi
|
||||
|
||||
# Verify that what we've downloaded can be trusted.
|
||||
sha256sum -c - <<EOF
|
||||
$BOOT_JDK_SHA *$BOOT_JDK_LOCAL_FILE
|
||||
EOF
|
||||
|
||||
docker build -t jetbrains/runtime:jbr21env_musl_aarch64 -f Dockerfile.musl_aarch64 .
|
||||
|
||||
# NB: the resulting container can (and should) be used without the network
|
||||
# connection (--network none) during build in order to reduce the chance
|
||||
|
||||
@@ -1,14 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euxo pipefail
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
# This script creates a Docker image suitable for building musl x64 variant
|
||||
# This script creates a Docker image suitable for building musl-x64 variant
|
||||
# of the JetBrains Runtime version 21.
|
||||
|
||||
docker build \
|
||||
--platform=linux/amd64 \
|
||||
-t registry.jetbrains.team/p/jbre/containers/alpine14_x64:latest \
|
||||
--no-cache \
|
||||
-f Dockerfile.alpine .
|
||||
BOOT_JDK_REMOTE_FILE=zulu20.32.11-ca-jdk20.0.2-linux_musl_x64.tar.gz
|
||||
BOOT_JDK_SHA=fca5081dd6da847fcd06f5b755e58edae22d6784f21b81bf73da2b538f842c07
|
||||
BOOT_JDK_LOCAL_FILE=boot_jdk_musl_amd64.tar.gz
|
||||
|
||||
if [ ! -f $BOOT_JDK_LOCAL_FILE ]; then
|
||||
# Obtain "boot JDK" from outside of the container.
|
||||
wget -nc https://cdn.azul.com/zulu/bin/${BOOT_JDK_REMOTE_FILE} -O $BOOT_JDK_LOCAL_FILE
|
||||
else
|
||||
echo "boot JDK \"$BOOT_JDK_LOCAL_FILE\" present, skipping download"
|
||||
fi
|
||||
|
||||
# Verify that what we've downloaded can be trusted.
|
||||
sha256sum -c - <<EOF
|
||||
$BOOT_JDK_SHA *$BOOT_JDK_LOCAL_FILE
|
||||
EOF
|
||||
|
||||
docker build -t jetbrains/runtime:jbr21env_musl_x64 -f Dockerfile.musl_x64 .
|
||||
|
||||
# NB: the resulting container can (and should) be used without the network
|
||||
# connection (--network none) during build in order to reduce the chance
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
# This script creates a Docker image suitable for building x64 variant
|
||||
|
||||
docker build \
|
||||
--platform=linux/amd64 \
|
||||
-t registry.jetbrains.team/p/jbre/containers/oraclelinux8_x64:latest \
|
||||
--no-cache \
|
||||
-f Dockerfile.oraclelinux .
|
||||
|
||||
|
||||
|
||||
# NB: the resulting container can (and should) be used without the network
|
||||
# connection (--network none) during build in order to reduce the chance
|
||||
# of build contamination.
|
||||
@@ -1,14 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euxo pipefail
|
||||
#!/bin/bash -x
|
||||
|
||||
# This script creates a Docker image suitable for building x86 variant
|
||||
# of the JetBrains Runtime version 17.
|
||||
|
||||
docker build \
|
||||
--platform=linux/i386 \
|
||||
-t registry.jetbrains.team/p/jbre/containers/ubuntu2004_x86:latest \
|
||||
--no-cache \
|
||||
-f Dockerfile.ubuntu.x86 .
|
||||
BOOT_JDK_REMOTE_FILE=zulu17.34.19-ca-jdk17.0.3-linux_i686.tar.gz
|
||||
BOOT_JDK_SHA=1c35c374ba0001e675d6e80819d5be900c4e141636d5e484992a8c550be14481
|
||||
BOOT_JDK_LOCAL_FILE=boot_jdk_x86.tar.gz
|
||||
|
||||
if [ ! -f $BOOT_JDK_LOCAL_FILE ]; then
|
||||
# Obtain "boot JDK" from outside of the container.
|
||||
wget -nc https://cdn.azul.com/zulu/bin/${BOOT_JDK_REMOTE_FILE} -O $BOOT_JDK_LOCAL_FILE
|
||||
else
|
||||
echo "boot JDK \"$BOOT_JDK_LOCAL_FILE\" present, skipping download"
|
||||
fi
|
||||
|
||||
# Verify that what we've downloaded can be trusted.
|
||||
sha256sum -c - <<EOF
|
||||
$BOOT_JDK_SHA *$BOOT_JDK_LOCAL_FILE
|
||||
EOF
|
||||
|
||||
docker build -t jetbrains/runtime:jbr17env_x86 -f Dockerfile.x86 .
|
||||
|
||||
# NB: the resulting container can (and should) be used without the network
|
||||
# connection (--network none) during build in order to reduce the chance
|
||||
|
||||
13
jb/project/idea-project-files/jetbrains.api.iml
Normal file
13
jb/project/idea-project-files/jetbrains.api.iml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$/src/jetbrains.api">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/jetbrains.api/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/jetbrains.api/templates" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/jdk.iml" filepath="$PROJECT_DIR$/.idea/jdk.iml" />
|
||||
###MODULE_IMLS###
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/jetbrains.api.iml" filepath="$PROJECT_DIR$/.idea/jetbrains.api.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/test.iml" filepath="$PROJECT_DIR$/.idea/test.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
|
||||
18
jb/project/tools/common/scripts/build-jbr-api.sh
Normal file
18
jb/project/tools/common/scripts/build-jbr-api.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin//bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# $1 - Boot JDK
|
||||
# $2 - JBR part of API version
|
||||
|
||||
cd "`dirname "$0"`/../../../../.."
|
||||
PWD="`pwd`"
|
||||
CONF="$PWD/build/jbr-api.conf"
|
||||
./configure --with-debug-level=release --with-boot-jdk=$1 || exit $?
|
||||
make jbr-api CONF=release MAKEOVERRIDES= "JBR_API_CONF_FILE=$CONF" JBR_API_JBR_VERSION=$2 || exit $?
|
||||
. $CONF || exit $?
|
||||
echo "##teamcity[buildNumber '$VERSION']"
|
||||
cp "$JAR" ./jbr-api-${VERSION}.jar || exit $?
|
||||
cp "$SOURCES_JAR" ./jbr-api-${VERSION}-sources.jar || exit $?
|
||||
echo "##teamcity[publishArtifacts '$PWD/jbr-api-${VERSION}.jar']"
|
||||
echo "##teamcity[publishArtifacts '$PWD/jbr-api-${VERSION}-sources.jar']"
|
||||
@@ -35,7 +35,6 @@ function do_configure {
|
||||
--with-version-opt=b"$build_number" \
|
||||
--with-boot-jdk="$BOOT_JDK" \
|
||||
--enable-cds=yes \
|
||||
--with-vulkan \
|
||||
$DISABLE_WARNINGS_AS_ERRORS \
|
||||
$STATIC_CONF_ARGS \
|
||||
$REPRODUCIBLE_BUILD_OPTS \
|
||||
@@ -64,7 +63,7 @@ function create_image_bundle {
|
||||
__cds_opt=''
|
||||
|
||||
if is_musl; then libc_type_suffix='musl-' ; fi
|
||||
__cds_opt="--generate-cds-archive"
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then __cds_opt="--generate-cds-archive"; fi
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}aarch64-${fastdebug_infix}b${build_number}
|
||||
@@ -87,7 +86,6 @@ function create_image_bundle {
|
||||
|
||||
# jmod does not preserve file permissions (JDK-8173610)
|
||||
[ -f "$IMAGES_DIR"/"$__root_dir"/lib/jcef_helper ] && chmod a+x "$IMAGES_DIR"/"$__root_dir"/lib/jcef_helper
|
||||
[ -f "$IMAGES_DIR"/"$__root_dir"/lib/cef_server ] && chmod a+x "$IMAGES_DIR"/"$__root_dir"/lib/cef_server
|
||||
|
||||
echo Creating "$JBR".tar.gz ...
|
||||
|
||||
@@ -163,7 +161,8 @@ if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-linux-${libc_type_suffix}test-aarch64-b${build_number}
|
||||
echo Creating "$JBRSDK_TEST" ...
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
|
||||
make test-image CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
make test-image jbr-api CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test"
|
||||
tar -pcf "$JBRSDK_TEST".tar -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
|
||||
gzip "$JBRSDK_TEST".tar || do_exit $?
|
||||
|
||||
@@ -42,7 +42,6 @@ function do_configure {
|
||||
--with-version-opt=b"$build_number" \
|
||||
--with-boot-jdk="$BOOT_JDK" \
|
||||
--enable-cds=yes \
|
||||
--with-vulkan \
|
||||
$LINUX_TARGET \
|
||||
$DISABLE_WARNINGS_AS_ERRORS \
|
||||
$STATIC_CONF_ARGS \
|
||||
@@ -72,7 +71,7 @@ function create_image_bundle {
|
||||
__cds_opt=''
|
||||
|
||||
if is_musl; then libc_type_suffix='musl-' ; fi
|
||||
__cds_opt="--generate-cds-archive"
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then __cds_opt="--generate-cds-archive"; fi
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x64-${fastdebug_infix}b${build_number}
|
||||
@@ -95,7 +94,6 @@ function create_image_bundle {
|
||||
|
||||
# jmod does not preserve file permissions (JDK-8173610)
|
||||
[ -f "$IMAGES_DIR"/"$__root_dir"/lib/jcef_helper ] && chmod a+x "$IMAGES_DIR"/"$__root_dir"/lib/jcef_helper
|
||||
[ -f "$IMAGES_DIR"/"$__root_dir"/lib/cef_server ] && chmod a+x "$IMAGES_DIR"/"$__root_dir"/lib/cef_server
|
||||
|
||||
echo Creating "$JBR".tar.gz ...
|
||||
|
||||
@@ -171,7 +169,8 @@ if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-linux-${libc_type_suffix}test-x64-b${build_number}
|
||||
echo Creating "$JBRSDK_TEST" ...
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
|
||||
make test-image CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
make test-image jbr-api CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test"
|
||||
tar -pcf "$JBRSDK_TEST".tar -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
|
||||
gzip "$JBRSDK_TEST".tar || do_exit $?
|
||||
|
||||
@@ -51,7 +51,7 @@ function create_image_bundle {
|
||||
__cds_opt=''
|
||||
|
||||
if is_musl; then libc_type_suffix='musl-' ; fi
|
||||
__cds_opt="--generate-cds-archive"
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then __cds_opt="--generate-cds-archive"; fi
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
JBR=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x86-${fastdebug_infix}b${build_number}
|
||||
@@ -137,7 +137,8 @@ if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-linux-${libc_type_suffix}test-x86-b${build_number}
|
||||
echo Creating "$JBRSDK_TEST" ...
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
|
||||
make test-image CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
make test-image jbr-api CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test"
|
||||
tar -pcf "$JBRSDK_TEST".tar -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
|
||||
gzip "$JBRSDK_TEST".tar || do_exit $?
|
||||
|
||||
@@ -34,23 +34,7 @@ else
|
||||
contentType=$(jetSignContentType "$pathToBeSigned")
|
||||
(
|
||||
cd "$workDir" || exit 1
|
||||
|
||||
max_attempts=3
|
||||
attempt=1
|
||||
while [ $attempt -le $max_attempts ]; do
|
||||
if "$JETSIGN_CLIENT" -log-format text -max-wait 1m -denoted-content-type "$contentType" -extensions "$jetSignExtensions" "$pathToBeSigned"; then
|
||||
break
|
||||
else
|
||||
if [ $attempt -eq $max_attempts ]; then
|
||||
echo "Failed to sign after $max_attempts attempts"
|
||||
exit 1
|
||||
fi
|
||||
echo "Attempt $attempt failed, retrying in 5 seconds..."
|
||||
sleep 5
|
||||
((attempt++))
|
||||
fi
|
||||
done
|
||||
|
||||
"$JETSIGN_CLIENT" -log-format text -denoted-content-type "$contentType" -extensions "$jetSignExtensions" "$pathToBeSigned"
|
||||
# SRE-1223 (Codesign removes execute bits in executable files) workaround
|
||||
chmod "$(stat -f %A "$pathToBeSigned")" "$pathSigned"
|
||||
if isMacOsBinary "$pathSigned"; then
|
||||
|
||||
@@ -53,7 +53,7 @@ function create_image_bundle {
|
||||
|
||||
fastdebug_infix=''
|
||||
__cds_opt=''
|
||||
__cds_opt="--generate-cds-archive"
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then __cds_opt="--generate-cds-archive"; fi
|
||||
|
||||
tmp=.bundle.$$.tmp
|
||||
mkdir "$tmp" || do_exit $?
|
||||
@@ -160,7 +160,8 @@ if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-osx-test-${architecture}-b${build_number}
|
||||
echo Creating "$JBRSDK_TEST" ...
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
|
||||
make test-image CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
make test-image jbr-api CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test"
|
||||
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
|
||||
COPYFILE_DISABLE=1 tar -pczf "$JBRSDK_TEST".tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
|
||||
@@ -30,34 +30,11 @@ trap "rm -f \"$PWD/tmp_key\"" INT EXIT RETURN
|
||||
echo -n "${APPLE_PRIVATE_KEY}" > tmp_key
|
||||
|
||||
log "Notarizing $APP_PATH..."
|
||||
xcrun notarytool submit --key tmp_key --key-id "${APPLE_KEY_ID}" --issuer "${APPLE_ISSUER_ID}" "$APP_PATH" 2>&1 --wait| tee "notarytool.submit.out"
|
||||
xcrun notarytool submit --key tmp_key --key-id "${APPLE_KEY_ID}" --issuer "${APPLE_ISSUER_ID}" "$APP_PATH" 2>&1 | tee "notarytool.submit.out"
|
||||
REQUEST_ID="$(grep -e " id: " "notarytool.submit.out" | grep -oE '([0-9a-f-]{36})'| head -n1)"
|
||||
|
||||
waitOutput=$(xcrun notarytool wait "$REQUEST_ID" --key tmp_key --key-id "${APPLE_KEY_ID}" --issuer "${APPLE_ISSUER_ID}" --timeout 6h)
|
||||
if [ $? -ne 0 ]; then
|
||||
log "Notarizing failed (wait command)"
|
||||
echo "$waitOutput"
|
||||
exit 1
|
||||
else
|
||||
echo "$waitOutput"
|
||||
fi
|
||||
|
||||
logOutout=$(xcrun notarytool log "$REQUEST_ID" --key tmp_key --key-id "${APPLE_KEY_ID}" --issuer "${APPLE_ISSUER_ID}" developer_log.json)
|
||||
if [ $? -ne 0 ]; then
|
||||
log "Notarizing failed (log command)"
|
||||
echo "$logOutout"
|
||||
exit 1
|
||||
else
|
||||
echo "$logOutout"
|
||||
fi
|
||||
|
||||
infoOUtput=$(xcrun notarytool info "$REQUEST_ID" --key tmp_key --key-id "${APPLE_KEY_ID}" --issuer "${APPLE_ISSUER_ID}")
|
||||
if [ $? -ne 0 ]; then
|
||||
log "Notarizing failed (info command)"
|
||||
echo "$infoOUtput"
|
||||
exit 1
|
||||
else
|
||||
echo "$infoOUtput"
|
||||
fi
|
||||
xcrun notarytool wait "$REQUEST_ID" --key tmp_key --key-id "${APPLE_KEY_ID}" --issuer "${APPLE_ISSUER_ID}" --timeout 6h ||:
|
||||
xcrun notarytool log "$REQUEST_ID" --key tmp_key --key-id "${APPLE_KEY_ID}" --issuer "${APPLE_ISSUER_ID}" developer_log.json ||:
|
||||
xcrun notarytool info "$REQUEST_ID" --key tmp_key --key-id "${APPLE_KEY_ID}" --issuer "${APPLE_ISSUER_ID}"
|
||||
|
||||
log "Notarizing finished"
|
||||
|
||||
@@ -49,54 +49,12 @@ for f in \
|
||||
if [ -d "$APPLICATION_PATH/$f" ]; then
|
||||
find "$APPLICATION_PATH/$f" \
|
||||
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "*.tbd" -o -name "*.node" -o -perm +111 \) \
|
||||
-exec sh -c '"$1" --timestamp -v -s "$2" --options=runtime --force --entitlements "$3" "$4" || exit 1' sh "$SIGN_UTILITY" "$JB_DEVELOPER_CERT" "$SCRIPT_DIR/entitlements.xml" {} \;
|
||||
-exec "$SIGN_UTILITY" --timestamp \
|
||||
-v -s "$JB_DEVELOPER_CERT" --options=runtime --force \
|
||||
--entitlements "$SCRIPT_DIR/entitlements.xml" {} \;
|
||||
fi
|
||||
done
|
||||
|
||||
log "Signing jmod files"
|
||||
JMODS_DIR="$APPLICATION_PATH/Contents/Home/jmods"
|
||||
JMOD_EXE="$APPLICATION_PATH/Contents/Home/bin/jmod"
|
||||
if [ -d "$JMODS_DIR" ]; then
|
||||
for jmod_file in "$JMODS_DIR"/*.jmod; do
|
||||
log "Processing $jmod_file"
|
||||
|
||||
TMP_DIR="$JMODS_DIR/tmp"
|
||||
rm -rf "$TMP_DIR"
|
||||
mkdir "$TMP_DIR"
|
||||
|
||||
log "Unzipping $jmod_file"
|
||||
$JMOD_EXE extract --dir "$TMP_DIR" "$jmod_file" >/dev/null
|
||||
log "Removing $jmod_file"
|
||||
rm -f "$jmod_file"
|
||||
|
||||
log "Signing dylibs in $TMP_DIR"
|
||||
find "$TMP_DIR" \
|
||||
-type f \( -name "*.dylib" -o -name "*.so" -o -perm +111 -o -name jarsigner -o -name jdeps -o -name jpackageapplauncher -o -name jspawnhelper -o -name jar -o -name javap -o -name jdeprscan -o -name jfr -o -name rmiregistry -o -name java -o -name jhsdb -o -name jstatd -o -name jstatd -o -name jpackage -o -name keytool -o -name jmod -o -name jlink -o -name jimage -o -name jstack -o -name jcmd -o -name jps -o -name jmap -o -name jstat -o -name jinfo -o -name jshell -o -name jwebserver -o -name javac -o -name serialver -o -name jrunscript -o -name jdb -o -name jconsole -o -name javadoc \) \
|
||||
-exec sh -c '"$1" --timestamp -v -s "$2" --options=runtime --force --entitlements "$3" "$4" || exit 1' sh "$SIGN_UTILITY" "$JB_DEVELOPER_CERT" "$SCRIPT_DIR/entitlements.xml" {} \;
|
||||
|
||||
cmd="$JMOD_EXE create --class-path $TMP_DIR/classes"
|
||||
|
||||
# Check each directory and add to the command if it exists
|
||||
[ -d "$TMP_DIR/bin" ] && cmd="$cmd --cmds $TMP_DIR/bin"
|
||||
[ -d "$TMP_DIR/conf" ] && cmd="$cmd --config $TMP_DIR/conf"
|
||||
[ -d "$TMP_DIR/lib" ] && cmd="$cmd --libs $TMP_DIR/lib"
|
||||
[ -d "$TMP_DIR/include" ] && cmd="$cmd --header-files $TMP_DIR/include"
|
||||
[ -d "$TMP_DIR/legal" ] && cmd="$cmd --legal-notices $TMP_DIR/legal"
|
||||
[ -d "$TMP_DIR/man" ] && cmd="$cmd --man-pages $TMP_DIR/man"
|
||||
|
||||
# Add the output file
|
||||
cmd="$cmd $jmod_file"
|
||||
|
||||
# Execute the command
|
||||
eval $cmd
|
||||
|
||||
log "Removing $TMP_DIR"
|
||||
rm -rf "$TMP_DIR"
|
||||
done
|
||||
else
|
||||
echo "Directory '$JMODS_DIR' does not exist. Skipping signing of jmod files."
|
||||
fi
|
||||
|
||||
log "Signing libraries in jars in $APPLICATION_PATH"
|
||||
|
||||
# todo: add set -euo pipefail; into the inner sh -c
|
||||
@@ -115,7 +73,10 @@ find "$APPLICATION_PATH" -name '*.jar' \
|
||||
|
||||
find jarfolder \
|
||||
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "*.tbd" -o -name "jattach" \) \
|
||||
-exec sh -c '"$1" --timestamp --force -v -s "$2" --options=runtime --entitlements "$3" "$4" || exit 1' sh "$SIGN_UTILITY" "$JB_DEVELOPER_CERT" "$SCRIPT_DIR/entitlements.xml" {} \;
|
||||
-exec "$SIGN_UTILITY" --timestamp \
|
||||
--force \
|
||||
-v -s "$JB_DEVELOPER_CERT" --options=runtime \
|
||||
--entitlements "$SCRIPT_DIR/entitlements.xml" {} \;
|
||||
|
||||
(cd jarfolder; zip -q -r -o -0 ../jar.jar .)
|
||||
mv jar.jar "$file"
|
||||
@@ -130,7 +91,9 @@ for f in \
|
||||
if [ -d "$APPLICATION_PATH/$f" ]; then
|
||||
find "$APPLICATION_PATH/$f" \
|
||||
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "*.tbd" -o -perm +111 \) \
|
||||
-exec sh -c '"$1" --timestamp -v -s "$2" --options=runtime --force --entitlements "$3" "$4" || exit 1' sh "$SIGN_UTILITY" "$JB_DEVELOPER_CERT" "$SCRIPT_DIR/entitlements.xml" {} \;
|
||||
-exec "$SIGN_UTILITY" --timestamp \
|
||||
-v -s "$JB_DEVELOPER_CERT" --options=runtime --force \
|
||||
--entitlements "$SCRIPT_DIR/entitlements.xml" {} \;
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -146,7 +109,7 @@ if [ "$JB_SIGN" = true ]; then for f in \
|
||||
"$SIGN_UTILITY" --timestamp \
|
||||
-v -s "$JB_DEVELOPER_CERT" --options=runtime \
|
||||
--force \
|
||||
--entitlements "$SCRIPT_DIR/entitlements.xml" tmp-to-sign.tar.gz || exit 1
|
||||
--entitlements "$SCRIPT_DIR/entitlements.xml" tmp-to-sign.tar.gz
|
||||
rm -rf "$line"
|
||||
tar -xzf tmp-to-sign.tar.gz --directory "$(dirname "$line")"
|
||||
rm -f tmp-to-sign.tar.gz
|
||||
@@ -172,7 +135,7 @@ if [ "$JB_SIGN" = true ]; then
|
||||
"$SIGN_UTILITY" --timestamp \
|
||||
-v -s "$JB_DEVELOPER_CERT" --options=runtime \
|
||||
--force \
|
||||
--entitlements "$SCRIPT_DIR/entitlements.xml" tmp-to-sign.tar.gz || exit 1
|
||||
--entitlements "$SCRIPT_DIR/entitlements.xml" tmp-to-sign.tar.gz
|
||||
rm -rf "$APPLICATION_PATH"
|
||||
tar -xzf tmp-to-sign.tar.gz --directory "$(dirname "$APPLICATION_PATH")"
|
||||
rm -f tmp-to-sign.tar.gz
|
||||
@@ -180,7 +143,7 @@ else
|
||||
"$SIGN_UTILITY" --timestamp \
|
||||
-v -s "$JB_DEVELOPER_CERT" --options=runtime \
|
||||
--force \
|
||||
--entitlements "$SCRIPT_DIR/entitlements.xml" "$APPLICATION_PATH" || exit 1
|
||||
--entitlements "$SCRIPT_DIR/entitlements.xml" "$APPLICATION_PATH"
|
||||
fi
|
||||
|
||||
BUILD_NAME="$(basename "$APPLICATION_PATH")"
|
||||
|
||||
@@ -38,6 +38,9 @@ BUILD_NAME="$(ls "$EXPLODED")"
|
||||
#sed -i '' s/BNDL/APPL/ $EXPLODED/$BUILD_NAME/Contents/Info.plist
|
||||
rm -f $EXPLODED/$BUILD_NAME/Contents/CodeResources
|
||||
rm "$INPUT_FILE"
|
||||
if test -d $EXPLODED/$BUILD_NAME/Contents/Home/jmods; then
|
||||
mv $EXPLODED/$BUILD_NAME/Contents/Home/jmods $BACKUP_JMODS
|
||||
fi
|
||||
|
||||
log "$INPUT_FILE extracted and removed"
|
||||
|
||||
@@ -105,37 +108,9 @@ set -e
|
||||
if [ "$NOTARIZE" = "yes" ]; then
|
||||
log "Notarizing..."
|
||||
"$SCRIPT_DIR/notarize.sh" "$PKG_NAME"
|
||||
|
||||
log "Stapling..."
|
||||
appStaplerOutput=$(xcrun stapler staple "$APPLICATION_PATH")
|
||||
if [ $? -ne 0 ]; then
|
||||
log "Stapling application failed"
|
||||
echo "$appStaplerOutput"
|
||||
exit 1
|
||||
else
|
||||
echo "$appStaplerOutput"
|
||||
fi
|
||||
|
||||
log "Stapling package..."
|
||||
pkgStaplerOutput=$(xcrun stapler staple "$PKG_NAME")
|
||||
if [ $? -ne 0 ]; then
|
||||
log "Stapling package failed"
|
||||
echo "$pkgStaplerOutput"
|
||||
exit 1
|
||||
else
|
||||
echo "$pkgStaplerOutput"
|
||||
fi
|
||||
|
||||
# Verify stapling
|
||||
log "Verifying stapling..."
|
||||
if ! stapler validate "$APPLICATION_PATH"; then
|
||||
log "Stapling verification failed for application"
|
||||
exit 1
|
||||
fi
|
||||
if ! stapler validate "$PKG_NAME"; then
|
||||
log "Stapling verification failed for package"
|
||||
exit 1
|
||||
fi
|
||||
xcrun stapler staple "$APPLICATION_PATH" ||:
|
||||
xcrun stapler staple "$PKG_NAME" ||:
|
||||
else
|
||||
log "Notarization disabled"
|
||||
log "Stapling disabled"
|
||||
@@ -143,6 +118,11 @@ fi
|
||||
|
||||
log "Zipping $BUILD_NAME to $INPUT_FILE ..."
|
||||
(
|
||||
#cd "$EXPLODED"
|
||||
#ditto -c -k --sequesterRsrc --keepParent "$BUILD_NAME" "../$INPUT_FILE"
|
||||
if test -d $BACKUP_JMODS/jmods; then
|
||||
mv $BACKUP_JMODS/jmods $APPLICATION_PATH/Contents/Home
|
||||
fi
|
||||
if [[ "$APPLICATION_PATH" != "$EXPLODED/$BUILD_NAME" ]]; then
|
||||
mv $APPLICATION_PATH $EXPLODED/$BUILD_NAME
|
||||
else
|
||||
@@ -153,4 +133,4 @@ log "Zipping $BUILD_NAME to $INPUT_FILE ..."
|
||||
log "Finished zipping"
|
||||
)
|
||||
rm -rf "$EXPLODED"
|
||||
log "Done"
|
||||
log "Done"
|
||||
@@ -104,13 +104,13 @@ esac
|
||||
if [ -z "${INC_BUILD:-}" ]; then
|
||||
do_configure || do_exit $?
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
|
||||
fi
|
||||
else
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME images || do_exit $?
|
||||
fi
|
||||
|
||||
@@ -54,7 +54,7 @@ function create_image_bundle {
|
||||
|
||||
fastdebug_infix=''
|
||||
__cds_opt=''
|
||||
__cds_opt="--generate-cds-archive"
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then __cds_opt="--generate-cds-archive"; fi
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x64-${fastdebug_infix}b${build_number}
|
||||
@@ -97,13 +97,13 @@ esac
|
||||
if [ -z "${INC_BUILD:-}" ]; then
|
||||
do_configure || do_exit $?
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
|
||||
fi
|
||||
else
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME images || do_exit $?
|
||||
fi
|
||||
|
||||
@@ -50,7 +50,7 @@ function create_image_bundle {
|
||||
|
||||
fastdebug_infix=''
|
||||
__cds_opt=''
|
||||
__cds_opt="--generate-cds-archive"
|
||||
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then __cds_opt="--generate-cds-archive"; fi
|
||||
|
||||
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x86-${fastdebug_infix}b${build_number}
|
||||
@@ -92,13 +92,13 @@ esac
|
||||
if [ -z "${INC_BUILD:-}" ]; then
|
||||
do_configure || do_exit $?
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
|
||||
fi
|
||||
else
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME images || do_exit $?
|
||||
fi
|
||||
|
||||
@@ -29,11 +29,8 @@ function pack_jbr {
|
||||
__root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-aarch64-${fastdebug_infix}b${build_number}
|
||||
|
||||
echo Creating $JBR.tar.gz ...
|
||||
chmod -R ug+rwx,o+rx ${BASE_DIR}/$__root_dir
|
||||
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR $__root_dir || do_exit $?
|
||||
|
||||
echo Creating $JBR.zip ...
|
||||
/usr/bin/zip -r $JBR.zip $__root_dir || do_exit $?
|
||||
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR $__root_dir || do_exit $?
|
||||
}
|
||||
|
||||
[ "$bundle_type" == "nomod" ] && bundle_type=""
|
||||
@@ -54,6 +51,7 @@ pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
|
||||
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=$JBRSDK_BUNDLE-$JBSDK_VERSION-windows-test-aarch64-b$build_number
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test" || do_exit $?
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
@@ -31,9 +31,6 @@ function pack_jbr {
|
||||
echo Creating $JBR.tar.gz ...
|
||||
chmod -R ug+rwx,o+rx ${BASE_DIR}/$__root_dir
|
||||
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR $__root_dir || do_exit $?
|
||||
|
||||
echo Creating $JBR.zip ...
|
||||
/usr/bin/zip -r $JBR.zip $__root_dir || do_exit $?
|
||||
}
|
||||
|
||||
[ "$bundle_type" == "nomod" ] && bundle_type=""
|
||||
@@ -54,6 +51,7 @@ pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
|
||||
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=$JBRSDK_BUNDLE-$JBSDK_VERSION-windows-test-x64-b$build_number
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test" || do_exit $?
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
@@ -27,9 +27,6 @@ function pack_jbr {
|
||||
echo Creating $JBR.tar.gz ...
|
||||
chmod -R ug+rwx,o+rx ${BASE_DIR}/$__root_dir
|
||||
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR $__root_dir || do_exit $?
|
||||
|
||||
echo Creating $JBR.zip ...
|
||||
/usr/bin/zip -r $JBR.zip $__root_dir || do_exit $?
|
||||
}
|
||||
|
||||
[ "$bundle_type" == "nomod" ] && bundle_type=""
|
||||
@@ -50,6 +47,7 @@ pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
|
||||
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=$JBRSDK_BUNDLE-$JBSDK_VERSION-windows-test-x86-b$build_number
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test" || do_exit $?
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $BASE_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
@@ -100,7 +100,6 @@ $(eval $(call SetupJavaCompilation, $(MODULE), \
|
||||
BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules), \
|
||||
HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
|
||||
CREATE_API_DIGEST := true, \
|
||||
PROCESS_JBR_API := true, \
|
||||
CLEAN := $(CLEAN), \
|
||||
CLEAN_FILES := $(CLEAN_FILES), \
|
||||
COPY := $(COPY), \
|
||||
|
||||
@@ -84,7 +84,7 @@ $(eval $(call SetupJavaCompilation, COMPILE_DEPEND, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
|
||||
SRC := $(TOPDIR)/make/jdk/src/classes, \
|
||||
INCLUDES := build/tools/depend, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/plugins, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/depend, \
|
||||
DISABLED_WARNINGS := options, \
|
||||
JAVAC_FLAGS := \
|
||||
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
|
||||
@@ -97,21 +97,13 @@ $(eval $(call SetupJavaCompilation, COMPILE_DEPEND, \
|
||||
--add-exports jdk.internal.opt/jdk.internal.opt=jdk.javadoc.interim, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupJavaCompilation, COMPILE_JBR_API_PLUGIN, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
|
||||
SRC := $(TOPDIR)/make/jdk/src/classes, \
|
||||
INCLUDES := build/tools/jbrapi, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/plugins, \
|
||||
))
|
||||
DEPEND_SERVICE_PROVIDER := $(BUILDTOOLS_OUTPUTDIR)/depend/META-INF/services/com.sun.source.util.Plugin
|
||||
|
||||
PLUGINS_SERVICE_PROVIDER := $(BUILDTOOLS_OUTPUTDIR)/plugins/META-INF/services/com.sun.source.util.Plugin
|
||||
|
||||
$(PLUGINS_SERVICE_PROVIDER):
|
||||
$(call MakeDir, $(BUILDTOOLS_OUTPUTDIR)/plugins/META-INF/services)
|
||||
$(DEPEND_SERVICE_PROVIDER):
|
||||
$(call MakeDir, $(BUILDTOOLS_OUTPUTDIR)/depend/META-INF/services)
|
||||
$(ECHO) build.tools.depend.Depend > $@
|
||||
$(ECHO) build.tools.jbrapi.JBRApiPlugin >> $@
|
||||
|
||||
TARGETS += $(COMPILE_DEPEND) $(COMPILE_JBR_API_PLUGIN) $(PLUGINS_SERVICE_PROVIDER)
|
||||
TARGETS += $(COMPILE_DEPEND) $(DEPEND_SERVICE_PROVIDER)
|
||||
|
||||
################################################################################
|
||||
|
||||
|
||||
100
make/JBRApi.gmk
100
make/JBRApi.gmk
@@ -25,49 +25,69 @@
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include Utils.gmk
|
||||
include JavaCompilation.gmk
|
||||
|
||||
JBR_API_ORIGIN := https://github.com/JetBrains/JetBrainsRuntimeApi.git
|
||||
JBR_API_DIR := $(TOPDIR)/jbr-api
|
||||
JBR_API_ROOT_DIR := $(TOPDIR)/src/jetbrains.api
|
||||
JBR_API_TOOLS_DIR := $(JBR_API_ROOT_DIR)/tools
|
||||
JBR_API_SRC_DIR := $(JBR_API_ROOT_DIR)/src
|
||||
JBR_API_OUTPUT_DIR := $(OUTPUTDIR)/jbr-api
|
||||
JBR_API_GENSRC_DIR := $(JBR_API_OUTPUT_DIR)/gensrc
|
||||
JBR_API_BIN_DIR := $(JBR_API_OUTPUT_DIR)/bin
|
||||
JBR_API_VERSION_PROPERTIES := $(JBR_API_ROOT_DIR)/version.properties
|
||||
JBR_API_VERSION_GENSRC := $(JBR_API_OUTPUT_DIR)/jbr-api.version
|
||||
JBR_API_GENSRC_BATCH := $(JBR_API_VERSION_GENSRC)
|
||||
|
||||
ARTIFACT_NAME := jbr-api-SNAPSHOT
|
||||
ifeq ($(call isBuildOsEnv, windows.cygwin windows.msys2), true)
|
||||
HOME := $$USERPROFILE
|
||||
M2_REPO := $(shell $(PATHTOOL) $(HOME))/.m2/repository
|
||||
else ifeq ($(call isBuildOsEnv, windows.wsl1 windows.wsl2), true)
|
||||
HOME := `cmd.exe /C "echo %USERPROFILE%" 2> /dev/null`
|
||||
M2_REPO := $(shell $(PATHTOOL) $(HOME))/.m2/repository
|
||||
JBR_API_SRC_FILES := $(call FindFiles, $(JBR_API_SRC_DIR))
|
||||
JBR_API_GENSRC_FILES := $(foreach f, $(call FindFiles, $(JBR_API_SRC_DIR)), \
|
||||
$(JBR_API_GENSRC_DIR)/$(call RelativePath, $f, $(JBR_API_SRC_DIR)))
|
||||
|
||||
ifeq ($(JBR_API_JBR_VERSION),)
|
||||
JBR_API_JBR_VERSION := DEVELOPMENT
|
||||
JBR_API_FAIL_ON_HASH_MISMATCH := false
|
||||
else
|
||||
M2_REPO := $(HOME)/.m2/repository
|
||||
.PHONY: $(JBR_API_VERSION_PROPERTIES)
|
||||
JBR_API_FAIL_ON_HASH_MISMATCH := true
|
||||
endif
|
||||
M2_ARTIFACT := $(M2_REPO)/com/jetbrains/jbr-api/SNAPSHOT
|
||||
M2_POM_CONTENT := \
|
||||
<?xml version="1.0" encoding="UTF-8"?> \
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" \
|
||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> \
|
||||
<modelVersion>4.0.0</modelVersion> \
|
||||
<groupId>com.jetbrains</groupId> \
|
||||
<artifactId>jbr-api</artifactId> \
|
||||
<version>SNAPSHOT</version> \
|
||||
</project> \
|
||||
|
||||
jbr-api:
|
||||
if [ -d "$(JBR_API_DIR)" ]; then \
|
||||
$(GIT) -C "$(JBR_API_DIR)" fetch; \
|
||||
$(GIT) -C "$(JBR_API_DIR)" merge-base --is-ancestor origin/main HEAD || \
|
||||
$(ECHO) "!!! Current JBR API revision is outdated, update the branch in $(JBR_API_DIR) !!!"; \
|
||||
else \
|
||||
$(ECHO) "JBR API directory does not exist. Initializing..."; \
|
||||
$(GIT) clone "$(JBR_API_ORIGIN)" "$(JBR_API_DIR)" --config core.autocrlf=false; \
|
||||
fi
|
||||
$(BASH) "$(JBR_API_DIR)/tools/build.sh" dev "$(BOOT_JDK)"
|
||||
if [ -d "$(M2_REPO)" ]; then \
|
||||
$(MKDIR) -p $(M2_ARTIFACT); \
|
||||
$(ECHO) "$(M2_POM_CONTENT)" > $(M2_ARTIFACT)/$(ARTIFACT_NAME).pom; \
|
||||
$(CP) "$(JBR_API_DIR)/out/$(ARTIFACT_NAME).jar" "$(M2_ARTIFACT)"; \
|
||||
$(ECHO) "Installed into local Maven repository as com.jetbrains:jbr-api:SNAPSHOT"; \
|
||||
else \
|
||||
$(ECHO) "No Maven repository found at $(M2_REPO) - skipping local installation"; \
|
||||
fi
|
||||
ARCHIVE_BUILD_JBR_API_BIN := $(JBR_API_BIN_DIR)
|
||||
$(eval $(call SetupJavaCompilation, BUILD_JBR_API, \
|
||||
SMALL_JAVA := true, \
|
||||
COMPILER := bootjdk, \
|
||||
SRC := $(JBR_API_GENSRC_DIR), \
|
||||
EXTRA_FILES := $(JBR_API_GENSRC_FILES), \
|
||||
BIN := $(JBR_API_BIN_DIR), \
|
||||
JAR := $(JBR_API_OUTPUT_DIR)/jbr-api.jar, \
|
||||
))
|
||||
|
||||
.PHONY: jbr-api
|
||||
$(eval $(call SetupJarArchive, BUILD_JBR_API_SOURCES_JAR, \
|
||||
DEPENDENCIES := $(JBR_API_GENSRC_FILES), \
|
||||
SRCS := $(JBR_API_GENSRC_DIR), \
|
||||
JAR := $(JBR_API_OUTPUT_DIR)/jbr-api-sources.jar, \
|
||||
SUFFIXES := .java, \
|
||||
BIN := $(JBR_API_BIN_DIR), \
|
||||
))
|
||||
|
||||
# Grouped targets may not be supported, so hack dependencies: sources -> version file -> generated sources
|
||||
$(JBR_API_VERSION_GENSRC): $(JBR_API_SRC_FILES) $(JBR_API_VERSION_PROPERTIES) $(JBR_API_TOOLS_DIR)/Gensrc.java
|
||||
$(ECHO) Generating sources for JBR API
|
||||
$(JAVA_CMD) $(JAVA_FLAGS_SMALL) "$(JBR_API_TOOLS_DIR)/Gensrc.java" \
|
||||
"$(TOPDIR)/src" "$(JBR_API_OUTPUT_DIR)" "$(JBR_API_JBR_VERSION)"
|
||||
$(JBR_API_GENSRC_FILES): $(JBR_API_VERSION_GENSRC)
|
||||
$(TOUCH) $@
|
||||
|
||||
jbr-api-check-version: $(JBR_API_GENSRC_FILES) $(JBR_API_VERSION_PROPERTIES)
|
||||
$(JAVA_CMD) $(JAVA_FLAGS_SMALL) "$(JBR_API_TOOLS_DIR)/CheckVersion.java" \
|
||||
"$(JBR_API_ROOT_DIR)" "$(JBR_API_GENSRC_DIR)" "$(JBR_API_FAIL_ON_HASH_MISMATCH)"
|
||||
|
||||
jbr-api: $(BUILD_JBR_API) $(BUILD_JBR_API_SOURCES_JAR) jbr-api-check-version
|
||||
|
||||
.PHONY: jbr-api jbr-api-check-version
|
||||
|
||||
ifneq ($(JBR_API_CONF_FILE),)
|
||||
$(JBR_API_CONF_FILE): $(JBR_API_GENSRC_FILES)
|
||||
$(ECHO) "VERSION=`$(CAT) $(JBR_API_VERSION_GENSRC)`" > $(JBR_API_CONF_FILE)
|
||||
$(ECHO) "JAR=$(JBR_API_OUTPUT_DIR)/jbr-api.jar" >> $(JBR_API_CONF_FILE)
|
||||
$(ECHO) "SOURCES_JAR=$(JBR_API_OUTPUT_DIR)/jbr-api-sources.jar" >> $(JBR_API_CONF_FILE)
|
||||
jbr-api: $(JBR_API_CONF_FILE)
|
||||
.PHONY: $(JBR_API_CONF_FILE)
|
||||
endif
|
||||
|
||||
@@ -313,11 +313,9 @@ AC_OUTPUT
|
||||
|
||||
# After AC_OUTPUT, we need to do final work
|
||||
CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK
|
||||
BASIC_POST_CONFIG_OUTPUT
|
||||
|
||||
# Finally output some useful information to the user
|
||||
HELP_PRINT_SUMMARY_AND_WARNINGS
|
||||
CUSTOM_SUMMARY_AND_WARNINGS_HOOK
|
||||
HELP_REPEAT_WARNINGS
|
||||
|
||||
# All output is done. Do the post-config output management.
|
||||
BASIC_POST_CONFIG_OUTPUT
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
# Setup flags for C/C++ compiler
|
||||
#
|
||||
|
||||
################################################################################
|
||||
###############################################################################
|
||||
#
|
||||
# How to compile shared libraries.
|
||||
#
|
||||
@@ -37,10 +37,7 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
# Default works for linux, might work on other platforms as well.
|
||||
SHARED_LIBRARY_FLAGS='-shared'
|
||||
# --disable-new-dtags forces use of RPATH instead of RUNPATH for rpaths.
|
||||
# This protects internal library dependencies within the JDK from being
|
||||
# overridden using LD_LIBRARY_PATH. See JDK-8326891 for more information.
|
||||
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1 -Wl,--disable-new-dtags'
|
||||
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
|
||||
SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
|
||||
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
|
||||
@@ -66,9 +63,6 @@ AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
|
||||
# Default works for linux, might work on other platforms as well.
|
||||
SHARED_LIBRARY_FLAGS='-shared'
|
||||
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
SET_EXECUTABLE_ORIGIN="$SET_EXECUTABLE_ORIGIN -Wl,--disable-new-dtags"
|
||||
fi
|
||||
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
|
||||
|
||||
@@ -128,11 +122,6 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
|
||||
# Add debug prefix map gcc system include paths, as they cause
|
||||
# non-deterministic debug paths depending on gcc path location.
|
||||
DEBUG_PREFIX_MAP_GCC_INCLUDE_PATHS
|
||||
|
||||
# Add debug prefix map for OUTPUTDIR to handle the scenario when
|
||||
# it is not located within WORKSPACE_ROOT
|
||||
outputdir_slash="${OUTPUTDIR%/}/"
|
||||
DEBUG_PREFIX_CFLAGS="$DEBUG_PREFIX_CFLAGS -fdebug-prefix-map=${outputdir_slash}="
|
||||
]
|
||||
)
|
||||
fi
|
||||
@@ -496,7 +485,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
CFLAGS_OS_DEF_JVM="-D_ALLBSD_SOURCE -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE"
|
||||
CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
CFLAGS_OS_DEF_JVM="-DAIX -D_LARGE_FILES"
|
||||
CFLAGS_OS_DEF_JVM="-DAIX"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xbsd; then
|
||||
CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
|
||||
@@ -190,17 +190,6 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
|
||||
fi
|
||||
AC_SUBST(INCLUDE_SA)
|
||||
|
||||
# Setup default CDS alignment. On platforms where one build may run on machines with different
|
||||
# page sizes, the JVM choses a compatible alignment to fit all possible page sizes. This slightly
|
||||
# increases archive size.
|
||||
# The only platform having this problem at the moment is Linux on aarch64, which may encounter
|
||||
# three different page sizes: 4K, 64K, and if run on Mac m1 hardware, 16K.
|
||||
COMPATIBLE_CDS_ALIGNMENT_DEFAULT=false
|
||||
if test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
|
||||
COMPATIBLE_CDS_ALIGNMENT_DEFAULT=true
|
||||
fi
|
||||
AC_SUBST(COMPATIBLE_CDS_ALIGNMENT_DEFAULT)
|
||||
|
||||
# Compress jars
|
||||
COMPRESS_JARS=false
|
||||
|
||||
@@ -525,15 +514,9 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_LEAK_SANITIZER],
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_UNDEFINED_BEHAVIOR_SANITIZER],
|
||||
[
|
||||
UTIL_ARG_WITH(NAME: additional-ubsan-checks, TYPE: string,
|
||||
DEFAULT: [],
|
||||
DESC: [Customizes the ubsan checks],
|
||||
OPTIONAL: true)
|
||||
|
||||
# GCC reports lots of likely false positives for stringop-truncation and format-overflow.
|
||||
# Silence them for now.
|
||||
UBSAN_CHECKS="-fsanitize=undefined -fsanitize=float-divide-by-zero -fno-sanitize=shift-base -fno-sanitize=alignment \
|
||||
$ADDITIONAL_UBSAN_CHECKS"
|
||||
UBSAN_CHECKS="-fsanitize=undefined -fsanitize=float-divide-by-zero -fno-sanitize=shift-base"
|
||||
UBSAN_CFLAGS="$UBSAN_CHECKS -Wno-stringop-truncation -Wno-format-overflow -fno-omit-frame-pointer -DUNDEFINED_BEHAVIOR_SANITIZER"
|
||||
UBSAN_LDFLAGS="$UBSAN_CHECKS"
|
||||
UTIL_ARG_ENABLE(NAME: ubsan, DEFAULT: false, RESULT: UBSAN_ENABLED,
|
||||
@@ -715,7 +698,7 @@ AC_DEFUN([JDKOPT_ENABLE_DISABLE_CDS_ARCHIVE],
|
||||
#
|
||||
AC_DEFUN([JDKOPT_ENABLE_DISABLE_COMPATIBLE_CDS_ALIGNMENT],
|
||||
[
|
||||
UTIL_ARG_ENABLE(NAME: compatible-cds-alignment, DEFAULT: $COMPATIBLE_CDS_ALIGNMENT_DEFAULT,
|
||||
UTIL_ARG_ENABLE(NAME: compatible-cds-alignment, DEFAULT: false,
|
||||
RESULT: ENABLE_COMPATIBLE_CDS_ALIGNMENT,
|
||||
DESC: [enable use alternative compatible cds core region alignment],
|
||||
DEFAULT_DESC: [disabled],
|
||||
|
||||
@@ -70,25 +70,6 @@ AC_DEFUN_ONCE([LIB_SETUP_ALSA],
|
||||
PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no])
|
||||
fi
|
||||
fi
|
||||
if test "x$ALSA_FOUND" = xno; then
|
||||
# If we have sysroot set, and no explicit library location is set,
|
||||
# look at known locations in sysroot.
|
||||
if test "x$SYSROOT" != "x" && test "x${with_alsa_lib}" == x; then
|
||||
if test -f "$SYSROOT/usr/lib64/libasound.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
ALSA_LIBS="-L$SYSROOT/usr/lib64 -lasound"
|
||||
ALSA_FOUND=yes
|
||||
elif test -f "$SYSROOT/usr/lib/libasound.so"; then
|
||||
ALSA_LIBS="-L$SYSROOT/usr/lib -lasound"
|
||||
ALSA_FOUND=yes
|
||||
elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libasound.so"; then
|
||||
ALSA_LIBS="-L$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI -lasound"
|
||||
ALSA_FOUND=yes
|
||||
elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libasound.so"; then
|
||||
ALSA_LIBS="-L$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI -lasound"
|
||||
ALSA_FOUND=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "x$ALSA_FOUND" = xno; then
|
||||
AC_CHECK_HEADERS([alsa/asoundlib.h],
|
||||
[
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2024, JetBrains s.r.o.. 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.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Check if a potential dbus library match is correct and usable
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_DBUS],
|
||||
[
|
||||
AC_ARG_WITH(dbus-includes, [AS_HELP_STRING([--with-dbus-includes],
|
||||
[specify include directories for the dbus files as list separated by space])])
|
||||
|
||||
if test "x$NEEDS_LIB_DBUS" = xfalse; then
|
||||
DBUS_CFLAGS=
|
||||
DBUS_FOUND=false
|
||||
else
|
||||
if test "x${with_dbus_includes}" != x; then
|
||||
DBUS_FOUND=true
|
||||
DBUS_CFLAGS=""
|
||||
for include in $with_dbus_includes; do
|
||||
DBUS_CFLAGS="${DBUS_CFLAGS}-I${include} "
|
||||
done
|
||||
else
|
||||
PKG_CHECK_MODULES(DBUS, dbus-1, [DBUS_FOUND=true], [
|
||||
DBUS_FOUND=false
|
||||
AC_MSG_NOTICE([Can't find dbus-1 library. This library is needed to use some features. You can install dbus-1 library or specify include directories manually by giving --with-dbus-includes option.])
|
||||
])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(DBUS_CFLAGS)
|
||||
AC_SUBST(DBUS_FOUND)
|
||||
])
|
||||
@@ -106,6 +106,9 @@ AC_DEFUN_ONCE([LIB_SETUP_WAYLAND],
|
||||
AC_ARG_WITH(vulkan-include, [AS_HELP_STRING([--with-vulkan-include],
|
||||
[specify directory for the vulkan include files ({with-vulkan-include}/vulkan/vulkan.h)])])
|
||||
|
||||
AC_ARG_WITH(vulkan-hpp, [AS_HELP_STRING([--with-vulkan-hpp],
|
||||
[specify directory for the vulkan-hpp include files ({with-vulkan-hpp}/vulkan/vulkan_raii.hpp)])])
|
||||
|
||||
AC_ARG_WITH(vulkan-shader-compiler, [AS_HELP_STRING([--with-vulkan-shader-compiler],
|
||||
[specify which shader compiler to use: glslc/glslangValidator])])
|
||||
|
||||
@@ -136,11 +139,27 @@ AC_DEFUN_ONCE([LIB_SETUP_WAYLAND],
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Can't find 'vulkan/vulkan.h' under '${with_vulkan_include}'])
|
||||
fi
|
||||
AC_MSG_CHECKING([for vulkan_raii.hpp])
|
||||
if test "x${with_vulkan_hpp}" != x; then
|
||||
VULKAN_FLAGS="-I${with_vulkan_hpp} ${VULKAN_FLAGS}"
|
||||
VULKAN_HPP_DIR=${with_vulkan_hpp}
|
||||
else
|
||||
VULKAN_HPP_DIR=${with_vulkan_include}
|
||||
fi
|
||||
if test -s "$VULKAN_HPP_DIR/vulkan/vulkan_raii.hpp"; then
|
||||
VULKAN_FOUND=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
VULKAN_FOUND=no
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Can't find 'vulkan/vulkan_raii.hpp' under '$VULKAN_HPP_DIR'])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_LANG_PUSH([C++])
|
||||
if test "x$VULKAN_FOUND" = xno; then
|
||||
# Check vulkan sdk location
|
||||
AC_CHECK_HEADERS([$VULKAN_SDK/include/vulkan/vulkan.h],
|
||||
AC_CHECK_HEADERS([$VULKAN_SDK/include/vulkan/vulkan.h $VULKAN_SDK/include/vulkan/vulkan_raii.hpp],
|
||||
[ VULKAN_FOUND=yes
|
||||
VULKAN_FLAGS="-DVK_USE_PLATFORM_WAYLAND_KHR -I${VULKAN_SDK}/include -DVULKAN_ENABLED"
|
||||
],
|
||||
@@ -150,13 +169,14 @@ AC_DEFUN_ONCE([LIB_SETUP_WAYLAND],
|
||||
|
||||
if test "x$VULKAN_FOUND" = xno; then
|
||||
# Check default /usr/include location
|
||||
AC_CHECK_HEADERS([vulkan/vulkan.h],
|
||||
AC_CHECK_HEADERS([vulkan/vulkan.h vulkan/vulkan_raii.hpp],
|
||||
[ VULKAN_FOUND=yes
|
||||
VULKAN_FLAGS="-DVK_USE_PLATFORM_WAYLAND_KHR -DVULKAN_ENABLED"
|
||||
],
|
||||
[ VULKAN_FOUND=no; break ]
|
||||
)
|
||||
fi
|
||||
AC_LANG_POP([C++])
|
||||
|
||||
if test "x$VULKAN_FOUND" = xno; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([vulkan])
|
||||
|
||||
@@ -71,9 +71,9 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
|
||||
elif test -f "$SYSROOT/usr/lib/libX11.so"; then
|
||||
x_libraries="$SYSROOT/usr/lib"
|
||||
elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so"; then
|
||||
x_libraries="$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI"
|
||||
x_libraries="$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so"
|
||||
elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so"; then
|
||||
x_libraries="$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI"
|
||||
x_libraries="$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -33,10 +33,11 @@ m4_include([lib-freetype.m4])
|
||||
m4_include([lib-hsdis.m4])
|
||||
m4_include([lib-std.m4])
|
||||
m4_include([lib-x11.m4])
|
||||
m4_include([lib-fontconfig.m4])
|
||||
m4_include([lib-speechd.m4])
|
||||
m4_include([lib-nvdacontrollerclient.m4])
|
||||
m4_include([lib-wayland.m4])
|
||||
m4_include([lib-dbus.m4])
|
||||
|
||||
m4_include([lib-tests.m4])
|
||||
|
||||
################################################################################
|
||||
@@ -52,9 +53,8 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
|
||||
NEEDS_LIB_WAYLAND=false
|
||||
SUPPORTS_LIB_VULKAN=false
|
||||
elif test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
|
||||
# All other instances need X11, even if building headless only, libawt still
|
||||
# needs X11 headers.
|
||||
NEEDS_LIB_X11=true
|
||||
# No X11 support needed when building headless only
|
||||
NEEDS_LIB_X11=false
|
||||
NEEDS_LIB_SPEECHD=false
|
||||
NEEDS_LIB_WAYLAND=false
|
||||
SUPPORTS_LIB_VULKAN=false
|
||||
@@ -90,13 +90,11 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
|
||||
NEEDS_LIB_FREETYPE=true
|
||||
fi
|
||||
|
||||
# Check if alsa and dbus is needed
|
||||
# Check if alsa is needed
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
NEEDS_LIB_ALSA=true
|
||||
NEEDS_LIB_DBUS=true
|
||||
else
|
||||
NEEDS_LIB_ALSA=false
|
||||
NEEDS_LIB_DBUS=false
|
||||
fi
|
||||
|
||||
# Check if ffi is needed
|
||||
@@ -154,7 +152,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
|
||||
LIB_SETUP_SPEECHD
|
||||
LIB_SETUP_NVDACONTROLLERCLIENT
|
||||
LIB_SETUP_WAYLAND
|
||||
LIB_SETUP_DBUS
|
||||
|
||||
LIB_TESTS_SETUP_GTEST
|
||||
|
||||
BASIC_JDKLIB_LIBS=""
|
||||
|
||||
@@ -467,10 +467,6 @@ UBSAN_LDFLAGS:=@UBSAN_LDFLAGS@
|
||||
X_CFLAGS:=@X_CFLAGS@
|
||||
X_LIBS:=@X_LIBS@
|
||||
|
||||
# Necessary additional compiler flags to compile dbus
|
||||
DBUS_CFLAGS := @DBUS_CFLAGS@
|
||||
DBUS_FOUND := @DBUS_FOUND@
|
||||
|
||||
# Linux speechd a11y announcer
|
||||
A11Y_SPEECHD_ANNOUNCING_ENABLED:=@A11Y_SPEECHD_ANNOUNCING_ENABLED@
|
||||
SPEECHD_CFLAGS:=@SPEECHD_CFLAGS@
|
||||
|
||||
@@ -168,7 +168,6 @@ endef
|
||||
# CREATE_API_DIGEST:=Set to true to use a javac plugin to generate a public API
|
||||
# hash which can be used for down stream dependencies to only rebuild
|
||||
# when the API changes.
|
||||
# PROCESS_JBR_API:=Set to true to use an annotation processor to generate JBR API bindings.
|
||||
# KEEP_ALL_TRANSLATIONS:=Set to true to skip translation filtering
|
||||
SetupJavaCompilation = $(NamedParamsMacroTemplate)
|
||||
define SetupJavaCompilationBody
|
||||
@@ -443,22 +442,13 @@ define SetupJavaCompilationBody
|
||||
|
||||
ifeq ($$($1_CREATE_API_DIGEST), true)
|
||||
$1_API_DIGEST_FLAGS := \
|
||||
-classpath $$(BUILDTOOLS_OUTPUTDIR)/depend \
|
||||
-Xplugin:"depend $$($1_API_TARGET)" \
|
||||
"-XDinternalAPIPath=$$($1_API_INTERNAL)" \
|
||||
"-XDLOG_LEVEL=$(LOG_LEVEL)" \
|
||||
#
|
||||
|
||||
$1_EXTRA_DEPS := $$($1_EXTRA_DEPS) $$(BUILDTOOLS_OUTPUTDIR)/plugins/_the.COMPILE_DEPEND_batch
|
||||
endif
|
||||
|
||||
ifeq ($$($1_PROCESS_JBR_API), true)
|
||||
# Automatic path conversion doesn't work for two arguments, so call fixpath manually
|
||||
$1_JBR_API_FLAGS := -Xplugin:"jbr-api $$(call FixPath, $$($1_BIN)/java.base/META-INF/jbrapi.registry) $$(call FixPath, $(TOPDIR)/jb/jbr-api.version)"
|
||||
$1_EXTRA_DEPS := $$($1_EXTRA_DEPS) $$(BUILDTOOLS_OUTPUTDIR)/plugins/_the.COMPILE_JBR_API_PLUGIN_batch
|
||||
endif
|
||||
|
||||
ifeq ($$(call Or, $$($1_CREATE_API_DIGEST) $$($1_PROCESS_JBR_API)), true)
|
||||
$1_PROCESSORPATH := -processorpath $$(BUILDTOOLS_OUTPUTDIR)/plugins
|
||||
$1_EXTRA_DEPS := $$(BUILDTOOLS_OUTPUTDIR)/depend/_the.COMPILE_DEPEND_batch
|
||||
endif
|
||||
|
||||
# Create a file with all sources, to pass to javac in an @file.
|
||||
@@ -497,7 +487,7 @@ define SetupJavaCompilationBody
|
||||
$$(call MakeDir, $$(@D))
|
||||
$$(call ExecuteWithLog, $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$$($1_SAFE_NAME)_batch, \
|
||||
$$($1_JAVAC_CMD) $$($1_FLAGS) \
|
||||
$$($1_PROCESSORPATH) $$($1_API_DIGEST_FLAGS) $$($1_JBR_API_FLAGS) \
|
||||
$$($1_API_DIGEST_FLAGS) \
|
||||
-XDmodifiedInputs=$$($1_MODFILELIST_FIXED) \
|
||||
-d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_FILELIST)) && \
|
||||
$(TOUCH) $$@
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2022, 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
|
||||
@@ -152,10 +152,6 @@ define SetupLogging
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
|
||||
SHELL := $$(SHELL) -x
|
||||
endif
|
||||
|
||||
ifeq ($$(LOG_LEVEL), trace)
|
||||
SHELL_NO_RECURSE := $$(SHELL)
|
||||
# Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
|
||||
|
||||
@@ -29,17 +29,17 @@ GTEST_VERSION=1.13.0
|
||||
JTREG_VERSION=7.3.1+1
|
||||
|
||||
LINUX_X64_BOOT_JDK_EXT=tar.gz
|
||||
LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U-jdk_x64_linux_hotspot_21.0.3_9.tar.gz
|
||||
LINUX_X64_BOOT_JDK_SHA256=fffa52c22d797b715a962e6c8d11ec7d79b90dd819b5bc51d62137ea4b22a340
|
||||
LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk20/bdc68b4b9cbc4ebcb30745c85038d91d/36/GPL/openjdk-20_linux-x64_bin.tar.gz
|
||||
LINUX_X64_BOOT_JDK_SHA256=bb863b2d542976d1ae4b7b81af3e78b1e4247a64644350b552d298d8dc5980dc
|
||||
|
||||
MACOS_X64_BOOT_JDK_EXT=tar.gz
|
||||
MACOS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U-jdk_x64_mac_hotspot_21.0.3_9.tar.gz
|
||||
MACOS_X64_BOOT_JDK_SHA256=f777103aab94330d14a29bd99f3a26d60abbab8e2c375cec9602746096721a7c
|
||||
MACOS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk20/bdc68b4b9cbc4ebcb30745c85038d91d/36/GPL/openjdk-20_macos-x64_bin.tar.gz
|
||||
MACOS_X64_BOOT_JDK_SHA256=47cf960d9bb89dbe987535a389f7e26c42de7c984ef5108612d77c81aa8cc6a4
|
||||
|
||||
MACOS_AARCH64_BOOT_JDK_EXT=tar.gz
|
||||
MACOS_AARCH64_BOOT_JDK_URL=https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U-jdk_aarch64_mac_hotspot_21.0.3_9.tar.gz
|
||||
MACOS_AARCH64_BOOT_JDK_SHA256=b6be6a9568be83695ec6b7cb977f4902f7be47d74494c290bc2a5c3c951e254f
|
||||
MACOS_AARCH64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk20/bdc68b4b9cbc4ebcb30745c85038d91d/36/GPL/openjdk-20_macos-aarch64_bin.tar.gz
|
||||
MACOS_AARCH64_BOOT_JDK_SHA256=d020f5c512c043cfb7119a591bc7e599a5bfd76d866d939f5562891d9db7c9b3
|
||||
|
||||
WINDOWS_X64_BOOT_JDK_EXT=zip
|
||||
WINDOWS_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U-jdk_x64_windows_hotspot_21.0.3_9.zip
|
||||
WINDOWS_X64_BOOT_JDK_SHA256=c43a66cff7a403d56c5c5e1ff10d3d5f95961abf80f97f0e35380594909f0e4d
|
||||
WINDOWS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk20/bdc68b4b9cbc4ebcb30745c85038d91d/36/GPL/openjdk-20_windows-x64_bin.zip
|
||||
WINDOWS_X64_BOOT_JDK_SHA256=c92fae5e42b9aecf444a66c8ec563c652f60b1e231dfdd33a4f5a3e3603058fb
|
||||
|
||||
@@ -28,12 +28,12 @@
|
||||
|
||||
DEFAULT_VERSION_FEATURE=21
|
||||
DEFAULT_VERSION_INTERIM=0
|
||||
DEFAULT_VERSION_UPDATE=5
|
||||
DEFAULT_VERSION_UPDATE=3
|
||||
DEFAULT_VERSION_PATCH=0
|
||||
DEFAULT_VERSION_EXTRA1=0
|
||||
DEFAULT_VERSION_EXTRA2=0
|
||||
DEFAULT_VERSION_EXTRA3=0
|
||||
DEFAULT_VERSION_DATE=2024-10-15
|
||||
DEFAULT_VERSION_DATE=2024-04-16
|
||||
DEFAULT_VERSION_CLASSFILE_MAJOR=65 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_CLASSFILE_MINOR=0
|
||||
DEFAULT_VERSION_DOCS_API_SINCE=11
|
||||
|
||||
@@ -708,7 +708,7 @@ CLDR data files are interpreted according to the LDML specification (http://unic
|
||||
<territory type="BS">𞤄𞤢𞤸𞤢𞤥𞤢𞥄𞤧</territory>
|
||||
<territory type="BT">𞤄𞤵𞥅𞤼𞤢𞥄𞤲</territory>
|
||||
<territory type="BV">𞤅𞤵𞤪𞤭𞥅𞤪𞤫 𞤄𞤵𞥅𞤾𞤫𞥅</territory>
|
||||
<territory type="BW">𞤄𞤮𞤼𞤧𞤵𞤱𞤢𞥄𞤲𞤢</territory>
|
||||
<territory type="BW">𞤄𞤮𞤼𞤧𞤵𞤱𞤢𞥄𞤲𞤢</territory>
|
||||
<territory type="BY">𞤄𞤫𞤤𞤢𞤪𞤵𞥅𞤧</territory>
|
||||
<territory type="BZ">𞤄𞤫𞤤𞤭𞥅𞥁</territory>
|
||||
<territory type="CA">𞤑𞤢𞤲𞤢𞤣𞤢𞥄</territory>
|
||||
@@ -8278,7 +8278,7 @@ CLDR data files are interpreted according to the LDML specification (http://unic
|
||||
<exemplarCity>𞤐𞤵𞥅𞤳</exemplarCity>
|
||||
</zone>
|
||||
<zone type="America/Scoresbysund">
|
||||
<exemplarCity>𞤋𞤼𞥆𞤮𞤳𞤮𞤪𞤼𞤮𞥅𞤪𞤥𞤭𞥅𞤼</exemplarCity>
|
||||
<exemplarCity>𞤋𞤼𞥆𞤮𞤳𞤮𞤪𞤼𞤮𞥅𞤪𞤥𞤭𞥅𞤼</exemplarCity>
|
||||
</zone>
|
||||
<zone type="America/Danmarkshavn">
|
||||
<exemplarCity>𞤁𞤢𞥄𞤲𞤥𞤢𞤪𞤳𞥃𞤢𞥄𞤾𞤲</exemplarCity>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash -e
|
||||
#
|
||||
# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -29,7 +29,6 @@
|
||||
JMH_VERSION=1.37
|
||||
COMMONS_MATH3_VERSION=3.6.1
|
||||
JOPT_SIMPLE_VERSION=5.0.4
|
||||
MAVEN_MIRROR=${MAVEN_MIRROR:-https://repo.maven.apache.org/maven2}
|
||||
|
||||
BUNDLE_NAME=jmh-$JMH_VERSION.tar.gz
|
||||
|
||||
@@ -42,9 +41,9 @@ cd $JAR_DIR
|
||||
rm -f *
|
||||
|
||||
fetchJar() {
|
||||
url="${MAVEN_MIRROR}/$1/$2/$3/$2-$3.jar"
|
||||
url="https://repo.maven.apache.org/maven2/$1/$2/$3/$2-$3.jar"
|
||||
if command -v curl > /dev/null; then
|
||||
curl -OL --fail $url
|
||||
curl -O --fail $url
|
||||
elif command -v wget > /dev/null; then
|
||||
wget $url
|
||||
else
|
||||
|
||||
@@ -51,7 +51,7 @@ ifeq ($(call check-jvm-feature, compiler2), true)
|
||||
endif
|
||||
|
||||
# Set the C++ standard
|
||||
ADLC_CFLAGS += $(ADLC_LANGSTD_CXXFLAGS)
|
||||
ADLC_CFLAGS += $(ADLC_LANGSTD_CXXFLAG)
|
||||
|
||||
# NOTE: The old build didn't set -DASSERT for windows but it doesn't seem to
|
||||
# hurt.
|
||||
|
||||
@@ -157,13 +157,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
|
||||
DISABLED_WARNINGS_gcc_ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp := nonnull, \
|
||||
DISABLED_WARNINGS_gcc_cgroupV1Subsystem_linux.cpp := address, \
|
||||
DISABLED_WARNINGS_gcc_cgroupV2Subsystem_linux.cpp := address, \
|
||||
DISABLED_WARNINGS_gcc_handshake.cpp := stringop-overflow, \
|
||||
DISABLED_WARNINGS_gcc_interp_masm_x86.cpp := uninitialized, \
|
||||
DISABLED_WARNINGS_gcc_jvmciCodeInstaller.cpp := stringop-overflow, \
|
||||
DISABLED_WARNINGS_gcc_jvmtiTagMap.cpp := stringop-overflow, \
|
||||
DISABLED_WARNINGS_gcc_postaloc.cpp := address, \
|
||||
DISABLED_WARNINGS_gcc_shenandoahLock.cpp := stringop-overflow, \
|
||||
DISABLED_WARNINGS_gcc_synchronizer.cpp := stringop-overflow, \
|
||||
DISABLED_WARNINGS_clang := $(DISABLED_WARNINGS_clang), \
|
||||
DISABLED_WARNINGS_clang_arguments.cpp := missing-field-initializers, \
|
||||
DISABLED_WARNINGS_clang_codeBuffer.cpp := tautological-undefined-compare, \
|
||||
|
||||
@@ -1,451 +0,0 @@
|
||||
package build.tools.jbrapi;
|
||||
|
||||
import com.sun.source.tree.CompilationUnitTree;
|
||||
import com.sun.source.tree.Tree;
|
||||
import com.sun.source.util.*;
|
||||
|
||||
import javax.lang.model.element.*;
|
||||
import javax.lang.model.type.ArrayType;
|
||||
import javax.lang.model.type.DeclaredType;
|
||||
import javax.lang.model.type.ExecutableType;
|
||||
import javax.lang.model.type.TypeMirror;
|
||||
import javax.lang.model.util.ElementScanner14;
|
||||
import javax.lang.model.util.Elements;
|
||||
import javax.lang.model.util.Types;
|
||||
import javax.tools.Diagnostic;
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.nio.channels.OverlappingFileLockException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.locks.LockSupport;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class JBRApiPlugin implements Plugin {
|
||||
|
||||
enum Binding {
|
||||
SERVICE,
|
||||
PROVIDES,
|
||||
PROVIDED,
|
||||
TWO_WAY
|
||||
}
|
||||
|
||||
record DiagnosticTree(CompilationUnitTree root, Tree tree) {}
|
||||
record TypeBinding(DiagnosticTree diagnostic, TypeElement element, String currentType, String bindType, Binding binding) {}
|
||||
record MethodBinding(DiagnosticTree diagnostic, ExecutableElement element, Registry.StaticDescriptor currentMethod, Registry.StaticMethod bindMethod) {}
|
||||
|
||||
final Map<String, TypeBinding> typeBindings = new HashMap<>();
|
||||
final List<MethodBinding> methodBindings = new ArrayList<>();
|
||||
Elements elements;
|
||||
Trees trees;
|
||||
Types types;
|
||||
|
||||
class Registry {
|
||||
|
||||
record Type(String type, Binding binding) {}
|
||||
record StaticMethod(String type, String name) {}
|
||||
record StaticDescriptor(StaticMethod method, String descriptor) {}
|
||||
|
||||
final Map<String, Type> types = new HashMap<>();
|
||||
final Map<StaticDescriptor, StaticMethod> methods = new HashMap<>();
|
||||
final Set<Object> internal = new HashSet<>();
|
||||
|
||||
void validateInternal(DiagnosticTree diagnostic, String currentType, Binding binding, TypeElement bindType) {
|
||||
if (bindType.getKind() != ElementKind.CLASS && bindType.getKind() != ElementKind.INTERFACE) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR, "Invalid JBR API binding:" + currentType + " -> " +
|
||||
bindType.getQualifiedName().toString() + " (not a class or interface)",
|
||||
diagnostic.tree, diagnostic.root);
|
||||
} else if (bindType.getModifiers().contains(Modifier.FINAL) || bindType.getModifiers().contains(Modifier.SEALED)) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR, "Invalid JBR API binding:" + currentType + " -> " +
|
||||
bindType.getQualifiedName().toString() + " (not inheritable)",
|
||||
diagnostic.tree, diagnostic.root);
|
||||
}
|
||||
if (binding != Binding.SERVICE) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR, "Invalid JBR API binding:" + currentType + " -> " +
|
||||
bindType.getQualifiedName().toString() + " (internal, non-service)",
|
||||
diagnostic.tree, diagnostic.root);
|
||||
}
|
||||
}
|
||||
|
||||
void validateInternalMethod(DiagnosticTree diagnostic, StaticDescriptor currentMethod, TypeElement bindType, String bindMethod) {
|
||||
boolean methodFound = false;
|
||||
for (Element m : bindType.getEnclosedElements()) {
|
||||
if (m.getKind() == ElementKind.METHOD &&
|
||||
!m.getModifiers().contains(Modifier.STATIC) &&
|
||||
!m.getModifiers().contains(Modifier.FINAL) &&
|
||||
m.getSimpleName().contentEquals(bindMethod) &&
|
||||
descriptor(m.asType()).equals(currentMethod.descriptor)) {
|
||||
methodFound = true;
|
||||
}
|
||||
}
|
||||
if (!methodFound) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR, "Invalid static binding: " +
|
||||
currentMethod.method.type + "#" + currentMethod.method.name + " -> " +
|
||||
bindType.getQualifiedName().toString() + "#" + bindMethod +
|
||||
" (no matching method found, type conversions are not allowed for internal bindings)",
|
||||
diagnostic.tree, diagnostic.root);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> addBindings() {
|
||||
List<String> unresolvedErrors = new ArrayList<>();
|
||||
List<TypeBinding> addedTypes = new ArrayList<>();
|
||||
List<MethodBinding> addedMethods = new ArrayList<>();
|
||||
Set<Object> validated = new HashSet<>();
|
||||
// Remove changed bindings.
|
||||
for (TypeBinding type : typeBindings.values()) {
|
||||
if (type.bindType != null) addedTypes.add(type);
|
||||
types.remove(type.currentType);
|
||||
}
|
||||
for (MethodBinding method : methodBindings) {
|
||||
if (method.bindMethod != null) addedMethods.add(method);
|
||||
methods.remove(method.currentMethod);
|
||||
}
|
||||
methods.entrySet().removeIf(m -> typeBindings.containsKey(m.getKey().method.type));
|
||||
// Build inverse binding map.
|
||||
Map<String, String> inverseTypes = types.entrySet().stream().collect(Collectors.toMap(
|
||||
e -> e.getValue().type, Map.Entry::getKey, (a, b) -> {
|
||||
unresolvedErrors.add("Conflicting JBR API binding: " + a + " and "+ b + " binds to the same type");
|
||||
return a + "," + b;
|
||||
}));
|
||||
Map<StaticDescriptor, StaticMethod> inverseMethods = methods.entrySet().stream().collect(Collectors.toMap(
|
||||
e -> new StaticDescriptor(e.getValue(), e.getKey().descriptor), e -> e.getKey().method, (a, b) -> {
|
||||
unresolvedErrors.add("Conflicting JBR API binding: " +
|
||||
a.type + "#" + a.name + " and "+ b.type + "#" + b.name + " binds to the same method");
|
||||
return new StaticMethod(a.type + "," + b.type, a.name + "," + b.name);
|
||||
}));
|
||||
// Add new bindings.
|
||||
for (TypeBinding type : addedTypes) types.put(type.currentType, new Type(type.bindType, type.binding));
|
||||
for (MethodBinding method : addedMethods) methods.put(method.currentMethod, method.bindMethod);
|
||||
// Validate type bindings.
|
||||
for (TypeBinding type : addedTypes) {
|
||||
String inv = inverseTypes.get(type.bindType);
|
||||
if (inv != null) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"Conflicting JBR API binding: " + type.currentType + " -> " + type.bindType + " <- " + inv,
|
||||
type.diagnostic.tree, type.diagnostic.root);
|
||||
inverseTypes.put(type.bindType, inv + "," + type.currentType);
|
||||
} else inverseTypes.put(type.bindType, type.currentType);
|
||||
Type next = types.get(type.bindType);
|
||||
if (next != null) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"Conflicting JBR API binding: " + type.currentType + " -> " + type.bindType + " -> " + next,
|
||||
type.diagnostic.tree, type.diagnostic.root);
|
||||
}
|
||||
String prev = inverseTypes.get(type.currentType);
|
||||
if (prev != null) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"Conflicting JBR API binding: " + prev + " -> " + type.currentType + " -> " + type.bindType,
|
||||
type.diagnostic.tree, type.diagnostic.root);
|
||||
}
|
||||
if (validated.add(type.currentType)) {
|
||||
TypeElement bindElement = elements.getTypeElement(type.bindType);
|
||||
if (bindElement != null) {
|
||||
internal.add(type.currentType);
|
||||
validateInternal(type.diagnostic, type.currentType, type.binding, bindElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Validate method bindings.
|
||||
for (MethodBinding method : addedMethods) {
|
||||
StaticDescriptor invDescriptor = new StaticDescriptor(method.bindMethod, method.currentMethod.descriptor);
|
||||
StaticMethod inv = inverseMethods.get(invDescriptor);
|
||||
if (inv != null) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR, "Conflicting JBR API binding: " +
|
||||
method.currentMethod.method.type + "#" + method.currentMethod.method.name + " -> " +
|
||||
method.bindMethod.type + "#" + method.bindMethod.name + " <- " +
|
||||
inv.type + "#" + inv.name,
|
||||
method.diagnostic.tree, method.diagnostic.root);
|
||||
inverseMethods.put(invDescriptor, new StaticMethod(
|
||||
inv.type + "," + method.currentMethod.method.type, inv.name + "," + method.currentMethod.method.name));
|
||||
} else inverseMethods.put(invDescriptor, method.currentMethod.method);
|
||||
if (validated.add(method.currentMethod)) {
|
||||
TypeElement bindElement = elements.getTypeElement(method.bindMethod.type);
|
||||
if (bindElement != null) {
|
||||
internal.add(method.currentMethod);
|
||||
validateInternalMethod(method.diagnostic, method.currentMethod, bindElement, method.bindMethod.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
// [Re]validate remaining.
|
||||
types.forEach((k, v) -> {
|
||||
if (validated.add(k)) {
|
||||
TypeBinding type = typeBindings.get(v.type);
|
||||
if (type != null) {
|
||||
internal.add(k);
|
||||
validateInternal(type.diagnostic, k, v.binding, type.element);
|
||||
} else if (elements.getTypeElement(v.type) != null) {
|
||||
internal.add(k); // Couldn't validate, but at least found the type.
|
||||
if (v.binding != Binding.SERVICE) {
|
||||
unresolvedErrors.add("Invalid JBR API binding:" + k + " -> " + v.type + " (internal, non-service)");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
methods.forEach((k, v) -> {
|
||||
if (validated.add(k)) {
|
||||
TypeBinding type = typeBindings.get(v.type);
|
||||
if (type != null) {
|
||||
internal.add(k);
|
||||
validateInternalMethod(type.diagnostic, k, type.element, v.name);
|
||||
} else if (elements.getTypeElement(v.type) != null) {
|
||||
internal.add(k); // Couldn't validate, but at least found the type.
|
||||
}
|
||||
}
|
||||
});
|
||||
return unresolvedErrors;
|
||||
}
|
||||
|
||||
void read(RandomAccessFile file) throws IOException {
|
||||
String s;
|
||||
while ((s = file.readLine()) != null) {
|
||||
String[] tokens = s.split(" ");
|
||||
switch (tokens[0]) {
|
||||
case "TYPE" -> {
|
||||
types.put(tokens[1], new Type(tokens[2], Binding.valueOf(tokens[3])));
|
||||
if (tokens.length > 4 && tokens[4].equals("INTERNAL")) internal.add(tokens[1]);
|
||||
}
|
||||
case "STATIC" -> {
|
||||
StaticDescriptor descriptor = new StaticDescriptor(new StaticMethod(
|
||||
tokens[1], tokens[2]), tokens[3]);
|
||||
methods.put(descriptor, new StaticMethod(tokens[4], tokens[5]));
|
||||
if (tokens.length > 6 && tokens[6].equals("INTERNAL")) internal.add(descriptor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void write(RandomAccessFile file) throws IOException {
|
||||
for (var t : types.entrySet()) {
|
||||
file.writeBytes("TYPE " + t.getKey() + " " + t.getValue().type + " " + t.getValue().binding +
|
||||
(internal.contains(t.getKey()) ? " INTERNAL\n" : "\n"));
|
||||
}
|
||||
for (var t : methods.entrySet()) {
|
||||
file.writeBytes("STATIC " + t.getKey().method.type + " " + t.getKey().method.name + " " +
|
||||
t.getKey().descriptor + " " + t.getValue().type + " " + t.getValue().name +
|
||||
(internal.contains(t.getKey()) ? " INTERNAL\n" : "\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String descriptor(TypeMirror t) {
|
||||
return switch (t.getKind()) {
|
||||
case VOID -> "V";
|
||||
case BOOLEAN -> "Z";
|
||||
case BYTE -> "B";
|
||||
case CHAR -> "C";
|
||||
case SHORT -> "S";
|
||||
case INT -> "I";
|
||||
case LONG -> "J";
|
||||
case FLOAT -> "F";
|
||||
case DOUBLE -> "D";
|
||||
case ARRAY -> "[" + descriptor(((ArrayType) t).getComponentType());
|
||||
case DECLARED -> "L" + elements.getBinaryName((TypeElement) ((DeclaredType) t).asElement())
|
||||
.toString().replace('.', '/') + ";";
|
||||
case EXECUTABLE -> "(" + ((ExecutableType) t).getParameterTypes().stream().map(this::descriptor)
|
||||
.collect(Collectors.joining()) + ")" + descriptor(((ExecutableType) t).getReturnType());
|
||||
case TYPEVAR, WILDCARD, UNION, INTERSECTION -> descriptor(types.erasure(t));
|
||||
default -> throw new RuntimeException("Cannot generate descriptor for type: " + t);
|
||||
};
|
||||
}
|
||||
|
||||
Registry.StaticDescriptor staticDescriptor(String type, ExecutableElement e) {
|
||||
return new Registry.StaticDescriptor(new Registry.StaticMethod(type, e.getSimpleName().toString()), descriptor(e.asType()));
|
||||
}
|
||||
|
||||
AnnotationValue annotationValue(AnnotationMirror m) {
|
||||
if (m == null) return null;
|
||||
return m.getElementValues().entrySet().stream()
|
||||
.filter(t -> t.getKey().getSimpleName().contentEquals("value"))
|
||||
.map(Map.Entry::getValue).findFirst().orElseThrow();
|
||||
}
|
||||
|
||||
static boolean isJavaIdentifier(String name, int from, int to) {
|
||||
if (!Character.isJavaIdentifierStart(name.charAt(from))) return false;
|
||||
for (int i = from + 1; i < to; i++) {
|
||||
if (!Character.isJavaIdentifierPart(name.charAt(i))) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
static boolean isJavaIdentifier(String name) {
|
||||
if (name == null || name.isEmpty()) return false;
|
||||
return isJavaIdentifier(name, 0, name.length());
|
||||
}
|
||||
static boolean isJavaTypeIdentifier(String name) {
|
||||
if (name == null || name.isEmpty()) return false;
|
||||
for (int i = 0; i < name.length();) {
|
||||
int next = name.indexOf('.', i);
|
||||
if (next == -1) next = name.length();
|
||||
if (!isJavaIdentifier(name, i, next)) return false;
|
||||
i = next + 1;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void scan(CompilationUnitTree root, Element e) {
|
||||
// Get current type name.
|
||||
String currentType;
|
||||
if (e.getKind() == ElementKind.CLASS || e.getKind() == ElementKind.INTERFACE) {
|
||||
currentType = ((TypeElement) e).getQualifiedName().toString();
|
||||
} else if (e.getKind() == ElementKind.METHOD && e.getModifiers().contains(Modifier.STATIC)) {
|
||||
currentType = ((QualifiedNameable) e.getEnclosingElement()).getQualifiedName().toString();
|
||||
} else currentType = null;
|
||||
|
||||
// Find the annotation.
|
||||
AnnotationMirror providedMirror = null, providesMirror = null, serviceMirror = null;
|
||||
for (AnnotationMirror m : elements.getAllAnnotationMirrors(e)) {
|
||||
switch (m.getAnnotationType().toString()) {
|
||||
case "com.jetbrains.exported.JBRApi.Provided" -> providedMirror = m;
|
||||
case "com.jetbrains.exported.JBRApi.Provides" -> providesMirror = m;
|
||||
case "com.jetbrains.exported.JBRApi.Service" -> serviceMirror = m;
|
||||
}
|
||||
}
|
||||
|
||||
AnnotationMirror mirror = null;
|
||||
AnnotationValue value = null;
|
||||
Binding binding = null;
|
||||
if (serviceMirror != null) {
|
||||
if (providesMirror == null) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"@Service also requires @Provides", trees.getTree(e, serviceMirror), root);
|
||||
return;
|
||||
}
|
||||
if (providedMirror != null) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"@Service cannot be used with @Provided", trees.getTree(e, serviceMirror), root);
|
||||
return;
|
||||
}
|
||||
value = annotationValue(mirror = providesMirror);
|
||||
binding = Binding.SERVICE;
|
||||
} else if (providesMirror != null) {
|
||||
value = annotationValue(mirror = providesMirror);
|
||||
if (providedMirror != null) {
|
||||
AnnotationValue v = annotationValue(providedMirror);
|
||||
if (!value.getValue().toString().equals(v.getValue().toString())) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"@Provided and @Provides doesn't match", trees.getTree(e, mirror, value), root);
|
||||
return;
|
||||
}
|
||||
binding = Binding.TWO_WAY;
|
||||
} else binding = Binding.PROVIDES;
|
||||
} else if (providedMirror != null) {
|
||||
value = annotationValue(mirror = providedMirror);
|
||||
binding = Binding.PROVIDED;
|
||||
}
|
||||
|
||||
if (value != null && value.getValue().toString().isEmpty()) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"Empty JBR API binding",
|
||||
trees.getTree(e, mirror, value), root);
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentType == null) {
|
||||
if (value != null) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"JBR API annotations are only allowed on classes, interfaces and static methods",
|
||||
trees.getTree(e, mirror), root);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (value != null && e.getKind() == ElementKind.METHOD && binding != Binding.PROVIDES) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR,
|
||||
"Only @Provides is allowed for static methods",
|
||||
trees.getTree(e, mirror), root);
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine class/method names.
|
||||
String bindType = null, bindMethod = null;
|
||||
if (value != null) {
|
||||
bindType = value.getValue().toString();
|
||||
if (e.getKind() == ElementKind.METHOD) {
|
||||
int splitIndex = bindType.indexOf('#');
|
||||
if (splitIndex != -1) {
|
||||
bindMethod = bindType.substring(splitIndex + 1);
|
||||
bindType = bindType.substring(0, splitIndex);
|
||||
if (!isJavaIdentifier(bindMethod)) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR, "Invalid method identifier: " + bindMethod,
|
||||
trees.getTree(e, mirror, value), root);
|
||||
return;
|
||||
}
|
||||
} else bindMethod = e.getSimpleName().toString();
|
||||
}
|
||||
if (!isJavaTypeIdentifier(bindType)) {
|
||||
trees.printMessage(Diagnostic.Kind.ERROR, "Invalid type identifier: " + bindType,
|
||||
trees.getTree(e, mirror, value), root);
|
||||
return;
|
||||
}
|
||||
if (Character.isUpperCase(bindType.charAt(0))) bindType = "com.jetbrains." + bindType; // Short form
|
||||
}
|
||||
|
||||
// Add entry.
|
||||
DiagnosticTree diagnostic = new DiagnosticTree(root, trees.getTree(e, mirror, value));
|
||||
if (e.getKind() == ElementKind.METHOD) {
|
||||
ExecutableElement m = (ExecutableElement) e;
|
||||
methodBindings.add(new MethodBinding(diagnostic, m, staticDescriptor(currentType, m),
|
||||
bindType == null ? null : new Registry.StaticMethod(bindType, bindMethod)));
|
||||
} else {
|
||||
typeBindings.put(currentType, new TypeBinding(diagnostic, (TypeElement) e, currentType, bindType, binding));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "jbr-api";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(JavacTask jt, String... args) {
|
||||
Path output = Path.of(args[0]);
|
||||
String implVersion;
|
||||
try {
|
||||
implVersion = Files.readString(Path.of(args[1])).strip();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
elements = jt.getElements();
|
||||
trees = Trees.instance(jt);
|
||||
types = jt.getTypes();
|
||||
jt.addTaskListener(new TaskListener() {
|
||||
@Override
|
||||
public void finished(TaskEvent te) {
|
||||
if (te.getKind() == TaskEvent.Kind.ANALYZE && te.getTypeElement() != null) {
|
||||
new ElementScanner14<Void, CompilationUnitTree>() {
|
||||
@Override
|
||||
public Void visitModule(ModuleElement e, CompilationUnitTree unused) { return null; }
|
||||
@Override
|
||||
public Void visitPackage(PackageElement e, CompilationUnitTree unused) { return null; }
|
||||
@Override
|
||||
public Void scan(Element e, CompilationUnitTree root) {
|
||||
JBRApiPlugin.this.scan(root, e);
|
||||
e.accept(this, root);
|
||||
return null;
|
||||
}
|
||||
}.scan(te.getTypeElement(), te.getCompilationUnit());
|
||||
} else if (te.getKind() == TaskEvent.Kind.COMPILATION) {
|
||||
try (RandomAccessFile file = new RandomAccessFile(output.toFile(), "rw");
|
||||
FileChannel channel = file.getChannel()) {
|
||||
for (;;) {
|
||||
try { if (channel.lock() != null) break; } catch (OverlappingFileLockException ignore) {}
|
||||
LockSupport.parkNanos(10_000000);
|
||||
}
|
||||
Registry r = new Registry();
|
||||
r.read(file);
|
||||
var unresolvedErrors = r.addBindings();
|
||||
file.setLength(0);
|
||||
file.writeBytes("VERSION " + implVersion + "\n");
|
||||
r.write(file);
|
||||
if (!unresolvedErrors.isEmpty()) {
|
||||
throw new RuntimeException(String.join("\n", unresolvedErrors));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -78,8 +78,7 @@ ifeq ($(call isTargetOs, macosx aix linux), true)
|
||||
NAME := jspawnhelper, \
|
||||
SRC := $(TOPDIR)/src/$(MODULE)/unix/native/jspawnhelper, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKEXE) $(VERSION_CFLAGS) \
|
||||
-I$(TOPDIR)/src/$(MODULE)/unix/native/libjava, \
|
||||
CFLAGS := $(CFLAGS_JDKEXE) -I$(TOPDIR)/src/$(MODULE)/unix/native/libjava, \
|
||||
EXTRA_OBJECT_FILES := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjava/childproc$(OBJ_SUFFIX), \
|
||||
LDFLAGS := $(LDFLAGS_JDKEXE), \
|
||||
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
|
||||
|
||||
@@ -59,10 +59,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJAVA, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(LIBJAVA_CFLAGS), \
|
||||
jdk_util.c_CFLAGS := $(VERSION_CFLAGS), \
|
||||
ProcessImpl_md.c_CFLAGS := $(VERSION_CFLAGS), \
|
||||
WARNINGS_AS_ERRORS_xlc := false, \
|
||||
DISABLED_WARNINGS_gcc_ProcessImpl_md.c := unused-result, \
|
||||
DISABLED_WARNINGS_clang_jni_util.c := format-nonliteral, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_macosx := -L$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/, \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2022, 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
|
||||
@@ -91,7 +91,6 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
DISABLED_WARNINGS_clang_NSApplicationAWT.m := deprecated-declarations format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_QueuingApplicationDelegate.m := objc-method-access, \
|
||||
DISABLED_WARNINGS_clang_ThreadUtilities.m := format-nonliteral, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS := \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -78,10 +78,6 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
#
|
||||
endif
|
||||
|
||||
ifeq ($(DBUS_FOUND), false)
|
||||
LIBAWT_EXFILES += dbus_interface.c dbus_interface.h
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, linux macosx aix), true)
|
||||
LIBAWT_EXFILES += awt_Font.c CUPSfuncs.c fontpath.c X11Color.c
|
||||
endif
|
||||
@@ -115,10 +111,6 @@ LIBAWT_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES $(X_CFLAGS)
|
||||
|
||||
LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
|
||||
|
||||
ifeq ($(DBUS_FOUND), true)
|
||||
LIBAWT_CFLAGS += -DDBUS_FOUND
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
|
||||
ifeq ($(call isTargetCpuBits, 64), true)
|
||||
@@ -170,7 +162,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
|
||||
EXCLUDES := $(LIBAWT_EXCLUDES), \
|
||||
EXCLUDE_FILES := $(LIBAWT_EXFILES), \
|
||||
OPTIMIZATION := HIGHEST, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS) $(DBUS_CFLAGS), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_EXTRA_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_gcc_awt_LoadLibrary.c := unused-result, \
|
||||
DISABLED_WARNINGS_gcc_debug_mem.c := format-nonliteral, \
|
||||
@@ -321,7 +313,7 @@ ifeq ($(call isTargetOs, windows macosx), false)
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_XAWT_EXTRA_HEADER_DIRS), \
|
||||
EXCLUDES := $(LIBAWT_XAWT_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) $(DBUS_CFLAGS) \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
|
||||
$(X_CFLAGS), \
|
||||
WARNINGS_AS_ERRORS_xlc := false, \
|
||||
DISABLED_WARNINGS_gcc := int-to-pointer-cast, \
|
||||
@@ -340,13 +332,6 @@ ifeq ($(call isTargetOs, windows macosx), false)
|
||||
DISABLED_WARNINGS_gcc_XToolkit.c := unused-result, \
|
||||
DISABLED_WARNINGS_gcc_XWindow.c := unused-function, \
|
||||
DISABLED_WARNINGS_gcc_keycode_cache.c := unused-function, \
|
||||
DISABLED_WARNINGS_clang_awt_Taskbar.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_gtk2_interface.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_gtk3_interface.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_OGLBufImgOps.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_OGLPaints.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_screencast_pipewire.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_sun_awt_X11_GtkFileDialogPeer.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_aix := deprecated-non-prototype, \
|
||||
DISABLED_WARNINGS_clang_aix_awt_Taskbar.c := parentheses, \
|
||||
DISABLED_WARNINGS_clang_aix_OGLPaints.c := format-nonliteral, \
|
||||
@@ -398,7 +383,6 @@ ifeq ($(call isTargetOs, windows macosx), false)
|
||||
common/awt/debug \
|
||||
common/awt/systemscale \
|
||||
common/font \
|
||||
common/java2d \
|
||||
common/java2d/wl \
|
||||
common/java2d/vulkan \
|
||||
common/wayland \
|
||||
@@ -587,7 +571,7 @@ ifeq ($(call isTargetOs, windows macosx), false)
|
||||
EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
$(LIBAWT_HEADLESS_CFLAGS) $(DBUS_CFLAGS), \
|
||||
$(LIBAWT_HEADLESS_CFLAGS), \
|
||||
CXXFLAGS := $(CXXFLAGS_JDKLIB), \
|
||||
EXTRA_HEADER_DIRS := $(LIBAWT_HEADLESS_EXTRA_HEADER_DIRS), \
|
||||
DISABLED_WARNINGS_gcc_X11Renderer.c := unused-function, \
|
||||
@@ -667,10 +651,7 @@ else
|
||||
endif
|
||||
|
||||
# hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
|
||||
# hb-subset and hb-style APIs are not needed, excluded to cut on compilation time.
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += hb-ft.cc hb-subset-cff-common.cc \
|
||||
hb-subset-cff1.cc hb-subset-cff2.cc hb-subset-input.cc hb-subset-plan.cc \
|
||||
hb-subset.cc hb-subset-instancer-solver.cc gsubgpos-context.cc hb-style.cc
|
||||
LIBFONTMANAGER_EXCLUDE_FILES += libharfbuzz/hb-ft.cc
|
||||
|
||||
# list of disabled warnings and the compilers for which it was specifically added.
|
||||
# array-bounds -> GCC 12 on Alpine Linux
|
||||
@@ -682,10 +663,8 @@ else
|
||||
# noexcept-type required for GCC 7 builds. Not required for GCC 8+.
|
||||
# expansion-to-defined required for GCC 9 builds. Not required for GCC 10+.
|
||||
# maybe-uninitialized required for GCC 8 builds. Not required for GCC 9+.
|
||||
# calloc-transposed-args required for GCC 14 builds. (fixed upstream in Harfbuzz 032c931e1c0cfb20f18e5acb8ba005775242bd92)
|
||||
HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := class-memaccess noexcept-type \
|
||||
expansion-to-defined dangling-reference maybe-uninitialized \
|
||||
calloc-transposed-args
|
||||
expansion-to-defined dangling-reference maybe-uninitialized
|
||||
HARFBUZZ_DISABLED_WARNINGS_clang := missing-field-initializers range-loop-analysis
|
||||
HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244
|
||||
|
||||
@@ -1095,7 +1074,6 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
libawt_lwawt/java2d/metal \
|
||||
include \
|
||||
common/awt/debug \
|
||||
common/java2d \
|
||||
common/java2d/opengl \
|
||||
libosxapp \
|
||||
#
|
||||
@@ -1148,8 +1126,7 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
-framework ExceptionHandling \
|
||||
-framework JavaRuntimeSupport \
|
||||
-framework OpenGL \
|
||||
-framework QuartzCore \
|
||||
-framework UniformTypeIdentifiers -ljava, \
|
||||
-framework QuartzCore -ljava, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT_LWAWT)
|
||||
|
||||
@@ -33,7 +33,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2GSS, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
DISABLED_WARNINGS_gcc := undef, \
|
||||
DISABLED_WARNINGS_clang_aix := undef, \
|
||||
DISABLED_WARNINGS_clang := undef, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS := $(LIBDL), \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2022, 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
|
||||
@@ -61,7 +61,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBSA, \
|
||||
OPTIMIZATION := HIGH, \
|
||||
DISABLED_WARNINGS_gcc := sign-compare, \
|
||||
DISABLED_WARNINGS_gcc_ps_core.c := pointer-arith, \
|
||||
DISABLED_WARNINGS_clang_ps_core.c := pointer-arith, \
|
||||
DISABLED_WARNINGS_clang := sign-compare, \
|
||||
DISABLED_WARNINGS_clang_libproc_impl.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_sadis.c := format-nonliteral, \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2018, 2022, 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
|
||||
@@ -65,8 +65,6 @@ $(eval $(call SetupJdkExecutable, BUILD_JPACKAGE_APPLAUNCHEREXE, \
|
||||
INCLUDE_FILES := $(JPACKAGE_APPLAUNCHER_INCLUDE_FILES), \
|
||||
TOOLCHAIN := $(JPACKAGE_APPLAUNCHER_TOOLCHAIN), \
|
||||
OPTIMIZATION := LOW, \
|
||||
DISABLED_WARNINGS_clang_LinuxPackage.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_JvmLauncherLib.c := format-nonliteral, \
|
||||
CXXFLAGS := $(call JpackageWithStaticCrt, $(CXXFLAGS_JDKEXE)) \
|
||||
$(JPACKAGE_APPLAUNCHER_INCLUDES), \
|
||||
CFLAGS := $(call JpackageWithStaticCrt, $(CFLAGS_JDKEXE)) \
|
||||
@@ -105,8 +103,6 @@ ifeq ($(call isTargetOs, linux), true)
|
||||
EXCLUDE_FILES := LinuxLauncher.c LinuxPackage.c, \
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
OPTIMIZATION := LOW, \
|
||||
DISABLED_WARNINGS_clang_JvmLauncherLib.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_tstrings.cpp := format-nonliteral, \
|
||||
CXXFLAGS := $(CXXFLAGS_JDKLIB) $(JPACKAGE_LIBAPPLAUNCHER_INCLUDES), \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(JPACKAGE_LIBAPPLAUNCHER_INCLUDES), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB), \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2022, 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
|
||||
@@ -44,7 +44,6 @@ endif
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT_EXT, \
|
||||
NAME := management_ext, \
|
||||
OPTIMIZATION := $(LIBMANAGEMENT_EXT_OPTIMIZATION), \
|
||||
DISABLED_WARNINGS_clang_UnixOperatingSystem.c := format-nonliteral, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) $(LIBMANAGEMENT_EXT_CFLAGS), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2022, 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
|
||||
@@ -660,7 +660,7 @@ public class GenerateJfrFiles {
|
||||
out.write("");
|
||||
out.write("union JfrNativeSettings {");
|
||||
out.write(" // Array version.");
|
||||
out.write(" jfrNativeEventSetting bits[NUMBER_OF_EVENTS + NUMBER_OF_RESERVED_EVENTS];");
|
||||
out.write(" jfrNativeEventSetting bits[NUMBER_OF_EVENTS];");
|
||||
out.write(" // Then, to make it easy to debug,");
|
||||
out.write(" // add named struct members also.");
|
||||
out.write(" struct {");
|
||||
|
||||
@@ -80,10 +80,6 @@ IMAGES_TARGETS += $(COPY_FH)
|
||||
# Use JTREG_TEST_OPTS for test VM options
|
||||
# Use JTREG_TESTS for jtreg tests parameter
|
||||
#
|
||||
# Most likely you want to select a specific test from test/failure_handler/test
|
||||
# and manually inspect the results. This target does not actually verify
|
||||
# anything about the failure_handler's output or even if it ran at all.
|
||||
#
|
||||
RUN_DIR := $(FH_SUPPORT)/test
|
||||
|
||||
test:
|
||||
|
||||
@@ -867,7 +867,7 @@ BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exesigtest := -ljvm
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
BUILD_HOTSPOT_JTREG_EXECUTABLES_CFLAGS_exeFPRegs := -MT
|
||||
BUILD_HOTSPOT_JTREG_EXCLUDE += exesigtest.c libterminatedThread.c libTestJNI.c libCompleteExit.c libMonitorWithDeadObjectTest.c libTestPsig.c libnativeStack.c exeGetCreatedJavaVMs.c
|
||||
BUILD_HOTSPOT_JTREG_EXCLUDE += exesigtest.c libterminatedThread.c libTestJNI.c libCompleteExit.c libTestPsig.c libnativeStack.c exeGetCreatedJavaVMs.c
|
||||
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libatExit := jvm.lib
|
||||
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exedaemonDestroy := jvm.lib
|
||||
else
|
||||
@@ -1508,11 +1508,8 @@ else
|
||||
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libterminatedThread += -lpthread
|
||||
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libatExit += -ljvm
|
||||
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libCompleteExit += -lpthread
|
||||
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libMonitorWithDeadObjectTest += -lpthread
|
||||
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libnativeStack += -lpthread
|
||||
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeGetCreatedJavaVMs := -ljvm -lpthread
|
||||
|
||||
BUILD_HOTSPOT_JTREG_EXCLUDE += libNativeException.c
|
||||
endif
|
||||
|
||||
ifeq ($(ASAN_ENABLED), true)
|
||||
|
||||
@@ -80,11 +80,7 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libTracePinnedThreads := jvm.lib
|
||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libNewDirectByteBuffer := $(WIN_LIB_JAVA)
|
||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libGetXSpace := $(WIN_LIB_JAVA)
|
||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libFatalErrorTest := $(WIN_LIB_JAVA)
|
||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libLogEventTest := $(WIN_LIB_JAVA)
|
||||
else
|
||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libFatalErrorTest := -ljava
|
||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libLogEventTest := -ljava
|
||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libstringPlatformChars := -ljava
|
||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libDirectIO := -ljava
|
||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libNewDirectByteBuffer := -ljava
|
||||
|
||||
@@ -29,23 +29,6 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
|
||||
ifndef SOURCE
|
||||
export SOURCE := 7
|
||||
endif
|
||||
ifndef TARGET
|
||||
export TARGET := 7
|
||||
endif
|
||||
ifndef JAVAC
|
||||
export JAVAC := javac
|
||||
endif
|
||||
ifndef JAVA
|
||||
export JAVA := java
|
||||
endif
|
||||
ifndef JAR
|
||||
export JAR := jar
|
||||
endif
|
||||
|
||||
SOURCEPATH=src
|
||||
CLASSES=build
|
||||
DIST=dist
|
||||
@@ -97,18 +80,18 @@ SCM_DIRs = .hg .svn CVS RCS SCCS Codemgr_wsdata deleted_files
|
||||
all: mkdirs J2DBench.jar J2DAnalyzer.jar
|
||||
|
||||
run: mkdirs J2DBench.jar
|
||||
$(JAVA) -jar $(DIST)/J2DBench.jar
|
||||
java -jar $(DIST)/J2DBench.jar
|
||||
|
||||
analyze: mkdirs J2DAnalyzer.jar
|
||||
$(JAVA) -jar $(DIST)/J2DAnalyzer.jar
|
||||
java -jar $(DIST)/J2DAnalyzer.jar
|
||||
|
||||
J2DBench.jar: \
|
||||
$(J2DBENCH_CLASSES) $(J2DBENCH_RESOURCES) \
|
||||
$(CLASSES)/j2dbench.manifest
|
||||
$(JAR) cvmf $(CLASSES)/j2dbench.manifest $(DIST)/J2DBench.jar -C $(CLASSES) j2dbench
|
||||
jar cvmf $(CLASSES)/j2dbench.manifest $(DIST)/J2DBench.jar -C $(CLASSES) j2dbench
|
||||
|
||||
J2DAnalyzer.jar: $(J2DANALYZER_CLASSES) $(CLASSES)/j2danalyzer.manifest
|
||||
$(JAR) cvmf $(CLASSES)/j2danalyzer.manifest \
|
||||
jar cvmf $(CLASSES)/j2danalyzer.manifest \
|
||||
$(DIST)/J2DAnalyzer.jar -C $(CLASSES) j2dbench/report
|
||||
|
||||
$(CLASSES)/j2dbench/tests/iio/images: $(RESOURCES)/images
|
||||
@@ -137,7 +120,7 @@ $(CLASSES):
|
||||
mkdirs: $(DIST) $(CLASSES)
|
||||
|
||||
$(CLASSES)/j2dbench/%.class: $(SOURCEPATH)/j2dbench/%.java
|
||||
$(JAVAC) -g:none -source $(SOURCE) -target $(TARGET) -d $(CLASSES) -sourcepath $(SOURCEPATH) $<
|
||||
javac -g:none -source 1.7 -target 1.7 -d $(CLASSES) -sourcepath $(SOURCEPATH) $<
|
||||
|
||||
clean:
|
||||
rm -rf $(CLASSES)
|
||||
|
||||
@@ -23,9 +23,6 @@ The benchmark requires at least jdk1.4 to compile and run. Note that
|
||||
source/target is set to 1.7 in the makefile and build.xml, because of
|
||||
support in jdk 14 compiler. To check compatibility with jdk1.4 you can
|
||||
use "-source 1.4 -target 1.4" options and jdk1.7.
|
||||
Yo can use TARGET/SOURCE of makefile and -Dtarget/surce to set them up for your convinience.
|
||||
Similarly you can set JAVA/JAVAC/JAR and -Djava/javac to select diffferent java/javac then is on yoru PATH
|
||||
Unluckily in ant, you can not set jar, but ant should honor JAVA_HOME
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
How To Compile
|
||||
|
||||
@@ -39,27 +39,6 @@
|
||||
<property name="dist" location="dist"/>
|
||||
<property name="resources" location="resources"/>
|
||||
|
||||
<condition property="source" value="21">
|
||||
<not>
|
||||
<isset property="source"/>
|
||||
</not>
|
||||
</condition>
|
||||
<condition property="target" value="21">
|
||||
<not>
|
||||
<isset property="target"/>
|
||||
</not>
|
||||
</condition>
|
||||
<condition property="java" value="java">
|
||||
<not>
|
||||
<isset property="java"/>
|
||||
</not>
|
||||
</condition>
|
||||
<condition property="javac" value="javac">
|
||||
<not>
|
||||
<isset property="javac"/>
|
||||
</not>
|
||||
</condition>
|
||||
|
||||
<target name="init">
|
||||
<!-- Create the time stamp -->
|
||||
<tstamp/>
|
||||
@@ -70,14 +49,13 @@
|
||||
<target name="compile" depends="init"
|
||||
description="compile the source " >
|
||||
<!-- Compile the java code from ${src} into ${build} -->
|
||||
<javac debug="off" source="${source}" target="${target}" srcdir="${src}" destdir="${build}" fork="true"/>
|
||||
<javac debug="off" source="21" target="21" srcdir="${src}" destdir="${build}"/>
|
||||
</target>
|
||||
|
||||
<target name="run" depends="dist"
|
||||
description="run J2DBench" >
|
||||
<java jar="${dist}/J2DBench.jar"
|
||||
fork="true"
|
||||
jvm="${java}"
|
||||
>
|
||||
</java>
|
||||
</target>
|
||||
@@ -86,7 +64,6 @@
|
||||
description="run J2DAnalyzer" >
|
||||
<java jar="${dist}/J2DAnalyzer.jar"
|
||||
fork="true"
|
||||
jvm="${java}"
|
||||
>
|
||||
</java>
|
||||
</target>
|
||||
|
||||
@@ -694,11 +694,6 @@ reg_class no_special_ptr_reg %{
|
||||
return _NO_SPECIAL_PTR_REG_mask;
|
||||
%}
|
||||
|
||||
// Class for all non_special pointer registers (excluding rfp)
|
||||
reg_class no_special_no_rfp_ptr_reg %{
|
||||
return _NO_SPECIAL_NO_RFP_PTR_REG_mask;
|
||||
%}
|
||||
|
||||
// Class for all float registers
|
||||
reg_class float_reg(
|
||||
V0,
|
||||
@@ -1130,7 +1125,6 @@ extern RegMask _PTR_REG_mask;
|
||||
extern RegMask _NO_SPECIAL_REG32_mask;
|
||||
extern RegMask _NO_SPECIAL_REG_mask;
|
||||
extern RegMask _NO_SPECIAL_PTR_REG_mask;
|
||||
extern RegMask _NO_SPECIAL_NO_RFP_PTR_REG_mask;
|
||||
|
||||
class CallStubImpl {
|
||||
|
||||
@@ -1219,7 +1213,6 @@ source %{
|
||||
RegMask _NO_SPECIAL_REG32_mask;
|
||||
RegMask _NO_SPECIAL_REG_mask;
|
||||
RegMask _NO_SPECIAL_PTR_REG_mask;
|
||||
RegMask _NO_SPECIAL_NO_RFP_PTR_REG_mask;
|
||||
|
||||
void reg_mask_init() {
|
||||
// We derive below RegMask(s) from the ones which are auto-generated from
|
||||
@@ -1256,9 +1249,6 @@ source %{
|
||||
_NO_SPECIAL_REG_mask.Remove(OptoReg::as_OptoReg(r29->as_VMReg()));
|
||||
_NO_SPECIAL_PTR_REG_mask.Remove(OptoReg::as_OptoReg(r29->as_VMReg()));
|
||||
}
|
||||
|
||||
_NO_SPECIAL_NO_RFP_PTR_REG_mask = _NO_SPECIAL_PTR_REG_mask;
|
||||
_NO_SPECIAL_NO_RFP_PTR_REG_mask.Remove(OptoReg::as_OptoReg(r29->as_VMReg()));
|
||||
}
|
||||
|
||||
// Optimizaton of volatile gets and puts
|
||||
@@ -1731,8 +1721,8 @@ void MachPrologNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
|
||||
st->print("# stack bang size=%d\n\t", framesize);
|
||||
|
||||
if (VM_Version::use_rop_protection()) {
|
||||
st->print("ldr zr, [lr]\n\t");
|
||||
st->print("paciaz\n\t");
|
||||
st->print("ldr zr, [lr]\n\t");
|
||||
st->print("pacia lr, rfp\n\t");
|
||||
}
|
||||
if (framesize < ((1 << 9) + 2 * wordSize)) {
|
||||
st->print("sub sp, sp, #%d\n\t", framesize);
|
||||
@@ -1861,8 +1851,8 @@ void MachEpilogNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
|
||||
st->print("ldp lr, rfp, [sp],#%d\n\t", (2 * wordSize));
|
||||
}
|
||||
if (VM_Version::use_rop_protection()) {
|
||||
st->print("autiaz\n\t");
|
||||
st->print("ldr zr, [lr]\n\t");
|
||||
st->print("autia lr, rfp\n\t");
|
||||
st->print("ldr zr, [lr]\n\t");
|
||||
}
|
||||
|
||||
if (do_polling() && C->is_method_compilation()) {
|
||||
@@ -4895,18 +4885,6 @@ operand iRegPNoSp()
|
||||
interface(REG_INTER);
|
||||
%}
|
||||
|
||||
// This operand is not allowed to use rfp even if
|
||||
// rfp is not used to hold the frame pointer.
|
||||
operand iRegPNoSpNoRfp()
|
||||
%{
|
||||
constraint(ALLOC_IN_RC(no_special_no_rfp_ptr_reg));
|
||||
match(RegP);
|
||||
match(iRegPNoSp);
|
||||
op_cost(0);
|
||||
format %{ %}
|
||||
interface(REG_INTER);
|
||||
%}
|
||||
|
||||
// Pointer 64 bit Register R0 only
|
||||
operand iRegP_R0()
|
||||
%{
|
||||
@@ -16584,9 +16562,7 @@ instruct CallLeafNoFPDirect(method meth)
|
||||
// Also known as an 'interprocedural jump'.
|
||||
// Target of jump will eventually return to caller.
|
||||
// TailJump below removes the return address.
|
||||
// Don't use rfp for 'jump_target' because a MachEpilogNode has already been
|
||||
// emitted just above the TailCall which has reset rfp to the caller state.
|
||||
instruct TailCalljmpInd(iRegPNoSpNoRfp jump_target, inline_cache_RegP method_ptr)
|
||||
instruct TailCalljmpInd(iRegPNoSp jump_target, inline_cache_RegP method_ptr)
|
||||
%{
|
||||
match(TailCall jump_target method_ptr);
|
||||
|
||||
@@ -16599,7 +16575,7 @@ instruct TailCalljmpInd(iRegPNoSpNoRfp jump_target, inline_cache_RegP method_ptr
|
||||
ins_pipe(pipe_class_call);
|
||||
%}
|
||||
|
||||
instruct TailjmpInd(iRegPNoSpNoRfp jump_target, iRegP_R0 ex_oop)
|
||||
instruct TailjmpInd(iRegPNoSp jump_target, iRegP_R0 ex_oop)
|
||||
%{
|
||||
match(TailJump jump_target ex_oop);
|
||||
|
||||
|
||||
@@ -187,26 +187,6 @@ void Address::lea(MacroAssembler *as, Register r) const {
|
||||
zrf(Rd, 0);
|
||||
}
|
||||
|
||||
// This encoding is similar (but not quite identical) to the encoding used
|
||||
// by literal ld/st. see JDK-8324123.
|
||||
// PRFM does not support writeback or pre/post index.
|
||||
void Assembler::prfm(const Address &adr, prfop pfop) {
|
||||
Address::mode mode = adr.getMode();
|
||||
// PRFM does not support pre/post index
|
||||
guarantee((mode != Address::pre) && (mode != Address::post), "prfm does not support pre/post indexing");
|
||||
if (mode == Address::literal) {
|
||||
starti;
|
||||
f(0b11, 31, 30), f(0b011, 29, 27), f(0b000, 26, 24);
|
||||
f(pfop, 4, 0);
|
||||
int64_t offset = (adr.target() - pc()) >> 2;
|
||||
sf(offset, 23, 5);
|
||||
} else {
|
||||
assert((mode == Address::base_plus_offset)
|
||||
|| (mode == Address::base_plus_offset_reg), "must be base_plus_offset/base_plus_offset_reg");
|
||||
ld_st2(as_Register(pfop), adr, 0b11, 0b10);
|
||||
}
|
||||
}
|
||||
|
||||
// An "all-purpose" add/subtract immediate, per ARM documentation:
|
||||
// A "programmer-friendly" assembler may accept a negative immediate
|
||||
// between -(2^24 -1) and -1 inclusive, causing it to convert a
|
||||
|
||||
@@ -573,7 +573,7 @@ class Address {
|
||||
if (size == 0) // It's a byte
|
||||
i->f(ext().shift() >= 0, 12);
|
||||
else {
|
||||
guarantee(ext().shift() <= 0 || ext().shift() == (int)size, "bad shift");
|
||||
assert(ext().shift() <= 0 || ext().shift() == (int)size, "bad shift");
|
||||
i->f(ext().shift() > 0, 12);
|
||||
}
|
||||
i->f(0b10, 11, 10);
|
||||
@@ -795,8 +795,6 @@ public:
|
||||
|
||||
void adrp(Register Rd, const Address &dest, uint64_t &offset) = delete;
|
||||
|
||||
void prfm(const Address &adr, prfop pfop = PLDL1KEEP);
|
||||
|
||||
#undef INSN
|
||||
|
||||
void add_sub_immediate(Instruction_aarch64 ¤t_insn, Register Rd, Register Rn,
|
||||
@@ -1574,6 +1572,17 @@ public:
|
||||
|
||||
#undef INSN
|
||||
|
||||
#define INSN(NAME, size, op) \
|
||||
void NAME(const Address &adr, prfop pfop = PLDL1KEEP) { \
|
||||
ld_st2(as_Register(pfop), adr, size, op); \
|
||||
}
|
||||
|
||||
INSN(prfm, 0b11, 0b10); // FIXME: PRFM should not be used with
|
||||
// writeback modes, but the assembler
|
||||
// doesn't enfore that.
|
||||
|
||||
#undef INSN
|
||||
|
||||
#define INSN(NAME, size, op) \
|
||||
void NAME(FloatRegister Rt, const Address &adr) { \
|
||||
ld_st2(as_Register(Rt), adr, size, op, 1); \
|
||||
|
||||
@@ -385,7 +385,7 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) {
|
||||
|
||||
// load issuing PC (the return address for this stub) into r3
|
||||
__ ldr(exception_pc, Address(rfp, 1*BytesPerWord));
|
||||
__ authenticate_return_address(exception_pc);
|
||||
__ authenticate_return_address(exception_pc, rscratch1);
|
||||
|
||||
// make sure that the vm_results are cleared (may be unnecessary)
|
||||
__ str(zr, Address(rthread, JavaThread::vm_result_offset()));
|
||||
@@ -434,7 +434,7 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) {
|
||||
__ str(exception_pc, Address(rthread, JavaThread::exception_pc_offset()));
|
||||
|
||||
// patch throwing pc into return address (has bci & oop map)
|
||||
__ protect_return_address(exception_pc);
|
||||
__ protect_return_address(exception_pc, rscratch1);
|
||||
__ str(exception_pc, Address(rfp, 1*BytesPerWord));
|
||||
|
||||
// compute the exception handler.
|
||||
@@ -450,7 +450,7 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler *sasm) {
|
||||
__ invalidate_registers(false, true, true, true, true, true);
|
||||
|
||||
// patch the return address, this stub will directly return to the exception handler
|
||||
__ protect_return_address(r0);
|
||||
__ protect_return_address(r0, rscratch1);
|
||||
__ str(r0, Address(rfp, 1*BytesPerWord));
|
||||
|
||||
switch (id) {
|
||||
|
||||
@@ -62,7 +62,7 @@ inline frame FreezeBase::sender(const frame& f) {
|
||||
intptr_t** link_addr = link_address<FKind>(f);
|
||||
|
||||
intptr_t* sender_sp = (intptr_t*)(link_addr + frame::sender_sp_offset); // f.unextended_sp() + (fsize/wordSize); //
|
||||
address sender_pc = ContinuationHelper::return_address_at(sender_sp - 1);
|
||||
address sender_pc = (address) *(sender_sp-1);
|
||||
assert(sender_sp != f.sp(), "must have changed");
|
||||
|
||||
int slot = 0;
|
||||
@@ -217,7 +217,7 @@ template<typename FKind> frame ThawBase::new_stack_frame(const frame& hf, frame&
|
||||
intptr_t* heap_sp = hf.unextended_sp();
|
||||
// If caller is interpreted it already made room for the callee arguments
|
||||
int overlap = caller.is_interpreted_frame() ? ContinuationHelper::InterpretedFrame::stack_argsize(hf) : 0;
|
||||
const int fsize = (int)(ContinuationHelper::InterpretedFrame::frame_bottom(hf) - hf.unextended_sp() - overlap);
|
||||
const int fsize = ContinuationHelper::InterpretedFrame::frame_bottom(hf) - hf.unextended_sp() - overlap;
|
||||
const int locals = hf.interpreter_frame_method()->max_locals();
|
||||
intptr_t* frame_sp = caller.unextended_sp() - fsize;
|
||||
intptr_t* fp = frame_sp + (hf.fp() - heap_sp);
|
||||
|
||||
@@ -68,17 +68,6 @@ inline void ContinuationHelper::push_pd(const frame& f) {
|
||||
*(intptr_t**)(f.sp() - frame::sender_sp_offset) = f.fp();
|
||||
}
|
||||
|
||||
#define CPU_OVERRIDES_RETURN_ADDRESS_ACCESSORS
|
||||
|
||||
inline address ContinuationHelper::return_address_at(intptr_t* sp) {
|
||||
return pauth_strip_verifiable(*(address*)sp);
|
||||
}
|
||||
|
||||
inline void ContinuationHelper::patch_return_address_at(intptr_t* sp,
|
||||
address pc) {
|
||||
*(address*)sp = pauth_sign_return_address(pc);
|
||||
}
|
||||
|
||||
inline void ContinuationHelper::set_anchor_to_entry_pd(JavaFrameAnchor* anchor, ContinuationEntry* entry) {
|
||||
anchor->set_last_Java_fp(entry->entry_fp());
|
||||
}
|
||||
@@ -91,8 +80,7 @@ inline void ContinuationHelper::set_anchor_pd(JavaFrameAnchor* anchor, intptr_t*
|
||||
|
||||
inline bool ContinuationHelper::Frame::assert_frame_laid_out(frame f) {
|
||||
intptr_t* sp = f.sp();
|
||||
address pc = ContinuationHelper::return_address_at(
|
||||
sp - frame::sender_sp_ret_address_offset());
|
||||
address pc = *(address*)(sp - frame::sender_sp_ret_address_offset());
|
||||
intptr_t* fp = *(intptr_t**)(sp - frame::sender_sp_offset);
|
||||
assert(f.raw_pc() == pc, "f.ra_pc: " INTPTR_FORMAT " actual: " INTPTR_FORMAT, p2i(f.raw_pc()), p2i(pc));
|
||||
assert(f.fp() == fp, "f.fp: " INTPTR_FORMAT " actual: " INTPTR_FORMAT, p2i(f.fp()), p2i(fp));
|
||||
@@ -120,14 +108,13 @@ inline void ContinuationHelper::InterpretedFrame::patch_sender_sp(frame& f, cons
|
||||
}
|
||||
|
||||
inline address ContinuationHelper::Frame::real_pc(const frame& f) {
|
||||
// Always used in assertions. Just strip it.
|
||||
address* pc_addr = &(((address*) f.sp())[-1]);
|
||||
return pauth_strip_pointer(*pc_addr);
|
||||
return *pc_addr;
|
||||
}
|
||||
|
||||
inline void ContinuationHelper::Frame::patch_pc(const frame& f, address pc) {
|
||||
address* pc_addr = &(((address*) f.sp())[-1]);
|
||||
*pc_addr = pauth_sign_return_address(pc);
|
||||
*pc_addr = pc;
|
||||
}
|
||||
|
||||
inline intptr_t* ContinuationHelper::InterpretedFrame::frame_top(const frame& f, InterpreterOopMap* mask) { // inclusive; this will be copied with the frame
|
||||
|
||||
@@ -139,7 +139,8 @@ bool frame::safe_for_sender(JavaThread *thread) {
|
||||
sender_sp = (intptr_t*) addr_at(sender_sp_offset);
|
||||
sender_unextended_sp = (intptr_t*) this->fp()[interpreter_frame_sender_sp_offset];
|
||||
saved_fp = (intptr_t*) this->fp()[link_offset];
|
||||
sender_pc = pauth_strip_verifiable((address) this->fp()[return_addr_offset]);
|
||||
sender_pc = pauth_strip_verifiable((address) this->fp()[return_addr_offset], (address)saved_fp);
|
||||
|
||||
} else {
|
||||
// must be some sort of compiled/runtime frame
|
||||
// fp does not have to be safe (although it could be check for c1?)
|
||||
@@ -157,9 +158,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
|
||||
sender_unextended_sp = sender_sp;
|
||||
// Note: frame::sender_sp_offset is only valid for compiled frame
|
||||
saved_fp = (intptr_t*) *(sender_sp - frame::sender_sp_offset);
|
||||
// Note: PAC authentication may fail in case broken frame is passed in.
|
||||
// Just strip it for now.
|
||||
sender_pc = pauth_strip_pointer((address) *(sender_sp - 1));
|
||||
sender_pc = pauth_strip_verifiable((address) *(sender_sp-1), (address)saved_fp);
|
||||
}
|
||||
|
||||
if (Continuation::is_return_barrier_entry(sender_pc)) {
|
||||
@@ -277,8 +276,9 @@ bool frame::safe_for_sender(JavaThread *thread) {
|
||||
void frame::patch_pc(Thread* thread, address pc) {
|
||||
assert(_cb == CodeCache::find_blob(pc), "unexpected pc");
|
||||
address* pc_addr = &(((address*) sp())[-1]);
|
||||
address signed_pc = pauth_sign_return_address(pc);
|
||||
address pc_old = pauth_strip_verifiable(*pc_addr);
|
||||
address signing_sp = (((address*) sp())[-2]);
|
||||
address signed_pc = pauth_sign_return_address(pc, (address)signing_sp);
|
||||
address pc_old = pauth_strip_verifiable(*pc_addr, (address)signing_sp);
|
||||
|
||||
if (TracePcPatching) {
|
||||
tty->print("patch_pc at address " INTPTR_FORMAT " [" INTPTR_FORMAT " -> " INTPTR_FORMAT "]",
|
||||
@@ -472,9 +472,8 @@ frame frame::sender_for_interpreter_frame(RegisterMap* map) const {
|
||||
}
|
||||
#endif // COMPILER2_OR_JVMCI
|
||||
|
||||
// For ROP protection, Interpreter will have signed the sender_pc,
|
||||
// but there is no requirement to authenticate it here.
|
||||
address sender_pc = pauth_strip_verifiable(sender_pc_maybe_signed());
|
||||
// For ROP protection, Interpreter will have signed the sender_pc, but there is no requirement to authenticate it here.
|
||||
address sender_pc = pauth_strip_verifiable(sender_pc_maybe_signed(), (address)link());
|
||||
|
||||
if (Continuation::is_return_barrier_entry(sender_pc)) {
|
||||
if (map->walk_cont()) { // about to walk into an h-stack
|
||||
|
||||
@@ -152,10 +152,7 @@ inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address
|
||||
setup(pc);
|
||||
}
|
||||
|
||||
inline frame::frame(intptr_t* sp)
|
||||
: frame(sp, sp,
|
||||
*(intptr_t**)(sp - frame::sender_sp_offset),
|
||||
pauth_strip_verifiable(*(address*)(sp - 1))) {}
|
||||
inline frame::frame(intptr_t* sp) : frame(sp, sp, *(intptr_t**)(sp - frame::sender_sp_offset), *(address*)(sp - 1)) {}
|
||||
|
||||
inline frame::frame(intptr_t* sp, intptr_t* fp) {
|
||||
intptr_t a = intptr_t(sp);
|
||||
@@ -236,13 +233,13 @@ inline intptr_t* frame::real_fp() const {
|
||||
|
||||
inline int frame::frame_size() const {
|
||||
return is_interpreted_frame()
|
||||
? pointer_delta_as_int(sender_sp(), sp())
|
||||
? sender_sp() - sp()
|
||||
: cb()->frame_size();
|
||||
}
|
||||
|
||||
inline int frame::compiled_frame_stack_argsize() const {
|
||||
assert(cb()->is_compiled(), "");
|
||||
return (cb()->as_nmethod()->num_stack_arg_slots() * VMRegImpl::stack_slot_size) >> LogBytesPerWord;
|
||||
return (cb()->as_compiled_method()->method()->num_stack_arg_slots() * VMRegImpl::stack_slot_size) >> LogBytesPerWord;
|
||||
}
|
||||
|
||||
inline void frame::interpreted_frame_oop_map(InterpreterOopMap* mask) const {
|
||||
@@ -419,10 +416,9 @@ inline frame frame::sender_for_compiled_frame(RegisterMap* map) const {
|
||||
: sender_sp();
|
||||
assert(!_sp_is_trusted || l_sender_sp == real_fp(), "");
|
||||
|
||||
// The return_address is always the word on the stack.
|
||||
// For ROP protection, C1/C2 will have signed the sender_pc,
|
||||
// but there is no requirement to authenticate it here.
|
||||
address sender_pc = pauth_strip_verifiable((address) *(l_sender_sp - 1));
|
||||
// the return_address is always the word on the stack
|
||||
// For ROP protection, C1/C2 will have signed the sender_pc, but there is no requirement to authenticate it here.
|
||||
address sender_pc = pauth_strip_verifiable((address) *(l_sender_sp-1), (address) *(l_sender_sp-2));
|
||||
|
||||
intptr_t** saved_fp_addr = (intptr_t**) (l_sender_sp - frame::sender_sp_offset);
|
||||
|
||||
|
||||
@@ -142,11 +142,9 @@
|
||||
// * 63-48 Fixed (16-bits, always zero)
|
||||
//
|
||||
|
||||
// Default value if probing is not implemented for a certain platform
|
||||
// Max address bit is restricted by implicit assumptions in the code, for instance
|
||||
// the bit layout of XForwardingEntry or Partial array entry (see XMarkStackEntry) in mark stack
|
||||
static const size_t DEFAULT_MAX_ADDRESS_BIT = 46;
|
||||
// Minimum value returned, if probing fails
|
||||
// Default value if probing is not implemented for a certain platform: 128TB
|
||||
static const size_t DEFAULT_MAX_ADDRESS_BIT = 47;
|
||||
// Minimum value returned, if probing fails: 64GB
|
||||
static const size_t MINIMUM_MAX_ADDRESS_BIT = 36;
|
||||
|
||||
static size_t probe_valid_max_address_bit() {
|
||||
|
||||
@@ -36,11 +36,9 @@
|
||||
#include <sys/mman.h>
|
||||
#endif // LINUX
|
||||
|
||||
// Default value if probing is not implemented for a certain platform
|
||||
// Max address bit is restricted by implicit assumptions in the code, for instance
|
||||
// the bit layout of ZForwardingEntry or Partial array entry (see ZMarkStackEntry) in mark stack
|
||||
static const size_t DEFAULT_MAX_ADDRESS_BIT = 46;
|
||||
// Minimum value returned, if probing fail
|
||||
// Default value if probing is not implemented for a certain platform: 128TB
|
||||
static const size_t DEFAULT_MAX_ADDRESS_BIT = 47;
|
||||
// Minimum value returned, if probing fails: 64GB
|
||||
static const size_t MINIMUM_MAX_ADDRESS_BIT = 36;
|
||||
|
||||
static size_t probe_valid_max_address_bit() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -27,7 +27,6 @@
|
||||
#define CPU_AARCH64_GLOBALDEFINITIONS_AARCH64_HPP
|
||||
|
||||
const int StackAlignmentInBytes = 16;
|
||||
const size_t pd_segfault_address = 1024;
|
||||
|
||||
// Indicates whether the C calling conventions require that
|
||||
// 32-bit integer argument values are extended to 64 bits.
|
||||
@@ -72,6 +71,4 @@ const bool CCallingConventionRequiresIntsAsLongs = false;
|
||||
|
||||
#define USE_POINTERS_TO_REGISTER_IMPL_ARRAY
|
||||
|
||||
#define USE_TRAMPOLINE_STUB_FIX_OWNER
|
||||
|
||||
#endif // CPU_AARCH64_GLOBALDEFINITIONS_AARCH64_HPP
|
||||
|
||||
@@ -389,13 +389,13 @@ static bool offset_for(uint32_t insn1, uint32_t insn2, ptrdiff_t &byte_offset) {
|
||||
return false;
|
||||
}
|
||||
|
||||
class AArch64Decoder : public RelocActions {
|
||||
virtual reloc_insn adrpMem() { return &AArch64Decoder::adrpMem_impl; }
|
||||
virtual reloc_insn adrpAdd() { return &AArch64Decoder::adrpAdd_impl; }
|
||||
virtual reloc_insn adrpMovk() { return &AArch64Decoder::adrpMovk_impl; }
|
||||
class Decoder : public RelocActions {
|
||||
virtual reloc_insn adrpMem() { return &Decoder::adrpMem_impl; }
|
||||
virtual reloc_insn adrpAdd() { return &Decoder::adrpAdd_impl; }
|
||||
virtual reloc_insn adrpMovk() { return &Decoder::adrpMovk_impl; }
|
||||
|
||||
public:
|
||||
AArch64Decoder(address insn_addr, uint32_t insn) : RelocActions(insn_addr, insn) {}
|
||||
Decoder(address insn_addr, uint32_t insn) : RelocActions(insn_addr, insn) {}
|
||||
|
||||
virtual int loadStore(address insn_addr, address &target) {
|
||||
intptr_t offset = Instruction_aarch64::sextract(_insn, 23, 5);
|
||||
@@ -491,7 +491,7 @@ public:
|
||||
};
|
||||
|
||||
address MacroAssembler::target_addr_for_insn(address insn_addr, uint32_t insn) {
|
||||
AArch64Decoder decoder(insn_addr, insn);
|
||||
Decoder decoder(insn_addr, insn);
|
||||
address target;
|
||||
decoder.run(insn_addr, target);
|
||||
return target;
|
||||
@@ -1197,110 +1197,6 @@ void MacroAssembler::lookup_interface_method(Register recv_klass,
|
||||
}
|
||||
}
|
||||
|
||||
// Look up the method for a megamorphic invokeinterface call in a single pass over itable:
|
||||
// - check recv_klass (actual object class) is a subtype of resolved_klass from CompiledICHolder
|
||||
// - find a holder_klass (class that implements the method) vtable offset and get the method from vtable by index
|
||||
// The target method is determined by <holder_klass, itable_index>.
|
||||
// The receiver klass is in recv_klass.
|
||||
// On success, the result will be in method_result, and execution falls through.
|
||||
// On failure, execution transfers to the given label.
|
||||
void MacroAssembler::lookup_interface_method_stub(Register recv_klass,
|
||||
Register holder_klass,
|
||||
Register resolved_klass,
|
||||
Register method_result,
|
||||
Register temp_itbl_klass,
|
||||
Register scan_temp,
|
||||
int itable_index,
|
||||
Label& L_no_such_interface) {
|
||||
// 'method_result' is only used as output register at the very end of this method.
|
||||
// Until then we can reuse it as 'holder_offset'.
|
||||
Register holder_offset = method_result;
|
||||
assert_different_registers(resolved_klass, recv_klass, holder_klass, temp_itbl_klass, scan_temp, holder_offset);
|
||||
|
||||
int vtable_start_offset = in_bytes(Klass::vtable_start_offset());
|
||||
int itable_offset_entry_size = itableOffsetEntry::size() * wordSize;
|
||||
int ioffset = in_bytes(itableOffsetEntry::interface_offset());
|
||||
int ooffset = in_bytes(itableOffsetEntry::offset_offset());
|
||||
|
||||
Label L_loop_search_resolved_entry, L_resolved_found, L_holder_found;
|
||||
|
||||
ldrw(scan_temp, Address(recv_klass, Klass::vtable_length_offset()));
|
||||
add(recv_klass, recv_klass, vtable_start_offset + ioffset);
|
||||
// itableOffsetEntry[] itable = recv_klass + Klass::vtable_start_offset() + sizeof(vtableEntry) * recv_klass->_vtable_len;
|
||||
// temp_itbl_klass = itable[0]._interface;
|
||||
int vtblEntrySize = vtableEntry::size_in_bytes();
|
||||
assert(vtblEntrySize == wordSize, "ldr lsl shift amount must be 3");
|
||||
ldr(temp_itbl_klass, Address(recv_klass, scan_temp, Address::lsl(exact_log2(vtblEntrySize))));
|
||||
mov(holder_offset, zr);
|
||||
// scan_temp = &(itable[0]._interface)
|
||||
lea(scan_temp, Address(recv_klass, scan_temp, Address::lsl(exact_log2(vtblEntrySize))));
|
||||
|
||||
// Initial checks:
|
||||
// - if (holder_klass != resolved_klass), go to "scan for resolved"
|
||||
// - if (itable[0] == holder_klass), shortcut to "holder found"
|
||||
// - if (itable[0] == 0), no such interface
|
||||
cmp(resolved_klass, holder_klass);
|
||||
br(Assembler::NE, L_loop_search_resolved_entry);
|
||||
cmp(holder_klass, temp_itbl_klass);
|
||||
br(Assembler::EQ, L_holder_found);
|
||||
cbz(temp_itbl_klass, L_no_such_interface);
|
||||
|
||||
// Loop: Look for holder_klass record in itable
|
||||
// do {
|
||||
// temp_itbl_klass = *(scan_temp += itable_offset_entry_size);
|
||||
// if (temp_itbl_klass == holder_klass) {
|
||||
// goto L_holder_found; // Found!
|
||||
// }
|
||||
// } while (temp_itbl_klass != 0);
|
||||
// goto L_no_such_interface // Not found.
|
||||
Label L_search_holder;
|
||||
bind(L_search_holder);
|
||||
ldr(temp_itbl_klass, Address(pre(scan_temp, itable_offset_entry_size)));
|
||||
cmp(holder_klass, temp_itbl_klass);
|
||||
br(Assembler::EQ, L_holder_found);
|
||||
cbnz(temp_itbl_klass, L_search_holder);
|
||||
|
||||
b(L_no_such_interface);
|
||||
|
||||
// Loop: Look for resolved_class record in itable
|
||||
// while (true) {
|
||||
// temp_itbl_klass = *(scan_temp += itable_offset_entry_size);
|
||||
// if (temp_itbl_klass == 0) {
|
||||
// goto L_no_such_interface;
|
||||
// }
|
||||
// if (temp_itbl_klass == resolved_klass) {
|
||||
// goto L_resolved_found; // Found!
|
||||
// }
|
||||
// if (temp_itbl_klass == holder_klass) {
|
||||
// holder_offset = scan_temp;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
Label L_loop_search_resolved;
|
||||
bind(L_loop_search_resolved);
|
||||
ldr(temp_itbl_klass, Address(pre(scan_temp, itable_offset_entry_size)));
|
||||
bind(L_loop_search_resolved_entry);
|
||||
cbz(temp_itbl_klass, L_no_such_interface);
|
||||
cmp(resolved_klass, temp_itbl_klass);
|
||||
br(Assembler::EQ, L_resolved_found);
|
||||
cmp(holder_klass, temp_itbl_klass);
|
||||
br(Assembler::NE, L_loop_search_resolved);
|
||||
mov(holder_offset, scan_temp);
|
||||
b(L_loop_search_resolved);
|
||||
|
||||
// See if we already have a holder klass. If not, go and scan for it.
|
||||
bind(L_resolved_found);
|
||||
cbz(holder_offset, L_search_holder);
|
||||
mov(scan_temp, holder_offset);
|
||||
|
||||
// Finally, scan_temp contains holder_klass vtable offset
|
||||
bind(L_holder_found);
|
||||
ldrw(method_result, Address(scan_temp, ooffset - ioffset));
|
||||
add(recv_klass, recv_klass, itable_index * wordSize + in_bytes(itableMethodEntry::method_offset())
|
||||
- vtable_start_offset - ioffset); // substract offsets to restore the original value of recv_klass
|
||||
ldr(method_result, Address(recv_klass, method_result, Address::uxtw(0)));
|
||||
}
|
||||
|
||||
// virtual method calling
|
||||
void MacroAssembler::lookup_virtual_method(Register recv_klass,
|
||||
RegisterOrConstant vtable_index,
|
||||
@@ -6082,43 +5978,51 @@ void MacroAssembler::leave() {
|
||||
// For more details on PAC see pauth_aarch64.hpp.
|
||||
|
||||
// Sign the LR. Use during construction of a stack frame, before storing the LR to memory.
|
||||
// Uses value zero as the modifier.
|
||||
// Uses the FP as the modifier.
|
||||
//
|
||||
void MacroAssembler::protect_return_address() {
|
||||
if (VM_Version::use_rop_protection()) {
|
||||
check_return_address();
|
||||
paciaz();
|
||||
// The standard convention for C code is to use paciasp, which uses SP as the modifier. This
|
||||
// works because in C code, FP and SP match on function entry. In the JDK, SP and FP may not
|
||||
// match, so instead explicitly use the FP.
|
||||
pacia(lr, rfp);
|
||||
}
|
||||
}
|
||||
|
||||
// Sign the return value in the given register. Use before updating the LR in the existing stack
|
||||
// frame for the current function.
|
||||
// Uses value zero as the modifier.
|
||||
// Uses the FP from the start of the function as the modifier - which is stored at the address of
|
||||
// the current FP.
|
||||
//
|
||||
void MacroAssembler::protect_return_address(Register return_reg) {
|
||||
void MacroAssembler::protect_return_address(Register return_reg, Register temp_reg) {
|
||||
if (VM_Version::use_rop_protection()) {
|
||||
assert(PreserveFramePointer, "PreserveFramePointer must be set for ROP protection");
|
||||
check_return_address(return_reg);
|
||||
paciza(return_reg);
|
||||
ldr(temp_reg, Address(rfp));
|
||||
pacia(return_reg, temp_reg);
|
||||
}
|
||||
}
|
||||
|
||||
// Authenticate the LR. Use before function return, after restoring FP and loading LR from memory.
|
||||
// Uses value zero as the modifier.
|
||||
//
|
||||
void MacroAssembler::authenticate_return_address() {
|
||||
void MacroAssembler::authenticate_return_address(Register return_reg) {
|
||||
if (VM_Version::use_rop_protection()) {
|
||||
autiaz();
|
||||
check_return_address();
|
||||
autia(return_reg, rfp);
|
||||
check_return_address(return_reg);
|
||||
}
|
||||
}
|
||||
|
||||
// Authenticate the return value in the given register. Use before updating the LR in the existing
|
||||
// stack frame for the current function.
|
||||
// Uses value zero as the modifier.
|
||||
// Uses the FP from the start of the function as the modifier - which is stored at the address of
|
||||
// the current FP.
|
||||
//
|
||||
void MacroAssembler::authenticate_return_address(Register return_reg) {
|
||||
void MacroAssembler::authenticate_return_address(Register return_reg, Register temp_reg) {
|
||||
if (VM_Version::use_rop_protection()) {
|
||||
autiza(return_reg);
|
||||
assert(PreserveFramePointer, "PreserveFramePointer must be set for ROP protection");
|
||||
ldr(temp_reg, Address(rfp));
|
||||
autia(return_reg, temp_reg);
|
||||
check_return_address(return_reg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -716,9 +716,9 @@ public:
|
||||
|
||||
// ROP Protection
|
||||
void protect_return_address();
|
||||
void protect_return_address(Register return_reg);
|
||||
void authenticate_return_address();
|
||||
void authenticate_return_address(Register return_reg);
|
||||
void protect_return_address(Register return_reg, Register temp_reg);
|
||||
void authenticate_return_address(Register return_reg = lr);
|
||||
void authenticate_return_address(Register return_reg, Register temp_reg);
|
||||
void strip_return_address();
|
||||
void check_return_address(Register return_reg=lr) PRODUCT_RETURN;
|
||||
|
||||
@@ -942,15 +942,6 @@ public:
|
||||
Label& no_such_interface,
|
||||
bool return_method = true);
|
||||
|
||||
void lookup_interface_method_stub(Register recv_klass,
|
||||
Register holder_klass,
|
||||
Register resolved_klass,
|
||||
Register method_result,
|
||||
Register temp_reg,
|
||||
Register temp_reg2,
|
||||
int itable_index,
|
||||
Label& L_no_such_interface);
|
||||
|
||||
// virtual method calling
|
||||
// n.b. x86 allows RegisterOrConstant for vtable_index
|
||||
void lookup_virtual_method(Register recv_klass,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "code/codeCache.hpp"
|
||||
#include "code/compiledIC.hpp"
|
||||
#include "gc/shared/collectedHeap.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "nativeInst_aarch64.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/handles.hpp"
|
||||
@@ -158,18 +159,13 @@ void NativeGotJump::verify() const {
|
||||
}
|
||||
|
||||
address NativeCall::destination() const {
|
||||
address addr = instruction_address();
|
||||
address destination = addr + displacement();
|
||||
|
||||
// Performance optimization: no need to call find_blob() if it is a self-call
|
||||
if (destination == addr) {
|
||||
return destination;
|
||||
}
|
||||
address addr = (address)this;
|
||||
address destination = instruction_address() + displacement();
|
||||
|
||||
// Do we use a trampoline stub for this call?
|
||||
CodeBlob* cb = CodeCache::find_blob(addr);
|
||||
assert(cb != nullptr && cb->is_nmethod(), "nmethod expected");
|
||||
nmethod *nm = cb->as_nmethod();
|
||||
assert(cb && cb->is_nmethod(), "sanity");
|
||||
nmethod *nm = (nmethod *)cb;
|
||||
if (nm->stub_contains(destination) && is_NativeCallTrampolineStub_at(destination)) {
|
||||
// Yes we do, so get the destination from the trampoline stub.
|
||||
const address trampoline_stub_addr = destination;
|
||||
@@ -184,11 +180,17 @@ address NativeCall::destination() const {
|
||||
// call instruction at all times.
|
||||
//
|
||||
// Used in the runtime linkage of calls; see class CompiledIC.
|
||||
void NativeCall::set_destination_mt_safe(address dest) {
|
||||
assert((Patching_lock->is_locked() || SafepointSynchronize::is_at_safepoint()) ||
|
||||
//
|
||||
// Add parameter assert_lock to switch off assertion
|
||||
// during code generation, where no patching lock is needed.
|
||||
void NativeCall::set_destination_mt_safe(address dest, bool assert_lock) {
|
||||
assert(!assert_lock ||
|
||||
(Patching_lock->is_locked() || SafepointSynchronize::is_at_safepoint()) ||
|
||||
CompiledICLocker::is_safe(addr_at(0)),
|
||||
"concurrent code patching");
|
||||
|
||||
ResourceMark rm;
|
||||
int code_size = NativeInstruction::instruction_size;
|
||||
address addr_call = addr_at(0);
|
||||
bool reachable = Assembler::reachable_from_branch_at(addr_call, dest);
|
||||
assert(NativeCall::is_call_at(addr_call), "unexpected code at call site");
|
||||
@@ -212,18 +214,22 @@ void NativeCall::set_destination_mt_safe(address dest) {
|
||||
}
|
||||
|
||||
address NativeCall::get_trampoline() {
|
||||
address call_addr = instruction_address();
|
||||
address call_addr = addr_at(0);
|
||||
|
||||
CodeBlob *code = CodeCache::find_blob(call_addr);
|
||||
assert(code != nullptr && code->is_nmethod(), "nmethod expected");
|
||||
nmethod* nm = code->as_nmethod();
|
||||
assert(code != nullptr, "Could not find the containing code blob");
|
||||
|
||||
address bl_destination = call_addr + displacement();
|
||||
if (nm->stub_contains(bl_destination) &&
|
||||
address bl_destination
|
||||
= MacroAssembler::pd_call_destination(call_addr);
|
||||
if (code->contains(bl_destination) &&
|
||||
is_NativeCallTrampolineStub_at(bl_destination))
|
||||
return bl_destination;
|
||||
|
||||
return trampoline_stub_Relocation::get_trampoline_for(call_addr, nm);
|
||||
if (code->is_nmethod()) {
|
||||
return trampoline_stub_Relocation::get_trampoline_for(call_addr, (nmethod*)code);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Inserts a native call instruction at a given pc
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2108, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -212,7 +212,6 @@ public:
|
||||
int displacement() const { return (int_at(displacement_offset) << 6) >> 4; }
|
||||
address displacement_address() const { return addr_at(displacement_offset); }
|
||||
address return_address() const { return addr_at(return_address_offset); }
|
||||
address raw_destination() const { return instruction_address() + displacement(); }
|
||||
address destination() const;
|
||||
|
||||
void set_destination(address dest) {
|
||||
@@ -252,7 +251,9 @@ public:
|
||||
//
|
||||
// Used in the runtime linkage of calls; see class CompiledIC.
|
||||
// (Cf. 4506997 and 4479829, where threads witnessed garbage displacements.)
|
||||
void set_destination_mt_safe(address dest);
|
||||
|
||||
// The parameter assert_lock disables the assertion during code generation.
|
||||
void set_destination_mt_safe(address dest, bool assert_lock = true);
|
||||
|
||||
address get_trampoline();
|
||||
#if INCLUDE_JVMCI
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, 2023, Arm Limited. All rights reserved.
|
||||
* Copyright (c) 2021, 2022, Arm Limited. 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
|
||||
@@ -77,9 +77,9 @@ inline bool pauth_ptr_is_raw(address ptr) {
|
||||
// Strip a return value (same as pauth_strip_pointer). When debug is enabled then authenticate
|
||||
// instead.
|
||||
//
|
||||
inline address pauth_strip_verifiable(address ret_addr) {
|
||||
inline address pauth_strip_verifiable(address ret_addr, address modifier) {
|
||||
if (VM_Version::use_rop_protection()) {
|
||||
DEBUG_ONLY(ret_addr = pauth_authenticate_return_address(ret_addr);)
|
||||
DEBUG_ONLY(ret_addr = pauth_authenticate_return_address(ret_addr, modifier);)
|
||||
NOT_DEBUG(ret_addr = pauth_strip_pointer(ret_addr));
|
||||
}
|
||||
return ret_addr;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -52,7 +52,7 @@ class Register {
|
||||
|
||||
public:
|
||||
// accessors
|
||||
constexpr int raw_encoding() const { return checked_cast<int>(this - first()); }
|
||||
constexpr int raw_encoding() const { return this - first(); }
|
||||
constexpr int encoding() const { assert(is_valid(), "invalid register"); return raw_encoding(); }
|
||||
constexpr bool is_valid() const { return 0 <= raw_encoding() && raw_encoding() < number_of_registers; }
|
||||
|
||||
@@ -175,7 +175,7 @@ class FloatRegister {
|
||||
|
||||
public:
|
||||
// accessors
|
||||
constexpr int raw_encoding() const { return checked_cast<int>(this - first()); }
|
||||
constexpr int raw_encoding() const { return this - first(); }
|
||||
constexpr int encoding() const { assert(is_valid(), "invalid register"); return raw_encoding(); }
|
||||
constexpr bool is_valid() const { return 0 <= raw_encoding() && raw_encoding() < number_of_registers; }
|
||||
|
||||
@@ -308,7 +308,7 @@ public:
|
||||
|
||||
public:
|
||||
// accessors
|
||||
int raw_encoding() const { return checked_cast<int>(this - first()); }
|
||||
int raw_encoding() const { return this - first(); }
|
||||
int encoding() const { assert(is_valid(), "invalid register"); return raw_encoding(); }
|
||||
bool is_valid() const { return 0 <= raw_encoding() && raw_encoding() < number_of_registers; }
|
||||
bool is_governing() const { return 0 <= raw_encoding() && raw_encoding() < number_of_governing_registers; }
|
||||
|
||||
@@ -60,12 +60,13 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
|
||||
|
||||
address Relocation::pd_call_destination(address orig_addr) {
|
||||
assert(is_call(), "should be a call here");
|
||||
if (orig_addr == nullptr) {
|
||||
if (NativeCall::is_call_at(addr())) {
|
||||
NativeCall* call = nativeCall_at(addr());
|
||||
return call->destination();
|
||||
if (NativeCall::is_call_at(addr())) {
|
||||
address trampoline = nativeCall_at(addr())->get_trampoline();
|
||||
if (trampoline) {
|
||||
return nativeCallTrampolineStub_at(trampoline)->destination();
|
||||
}
|
||||
} else {
|
||||
}
|
||||
if (orig_addr != nullptr) {
|
||||
address new_addr = MacroAssembler::pd_call_destination(orig_addr);
|
||||
// If call is branch to self, don't try to relocate it, just leave it
|
||||
// as branch to self. This happens during code generation if the code
|
||||
@@ -81,26 +82,16 @@ address Relocation::pd_call_destination(address orig_addr) {
|
||||
void Relocation::pd_set_call_destination(address x) {
|
||||
assert(is_call(), "should be a call here");
|
||||
if (NativeCall::is_call_at(addr())) {
|
||||
NativeCall* call = nativeCall_at(addr());
|
||||
call->set_destination(x);
|
||||
} else {
|
||||
MacroAssembler::pd_patch_instruction(addr(), x);
|
||||
address trampoline = nativeCall_at(addr())->get_trampoline();
|
||||
if (trampoline) {
|
||||
nativeCall_at(addr())->set_destination_mt_safe(x, /* assert_lock */false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
MacroAssembler::pd_patch_instruction(addr(), x);
|
||||
assert(pd_call_destination(addr()) == x, "fail in reloc");
|
||||
}
|
||||
|
||||
void trampoline_stub_Relocation::pd_fix_owner_after_move() {
|
||||
NativeCall* call = nativeCall_at(owner());
|
||||
assert(call->raw_destination() == owner(), "destination should be empty");
|
||||
address trampoline = addr();
|
||||
address dest = nativeCallTrampolineStub_at(trampoline)->destination();
|
||||
if (!Assembler::reachable_from_branch_at(owner(), dest)) {
|
||||
dest = trampoline;
|
||||
}
|
||||
call->set_destination(dest);
|
||||
}
|
||||
|
||||
|
||||
address* Relocation::pd_address_in_code() {
|
||||
return (address*)(addr() + 8);
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
|
||||
uint int_args = 0;
|
||||
uint fp_args = 0;
|
||||
uint stk_args = 0;
|
||||
uint stk_args = 0; // inc by 2 each time
|
||||
|
||||
for (int i = 0; i < total_args_passed; i++) {
|
||||
switch (sig_bt[i]) {
|
||||
@@ -322,9 +322,8 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
if (int_args < Argument::n_int_register_parameters_j) {
|
||||
regs[i].set1(INT_ArgReg[int_args++]->as_VMReg());
|
||||
} else {
|
||||
stk_args = align_up(stk_args, 2);
|
||||
regs[i].set1(VMRegImpl::stack2reg(stk_args));
|
||||
stk_args += 1;
|
||||
stk_args += 2;
|
||||
}
|
||||
break;
|
||||
case T_VOID:
|
||||
@@ -341,7 +340,6 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
if (int_args < Argument::n_int_register_parameters_j) {
|
||||
regs[i].set2(INT_ArgReg[int_args++]->as_VMReg());
|
||||
} else {
|
||||
stk_args = align_up(stk_args, 2);
|
||||
regs[i].set2(VMRegImpl::stack2reg(stk_args));
|
||||
stk_args += 2;
|
||||
}
|
||||
@@ -350,9 +348,8 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
if (fp_args < Argument::n_float_register_parameters_j) {
|
||||
regs[i].set1(FP_ArgReg[fp_args++]->as_VMReg());
|
||||
} else {
|
||||
stk_args = align_up(stk_args, 2);
|
||||
regs[i].set1(VMRegImpl::stack2reg(stk_args));
|
||||
stk_args += 1;
|
||||
stk_args += 2;
|
||||
}
|
||||
break;
|
||||
case T_DOUBLE:
|
||||
@@ -360,7 +357,6 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
if (fp_args < Argument::n_float_register_parameters_j) {
|
||||
regs[i].set2(FP_ArgReg[fp_args++]->as_VMReg());
|
||||
} else {
|
||||
stk_args = align_up(stk_args, 2);
|
||||
regs[i].set2(VMRegImpl::stack2reg(stk_args));
|
||||
stk_args += 2;
|
||||
}
|
||||
@@ -371,7 +367,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
}
|
||||
}
|
||||
|
||||
return stk_args;
|
||||
return align_up(stk_args, 2);
|
||||
}
|
||||
|
||||
// Patch the callers callsite with entry to compiled code if it exists.
|
||||
@@ -394,7 +390,7 @@ static void patch_callers_callsite(MacroAssembler *masm) {
|
||||
|
||||
__ mov(c_rarg0, rmethod);
|
||||
__ mov(c_rarg1, lr);
|
||||
__ authenticate_return_address(c_rarg1);
|
||||
__ authenticate_return_address(c_rarg1, rscratch1);
|
||||
__ lea(rscratch1, RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::fixup_callers_callsite)));
|
||||
__ blr(rscratch1);
|
||||
|
||||
@@ -1171,7 +1167,6 @@ static void gen_continuation_enter(MacroAssembler* masm,
|
||||
continuation_enter_cleanup(masm);
|
||||
|
||||
__ ldr(c_rarg1, Address(rfp, wordSize)); // return address
|
||||
__ authenticate_return_address(c_rarg1);
|
||||
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::exception_handler_for_return_address), rthread, c_rarg1);
|
||||
|
||||
// see OptoRuntime::generate_exception_blob: r0 -- exception oop, r3 -- exception pc
|
||||
@@ -2338,7 +2333,7 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
// load throwing pc from JavaThread and patch it as the return address
|
||||
// of the current frame. Then clear the field in JavaThread
|
||||
__ ldr(r3, Address(rthread, JavaThread::exception_pc_offset()));
|
||||
__ protect_return_address(r3);
|
||||
__ protect_return_address(r3, rscratch1);
|
||||
__ str(r3, Address(rfp, wordSize));
|
||||
__ str(zr, Address(rthread, JavaThread::exception_pc_offset()));
|
||||
|
||||
@@ -2444,7 +2439,9 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
__ ldrw(r2, Address(r5, Deoptimization::UnrollBlock::size_of_deoptimized_frame_offset()));
|
||||
__ sub(r2, r2, 2 * wordSize);
|
||||
__ add(sp, sp, r2);
|
||||
__ ldp(rfp, zr, __ post(sp, 2 * wordSize));
|
||||
__ ldp(rfp, lr, __ post(sp, 2 * wordSize));
|
||||
__ authenticate_return_address();
|
||||
// LR should now be the return address to the caller (3)
|
||||
|
||||
#ifdef ASSERT
|
||||
// Compilers generate code that bang the stack by as much as the
|
||||
@@ -2659,7 +2656,9 @@ void SharedRuntime::generate_uncommon_trap_blob() {
|
||||
size_of_deoptimized_frame_offset()));
|
||||
__ sub(r2, r2, 2 * wordSize);
|
||||
__ add(sp, sp, r2);
|
||||
__ ldp(rfp, zr, __ post(sp, 2 * wordSize));
|
||||
__ ldp(rfp, lr, __ post(sp, 2 * wordSize));
|
||||
__ authenticate_return_address();
|
||||
// LR should now be the return address to the caller (3) frame
|
||||
|
||||
#ifdef ASSERT
|
||||
// Compilers generate code that bang the stack by as much as the
|
||||
@@ -2805,7 +2804,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t
|
||||
// it later to determine if someone changed the return address for
|
||||
// us!
|
||||
__ ldr(r20, Address(rthread, JavaThread::saved_exception_pc_offset()));
|
||||
__ protect_return_address(r20);
|
||||
__ protect_return_address(r20, rscratch1);
|
||||
__ str(r20, Address(rfp, wordSize));
|
||||
}
|
||||
|
||||
@@ -2846,7 +2845,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t
|
||||
__ ldr(rscratch1, Address(rfp, wordSize));
|
||||
__ cmp(r20, rscratch1);
|
||||
__ br(Assembler::NE, no_adjust);
|
||||
__ authenticate_return_address(r20);
|
||||
__ authenticate_return_address(r20, rscratch1);
|
||||
|
||||
#ifdef ASSERT
|
||||
// Verify the correct encoding of the poll we're about to skip.
|
||||
@@ -2861,7 +2860,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t
|
||||
#endif
|
||||
// Adjust return pc forward to step over the safepoint poll instruction
|
||||
__ add(r20, r20, NativeInstruction::instruction_size);
|
||||
__ protect_return_address(r20);
|
||||
__ protect_return_address(r20, rscratch1);
|
||||
__ str(r20, Address(rfp, wordSize));
|
||||
}
|
||||
|
||||
|
||||
@@ -30,15 +30,8 @@
|
||||
|
||||
// Java frames don't have callee saved registers (except for rfp), so we can use a smaller RegisterMap
|
||||
class SmallRegisterMap {
|
||||
constexpr SmallRegisterMap() = default;
|
||||
~SmallRegisterMap() = default;
|
||||
NONCOPYABLE(SmallRegisterMap);
|
||||
|
||||
public:
|
||||
static const SmallRegisterMap* instance() {
|
||||
static constexpr SmallRegisterMap the_instance{};
|
||||
return &the_instance;
|
||||
}
|
||||
static constexpr SmallRegisterMap* instance = nullptr;
|
||||
private:
|
||||
static void assert_is_rfp(VMReg r) NOT_DEBUG_RETURN
|
||||
DEBUG_ONLY({ assert (r == rfp->as_VMReg() || r == rfp->as_VMReg()->next(), "Reg: %s", r->name()); })
|
||||
@@ -55,6 +48,17 @@ public:
|
||||
return map;
|
||||
}
|
||||
|
||||
SmallRegisterMap() {}
|
||||
|
||||
SmallRegisterMap(const RegisterMap* map) {
|
||||
#ifdef ASSERT
|
||||
for(int i = 0; i < RegisterMap::reg_count; i++) {
|
||||
VMReg r = VMRegImpl::as_VMReg(i);
|
||||
if (map->location(r, (intptr_t*)nullptr) != nullptr) assert_is_rfp(r);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
inline address location(VMReg reg, intptr_t* sp) const {
|
||||
assert_is_rfp(reg);
|
||||
return (address)(sp - frame::sender_sp_offset);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2022, 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
|
||||
@@ -26,7 +26,6 @@
|
||||
#define CPU_AARCH64_STACKCHUNKFRAMESTREAM_AARCH64_INLINE_HPP
|
||||
|
||||
#include "interpreter/oopMapCache.hpp"
|
||||
#include "pauth_aarch64.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/registerMap.hpp"
|
||||
|
||||
@@ -35,7 +34,7 @@ template <ChunkFrames frame_kind>
|
||||
inline bool StackChunkFrameStream<frame_kind>::is_in_frame(void* p0) const {
|
||||
assert(!is_done(), "");
|
||||
intptr_t* p = (intptr_t*)p0;
|
||||
int argsize = is_compiled() ? (_cb->as_nmethod()->num_stack_arg_slots() * VMRegImpl::stack_slot_size) >> LogBytesPerWord : 0;
|
||||
int argsize = is_compiled() ? (_cb->as_compiled_method()->method()->num_stack_arg_slots() * VMRegImpl::stack_slot_size) >> LogBytesPerWord : 0;
|
||||
int frame_size = _cb->frame_size() + argsize;
|
||||
return p == sp() - frame::sender_sp_offset || ((p - unextended_sp()) >= 0 && (p - unextended_sp()) < frame_size);
|
||||
}
|
||||
@@ -53,8 +52,7 @@ inline frame StackChunkFrameStream<frame_kind>::to_frame() const {
|
||||
template <ChunkFrames frame_kind>
|
||||
inline address StackChunkFrameStream<frame_kind>::get_pc() const {
|
||||
assert(!is_done(), "");
|
||||
// Just strip it for frames on the heap.
|
||||
return pauth_strip_pointer(*(address*)(_sp - 1));
|
||||
return *(address*)(_sp - 1);
|
||||
}
|
||||
|
||||
template <ChunkFrames frame_kind>
|
||||
@@ -116,8 +114,8 @@ inline int StackChunkFrameStream<frame_kind>::interpreter_frame_num_oops() const
|
||||
f.interpreted_frame_oop_map(&mask);
|
||||
return mask.num_oops()
|
||||
+ 1 // for the mirror oop
|
||||
+ pointer_delta_as_int((intptr_t*)f.interpreter_frame_monitor_begin(),
|
||||
(intptr_t*)f.interpreter_frame_monitor_end())/BasicObjectLock::size();
|
||||
+ ((intptr_t*)f.interpreter_frame_monitor_begin()
|
||||
- (intptr_t*)f.interpreter_frame_monitor_end())/BasicObjectLock::size();
|
||||
}
|
||||
|
||||
template<>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user