<div dir="auto">Hi Alexey,<div dir="auto"><br></div><div dir="auto">Thank you for passing this to the right mailing list. </div><div dir="auto"><br></div><div dir="auto">Best regards,</div><div dir="auto">Antoni Jankowski </div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">śr., 17 gru 2025, 12:44 użytkownik Alexey Ivanov <<a href="mailto:alexey.ivanov@oracle.com">alexey.ivanov@oracle.com</a>> napisał:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>

  
  <div>
    Hi Antoni,<br>
    <br>
    This discussion belongs in build-dev mailing list.<br>
    <br>
    -- <br>
    Regards,<br>
    Alexey<br>
    <br>
    <div>On 2025-12-17 11:22, Antoni Jankowski
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <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>
      </div>
    </blockquote>
  </div>

</blockquote></div>