diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000..0e6c17e76740d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*.{cpp,hpp,c,h,java,cc,hh,m,mm,S,md,properties,gmk,m4,ac}] +trim_trailing_whitespace = true + +[Makefile] +trim_trailing_whitespace = true diff --git a/.github/actions/do-build/action.yml b/.github/actions/do-build/action.yml index 252105f29fddf..6f2c2ce02180c 100644 --- a/.github/actions/do-build/action.yml +++ b/.github/actions/do-build/action.yml @@ -1,5 +1,5 @@ # -# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ runs: - name: 'Build' id: build run: > - make LOG=info ${{ inputs.make-target }} + make -k LOG=info ${{ inputs.make-target }} || bash ./.github/scripts/gen-build-failure-report.sh "$GITHUB_STEP_SUMMARY" shell: bash diff --git a/.github/actions/upload-bundles/action.yml b/.github/actions/upload-bundles/action.yml index 4e974ae58ba6b..30f4ac03c1e0c 100644 --- a/.github/actions/upload-bundles/action.yml +++ b/.github/actions/upload-bundles/action.yml @@ -32,6 +32,9 @@ inputs: debug-suffix: description: 'File name suffix denoting debug level, possibly empty' required: false + bundle-suffix: + description: 'Bundle name suffix, possibly empty' + required: false runs: using: composite @@ -75,7 +78,7 @@ runs: - name: 'Upload bundles artifact' uses: actions/upload-artifact@v4 with: - name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }} + name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}${{ inputs.bundle-suffix }} path: bundles retention-days: 1 if: steps.bundles.outputs.bundles-found == 'true' diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index b1d4278f8b469..101668b2bd520 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -61,6 +61,9 @@ on: make-arguments: required: false type: string + bundle-suffix: + required: false + type: string jobs: build-linux: @@ -71,10 +74,6 @@ jobs: fail-fast: false matrix: debug-level: ${{ fromJSON(inputs.debug-levels) }} - include: - - debug-level: debug - flags: --with-debug-level=fastdebug - suffix: -debug steps: - name: 'Checkout the JDK source' @@ -118,7 +117,7 @@ jobs: run: > bash configure --with-conf-name=${{ inputs.platform }} - ${{ matrix.flags }} + ${{ matrix.debug-level == 'debug' && '--with-debug-level=fastdebug' || '' }} --with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA} --with-boot-jdk=${{ steps.bootjdk.outputs.path }} --with-jtreg=${{ steps.jtreg.outputs.path }} @@ -133,17 +132,14 @@ jobs: - name: 'Build' id: build uses: ./.github/actions/do-build - env: - # Only build static-libs-bundles for release builds. - # For debug builds, building static-libs often exceeds disk space. - STATIC_LIBS: ${{ matrix.debug-level == 'release' && 'static-libs-bundles' }} with: - make-target: '${{ inputs.make-target }} ${STATIC_LIBS} ${{ inputs.make-arguments }}' + make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}' platform: ${{ inputs.platform }} - debug-suffix: '${{ matrix.suffix }}' + debug-suffix: "${{ matrix.debug-level == 'debug' && '-debug' || '' }}" - name: 'Upload bundles' uses: ./.github/actions/upload-bundles with: platform: ${{ inputs.platform }} - debug-suffix: '${{ matrix.suffix }}' + debug-suffix: "${{ matrix.debug-level == 'debug' && '-debug' || '' }}" + bundle-suffix: ${{ inputs.bundle-suffix }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3ea07501477f8..8dce1d214dc1c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -225,6 +225,43 @@ jobs: make-arguments: ${{ github.event.inputs.make-arguments }} if: needs.prepare.outputs.linux-x64-variants == 'true' + build-linux-x64-static: + name: linux-x64-static + needs: prepare + uses: ./.github/workflows/build-linux.yml + with: + platform: linux-x64 + make-target: 'static-jdk-image' + # There are issues with fastdebug static build in GHA due to space limit. + # Only do release build for now. + debug-levels: '[ "release" ]' + gcc-major-version: '10' + configure-arguments: ${{ github.event.inputs.configure-arguments }} + make-arguments: ${{ github.event.inputs.make-arguments }} + # It currently doesn't produce any bundles, but probably will do in + # the future. + bundle-suffix: "-static" + if: needs.prepare.outputs.linux-x64 == 'true' + + build-linux-x64-static-libs: + name: linux-x64-static-libs + needs: prepare + uses: ./.github/workflows/build-linux.yml + with: + platform: linux-x64 + make-target: 'static-libs-bundles' + # Only build static-libs-bundles for release builds. + # For debug builds, building static-libs often exceeds disk space. + debug-levels: '[ "release" ]' + gcc-major-version: '10' + configure-arguments: ${{ github.event.inputs.configure-arguments }} + make-arguments: ${{ github.event.inputs.make-arguments }} + # Upload static libs bundles separately to avoid interference with normal linux-x64 bundle. + # This bundle is not used by testing jobs, but downstreams use it to check that + # dependent projects, e.g. libgraal, builds fine. + bundle-suffix: "-static-libs" + if: needs.prepare.outputs.linux-x64-variants == 'true' + build-linux-cross-compile: name: linux-cross-compile needs: prepare diff --git a/.gitignore b/.gitignore index b57addfccc9ab..2d82e0d943c11 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ NashornProfile.txt /.cache /.gdbinit /.lldbinit +**/core.[0-9]* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4a338235c1d22..98ede25b88df5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,3 @@ # Contributing to the JDK -Please see the [OpenJDK Developers’ Guide](https://openjdk.org/guide/). +Please see the [OpenJDK Developers' Guide](https://openjdk.org/guide/). diff --git a/doc/building.html b/doc/building.html index 7157848f561ae..1e6f99e97c93d 100644 --- a/doc/building.html +++ b/doc/building.html @@ -586,7 +586,7 @@

