RFR: 8338404: Cross-compilation to different endianness fails after JDK-8318913

Magnus Ihse Bursie ihse at openjdk.org
Thu Aug 29 15:12:48 UTC 2024


>From the bug report:

After JDK-8318913, trying to cross-compile to a different endian target than the build host is using, will cause the interim image generation to fail:


[buildjdk] Creating interim jimage
Error: specified --endian LITTLE_ENDIAN does not match endianness of target platform linux-s390
java.io.IOException: specified --endian LITTLE_ENDIAN does not match endianness of target platform linux-s390
        at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.createImageProvider(JlinkTask.java:574)
        at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.createImage(JlinkTask.java:410)
        at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.run(JlinkTask.java:285)
        at jdk.jlink/jdk.tools.jlink.internal.Main.run(Main.java:56)
        at jdk.jlink/jdk.tools.jlink.internal.Main.main(Main.java:34)
InterimImage.gmk:47: recipe for target '/localhome/git/jdk-BAR/build/linux-s390x/support/interim-image/bin/java' failed


This has only been spotted when cross-compiling from x64 to s390x, but it seems to be a general endianness problem.

---

In fact, it was technically a problem with how we generate all interim images, but apparently the platform mistake did not affect jlink apart from when cross-compiling and the endianness was off.

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

Commit messages:
 - Adjust OS name for macosx
 - 8338404: Cross-compilation to different endianness fails after JDK-8318913

Changes: https://git.openjdk.org/jdk/pull/20750/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20750&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8338404
  Stats: 20 lines in 2 files changed: 15 ins; 0 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/20750.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20750/head:pull/20750

PR: https://git.openjdk.org/jdk/pull/20750


More information about the build-dev mailing list