RFR: JDK-8255850: Hotspot recompiled on first incremental build

Erik Joelsson erikj at openjdk.java.net
Tue Nov 3 20:15:04 UTC 2020


After building the JDK from clean, the first incremental build of hotspot will recompile all of it. This is caused by a difference in the CFLAGS generated on the second go. The difference is generated in JdkNativeCompilation.gmk, where the module specific java header dir is always added to the list of include dirs. When compiling hotspot the first time, there is no such dir, and so nothing is added, but the second go, later compilation steps have created the base headers dir ($(SUPPORT_OUTPUTDIR)/headers), which is found and picked up in CFLAGS. This difference is then detected by the DependOnVariable construct for libjvm.

The fix here is to make sure SetupJdkLibrary is able to work in a context without a MODULE defined, since that is how libjvm is built. In that case, no java header dir should be added.

While fixing this I decided to go through the whole file and make sure all uses of MODULE were protected when needed.

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

Commit messages:
 - Handle a MODULE free context better in SetupJdk* macros

Changes: https://git.openjdk.java.net/jdk/pull/1041/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1041&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8255850
  Stats: 30 lines in 1 file changed: 23 ins; 0 del; 7 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1041.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1041/head:pull/1041

PR: https://git.openjdk.java.net/jdk/pull/1041



More information about the build-dev mailing list