RFR 8202210: jlink uses little-endian for big-endian cross-compilation targets (original) (raw)
Aleksey Shipilev shade at redhat.com
Wed Apr 25 09:06:30 UTC 2018
- Previous message (by thread): RFR: 8193213 & 8182731: Make the UseAppCDS option obsolete
- Next message (by thread): RFR 8202210: jlink uses little-endian for big-endian cross-compilation targets
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I was doing the exercise of cross-compiling from x86_64 to most OpenJDK arches, and we have discovered the bug with endianness. Right now, compiling big-endian s390x target on little-endian x86_64 host produces the modules blob that cannot be read on real s390x.
It seems to be a simple overlook in image building, and we should pass target-cpu endianness to jlink. During the build, jlink is called twice: first for the interim image build, then for the final image build. In cross-compilation, it seems only the final image build should take target-cpu endianness.
(Aside: what is our backporting policy for build system bugs? Would love to make the jdk10 backport for this)
Bug: https://bugs.openjdk.java.net/browse/JDK-8202210
Fix:
diff -r 5d2da44780ac make/Images.gmk --- a/make/Images.gmk Wed Apr 25 10:38:07 2018 +0200 +++ b/make/Images.gmk Wed Apr 25 10:55:04 2018 +0200 @@ -117,7 +117,7 @@
JLINK_TOOL := $(JLINK) -J-Djlink.debug=true
--module-path $(IMAGES_OUTPUTDIR)/jmods \
- --endian $(OPENJDK_BUILD_CPU_ENDIAN) \
- --endian $(OPENJDK_TARGET_CPU_ENDIAN)
--release-info $(BASE_RELEASE_FILE)
--order-resources=$(call CommaList, $(JLINK_ORDER_RESOURCES))
--dedup-legal-notices=error-if-not-same-content \
Testing: x86_64 build, s390x cross-compiled build
Thanks, -Aleksey
- Previous message (by thread): RFR: 8193213 & 8182731: Make the UseAppCDS option obsolete
- Next message (by thread): RFR 8202210: jlink uses little-endian for big-endian cross-compilation targets
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]