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

Magnus Ihse Bursie ihse at openjdk.java.net
Tue Nov 3 20:29:53 UTC 2020


On Tue, 3 Nov 2020 20:06:35 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

> 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.

Looks good to me. Thanks for fixing this, it has been highly annoying!

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

Marked as reviewed by ihse (Reviewer).

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



More information about the build-dev mailing list