Native Compiler Linux -gcc 13.2.0 +gcc 14.2.0 macOS @@ -604,7 +604,7 @@

gcc

The minimum accepted version of gcc is 10.0. Older versions will not be accepted by configure.

The JDK is currently known to compile successfully with gcc version -13.2 or newer.

+14.2 or newer.

In general, any version between these two should be usable.

clang

The minimum accepted version of clang is 13. Older versions will not @@ -1722,6 +1722,20 @@

Building for musl

--with-devkit=$DEVKIT \ --with-sysroot=$SYSROOT

and run make normally.

+

Building for Windows AArch64

+

The Visual Studio Build Tools can be used for building the JDK +without a full Visual Studio installation. To set up the Visual Studio +2022 Build Tools on a Windows AArch64 machine for a native build, launch +the installer as follows in a Windows command prompt:

+
vs_buildtools.exe --quiet --wait --norestart --nocache ^
+--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" ^
+--add Microsoft.VisualStudio.Component.VC.CoreBuildTools ^
+--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 ^
+--add Microsoft.VisualStudio.Component.Windows11SDK.22621
+

To generate Windows AArch64 builds using Cygwin on a Windows x64 +machine, you must set the proper target platform by adding +--openjdk-target=aarch64-unknown-cygwin to your configure +command line.

Build Performance

Building the JDK requires a lot of horsepower. Some of the build tools can be adjusted to utilize more or less of resources such as diff --git a/doc/building.md b/doc/building.md index 04db6e94d1c12..18e030baa9e29 100644 --- a/doc/building.md +++ b/doc/building.md @@ -392,7 +392,7 @@ issues. | Operating system | Toolchain version | | ------------------ | ------------------------------------------- | -| Linux | gcc 13.2.0 | +| Linux | gcc 14.2.0 | | macOS | Apple Xcode 14.3.1 (using clang 14.0.3) | | Windows | Microsoft Visual Studio 2022 version 17.6.5 | @@ -404,7 +404,7 @@ C, and C++14 for C++. The minimum accepted version of gcc is 10.0. Older versions will not be accepted by `configure`. -The JDK is currently known to compile successfully with gcc version 13.2 or +The JDK is currently known to compile successfully with gcc version 14.2 or newer. In general, any version between these two should be usable. @@ -1457,6 +1457,24 @@ sh ./configure --with-jvm-variants=server \ and run `make` normally. +#### Building for Windows AArch64 +The Visual Studio Build Tools can be used for building the JDK without a full +Visual Studio installation. To set up the Visual Studio 2022 Build Tools on a +Windows AArch64 machine for a native build, launch the installer as follows +in a Windows command prompt: + +``` +vs_buildtools.exe --quiet --wait --norestart --nocache ^ +--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" ^ +--add Microsoft.VisualStudio.Component.VC.CoreBuildTools ^ +--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 ^ +--add Microsoft.VisualStudio.Component.Windows11SDK.22621 +``` + +To generate Windows AArch64 builds using Cygwin on a Windows x64 machine, +you must set the proper target platform by adding +`--openjdk-target=aarch64-unknown-cygwin` to your configure command line. + ## Build Performance Building the JDK requires a lot of horsepower. Some of the build tools can be diff --git a/doc/hotspot-style.html b/doc/hotspot-style.html index 9f26fc6636205..7e7f4de362982 100644 --- a/doc/hotspot-style.html +++ b/doc/hotspot-style.html @@ -207,23 +207,38 @@

Source Files

JTReg Tests