**Problem:**

When cross-compiling, `PlatformProps.java` is regenerated during every 
incremental `make images` build, even when no source files have changed. This 
causes `java.base` and the JDK image to be rebuilt unnecessarily, increasing 
the build time.

The second build produced output such as:


make CONF=linux-x86_64-server-release LOG=debug images > build.log 2>&1
rg -n 'Processing PlatformProps.java|Compiling up to .* files for 
java.base|Creating jdk image' build.log



Processing PlatformProps.java
[buildjdk] Processing PlatformProps.java
Compiling up to 3396 files for java.base
[buildjdk] Compiling up to 3396 files for java.base
Creating jdk image


**Fix:**

Include the target OS and CPU in the name of `BUILD_PLATFORMPROPERTIES_JAVA`, 
so that the build JDK and target JDK use separate variable-dependency files and 
do not overwrite each other’s build state.

**Testing:**

Ran `make images` again without modifying any source files. The second build 
completed in about two seconds and no longer processed `PlatformProps.java`, 
rebuilt `java.base`, or recreated the JDK image.

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

-------------

Commit messages:
 - 8348737: PlatformProperties always triggers rebuild when cross compiling

Changes: https://git.openjdk.org/jdk/pull/32593/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=32593&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8348737
  Stats: 4 lines in 1 file changed: 1 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/32593.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/32593/head:pull/32593

PR: https://git.openjdk.org/jdk/pull/32593

Reply via email to