jdk build system is limited
Erik Joelsson
erik.joelsson at oracle.com
Thu Dec 18 17:01:57 UTC 2025
Hello,
Yes, the limitations in possible cross compiling scenarios is a known
issue. We have so far not had need for cross compiling across different
toolchain types or operating systems. While cleaning this up could be a
worthy goal, please also keep in mind that big changes like this will
require careful review and testing and such resources may be limited, so
such work could potentially drag out. This isn't meant to say don't do
it, I'm just trying to set expectations.
/Erik
On 12/17/25 03:44, Alexey Ivanov wrote:
> Hi Antoni,
>
> This discussion belongs in build-dev mailing list.
>
> --
> Regards,
> Alexey
>
> On 2025-12-17 11:22, Antoni Jankowski wrote:
>> Hi,
>>
>> I've recently studied the jdk21u build system and noticed that at its
>> core it is not meant to handle BUILDJDK and TARGETJDK being made for
>> two very different systems.
>> Many of the FLAGS are shared between the two and in many cases that
>> may be problematic. A good example is the GENDEPS_FLAGS variable,
>> which is only present in one version, just in the
>> /make/autoconf/spec.gmk.in <http://spec.gmk.in>/, meaning that the
>> BUILDJDK gets the same GENDEPS_FLAGS as the TARGETJDK. Shouldn't this
>> variable be split into GENDEPS_FLAGS_TARGET and GENDEPS_FLAGS_BUILD
>> to ensure a correct generation of dependency files in all sorts of
>> cross-compilation scenarios?
>>
>> Same story is with the variables defined in
>> /make/autoconf/flags-cflags.m4, make/autoconf/flags-ldflags.m4 and
>> make/autoconf/flags-other.m4, /like
>> * $2CFLAGS_JDKEXE
>> * $2CXXFLAGS_JDKEXE
>> * $2CFLAGS_JDKLIB
>> as they all depend on the OPENJDK_TARGET_OS variable, which is the
>> same for both TARGETJDK and BUILDJDK. I suppose the root of the
>> problem is right there, where in /build-spec.gmk.in
>> <http://build-spec.gmk.in>/ the OPENJDK_TARGET_OS variable is not
>> overwritten with the value of OPENJDK_BUILD_OS, like it's done with
>> other OPENJDK_TARGET_* variables. I suppose no problems occur when
>> the compiler is shared between the target and the build platforms,
>> even less problems in case of linux or macOS in both cases being the
>> operating system, however in case of the target system differing
>> greatly from the build, the cross-compilation is close to impossible
>> with the current build system.
>>
>> I wonder if that is a design choice, or perhaps a limitation that was
>> not planned.
>> Would you be open for changes that make it a bit easier to introduce
>> a new platform target to openjdk? I'd gladly post a pull request
>> solving the issues mentioned.
>>
>> Best regards,
>> Antoni Jankowski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/build-dev/attachments/20251218/2c4f6c05/attachment-0001.htm>
More information about the build-dev
mailing list