<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>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.</p>
    <p>/Erik</p>
    <div class="moz-cite-prefix">On 12/17/25 03:44, Alexey Ivanov wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:4a629239-c084-452a-be50-c5587342d374@oracle.com">
      
      Hi Antoni,<br>
      <br>
      This discussion belongs in build-dev mailing list.<br>
      <br>
      -- <br>
      Regards,<br>
      Alexey<br>
      <br>
      <div class="moz-cite-prefix">On 2025-12-17 11:22, Antoni Jankowski
        wrote:<br>
      </div>
      <blockquote type="cite" cite="mid:CAM4sPk-53EY=HqyfxVL7Z2vLjvss-2jeBROPrh=GeQfWT8zAHw@mail.gmail.com">
        <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" moz-do-not-send="true">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" moz-do-not-send="true">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 class="gmail-il">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>
    </blockquote>
  </body>
</html>