Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8202210

jlink uses little-endian for big-endian cross-compilation targets

XMLWordPrintable

    • b11

        Cross-compiling to s390x from x86_64 host with this configuration:

        sh ./configure --disable-warnings-as-errors --with-debug-level=fastdebug --openjdk-target=s390x-linux-gnu --with-boot-jdk=/home/shade/jdk --with-sysroot=/pool/chroots/s390x/ --with-toolchain-path=/pool/chroots/s390x/ --with-freetype-include=/pool/chroots/s390x/usr/include/freetype2/ --with-freetype-lib=/pool/chroots/s390x/usr/lib/s390x-linux-gnu

        The build succeeds normally, but s390x binary fails:

        #
        # A fatal error has been detected by the Java Runtime Environment:
        #
        # Internal Error (/pool/buildbot/slaves/sobornost/jdkX/build/src/hotspot/share/classfile/classLoader.cpp:874), pid=19091, tid=19092
        # assert(new_entry != __null && new_entry->is_modules_image()) failed: No java runtime image present

        Looking at module header, it looks like endianness is mismatched. s390x is big-endian:

             s390x)
              VAR_CPU=s390x
              VAR_CPU_ARCH=s390
              VAR_CPU_BITS=64
              VAR_CPU_ENDIAN=big
              ;;

        Re-running the build with LOG=debug yields:

        $ grep endian build.log
        ...
        /home/shade/shenandoah-jdk/build/linux-s390x-normal-server-fastdebug/buildjdk/jdk/bin/jlink ... --endian little ...
        ...
        ( /home/shade/shenandoah-jdk/build/linux-s390x-normal-server-fastdebug/buildjdk/jdk/bin/jlink ... --endian little ...

        Some configuration got borked along the way. Since native s390x seem to be fine, it looks like cross-compilation issue.

              shade Aleksey Shipilev
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: