On Wed, 28 May 2025 14:24:47 GMT, Doug Simon <dnsi...@openjdk.org> wrote:

> There are plans to have libgraal be built for JDK master using a version of 
> Native Image running on a JDK one version behind the current JDK. This Native 
> Image execution needs to be able to load the JVMCI classes. As such, the 
> JVMCI classes must have a class file major version of N-1 where N is the 
> major class file version of the current JDK.

I don't think this is a good way. We should not call to shell to make 
calculations in the makefiles; if that were needed, it should be done in 
configure. However, we are already doing this, or at least something very 
similar. Have a look at line 398 in boot-jdk.m4. We set up `OLDEST_BOOT_JDK` as 
the oldest JDK from the list in version-numbers.conf. 

That should, I think, match your expectation of N-1. There is always a bit 
uncertainty how you want these things to be handled around the version 
rollover, and I'm not sure about your use case in those situations. But in 
general, the oldest boot JDK will match the version number actually used in the 
build as the boot JDK, that is, N-1.

Now, OLDEST_BOOT_JDK is not exported to make. But that is however:

BOOT_JDK_SOURCETARGET="-source $OLDEST_BOOT_JDK -target $OLDEST_BOOT_JDK 
-Xlint:-options"

which is almost, but not exactly, what you were planning to add. The added 
`-Xlint:-options` is harmless afaict, and I think was likely added at some 
point due to option mismatch between N and N-1 javac lint support, so I think 
it would make sense for you to use it as well.

So, in essense, my suggestion boils down to that you should only add 
`$(BOOT_JDK_SOURCETARGET)` to your command line.

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

PR Comment: https://git.openjdk.org/jdk/pull/25494#issuecomment-2931378030

Reply via email to