<div dir="auto"><div><br><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>Od: <strong class="gmail_sendername" dir="auto">Antoni Jankowski</strong> <span dir="auto"><<a href="mailto:antoni.s.jankowski@gmail.com">antoni.s.jankowski@gmail.com</a>></span><br>Date: śr., 17 gru 2025, 12:22<br>Subject: jdk build system is limited<br>To:  <<a href="mailto:members@openjdk.org">members@openjdk.org</a>><br></div><br><br><div dir="ltr"><div dir="ltr"><div>Hi, </div><div><br></div><div>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. </div><div>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 <i>make/autoconf/<a href="http://spec.gmk.in" target="_blank" rel="noreferrer">spec.gmk.in</a></i>,
 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?</div><div><br></div><div>Same story is with the variables defined in <i>make/autoconf/flags-cflags.m4, make/autoconf/flags-ldflags.m4 and make/autoconf/flags-other.m4, </i>like<br>* $2CFLAGS_JDKEXE</div><div>* $2CXXFLAGS_JDKEXE</div><div>* $2CFLAGS_JDKLIB</div><div>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 <i><a href="http://build-spec.gmk.in" target="_blank" rel="noreferrer">build-spec.gmk.in</a></i> 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.</div><div><br></div><div>I wonder if that is a design choice, or perhaps a limitation that was not planned.</div><div>Would you be open for changes that make it a bit easier to introduce a new platform target to <span>openjdk</span>? I'd gladly post a pull request solving the issues mentioned.</div><div><br></div><div>Best regards,</div><div>Antoni Jankowski</div></div><br></div>
</div></div></div>