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

Zero fails to build on linux-sparc due to sparc-specific code

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 10
    • 10
    • hotspot
    • None
    • b31
    • sparc

      Trying to build Zero on linux-sparc initially fails with:

      === Output from failing command(s) repeated here ===
      /usr/bin/printf "* For target hotspot_variant-zero_libjvm_objs_oopMap.o:\n"
      * For target hotspot_variant-zero_libjvm_objs_oopMap.o:
      (/bin/grep -v -e "^Note: including file:" < /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs/hotspot_variant-zero_libjvm_objs_oopMap.o.log || true) | /usr/bin/head -n 12
      /home/glaubitz/openjdk/hs/hotspot/src/share/vm/compiler/oopMap.cpp:44:10: fatal error: vmreg_sparc.inline.hpp: No such file or directory
       #include "vmreg_sparc.inline.hpp"
                ^~~~~~~~~~~~~~~~~~~~~~~~
      compilation terminated.
      if test `/usr/bin/wc -l < /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs/hotspot_variant-zero_libjvm_objs_oopMap.o.log` -gt 12; then /bin/echo " ... (rest of output omitted)" ; fi
      /usr/bin/printf "\n* All command lines available in /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs.\n"

      * All command lines available in /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs.
      /usr/bin/printf "=== End of repeated output ===\n"
      === End of repeated output ===

      This can be alleviated with the following change:

      diff -r eed8aa5e12df src/share/vm/compiler/oopMap.cpp
      --- a/src/share/vm/compiler/oopMap.cpp Tue Aug 22 08:37:17 2017 -0400
      +++ b/src/share/vm/compiler/oopMap.cpp Tue Aug 22 17:41:51 2017 +0300
      @@ -40,7 +40,7 @@
       #ifdef COMPILER2
       #include "opto/optoreg.hpp"
       #endif
      -#ifdef SPARC
      +#if defined (SPARC) && !defined(ZERO)
       #include "vmreg_sparc.inline.hpp"
       #endif

      After that, it will still fail with:

      === Output from failing command(s) repeated here ===
      /usr/bin/printf "* For target hotspot_variant-zero_libjvm_gtest_objs_BUILD_GTEST_LIBJVM_link:\n"
      * For target hotspot_variant-zero_libjvm_gtest_objs_BUILD_GTEST_LIBJVM_link:
      (/bin/grep -v -e "^Note: including file:" < /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs/hotspot_variant-zero_libjvm_gtest_objs_BUILD_GTEST_LIBJVM_link.log || true) | /usr/bin/head -n 12
      /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/hotspot/variant-zero/libjvm/gtest/objs/test_memset_with_concurrent_readers.o: In function `gc_memset_with_concurrent_readers_test_Test::TestBody()':
      /home/glaubitz/openjdk/hs/hotspot/test/native/gc/shared/test_memset_with_concurrent_readers.cpp:66: undefined reference to `memset_with_concurrent_readers(void*, int, unsigned long)'
      /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/hotspot/variant-zero/libjvm/objs/blockOffsetTable.o: In function `BlockOffsetSharedArray::fill_range(unsigned long, unsigned long, unsigned char)':
      /home/glaubitz/openjdk/hs/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159: undefined reference to `memset_with_concurrent_readers(void*, int, unsigned long)'
      /home/glaubitz/openjdk/hs/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159: undefined reference to `memset_with_concurrent_readers(void*, int, unsigned long)'
      /home/glaubitz/openjdk/hs/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159: undefined reference to `memset_with_concurrent_readers(void*, int, unsigned long)'
      /home/glaubitz/openjdk/hs/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159: undefined reference to `memset_with_concurrent_readers(void*, int, unsigned long)'
      /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/hotspot/variant-zero/libjvm/objs/blockOffsetTable.o:/home/glaubitz/openjdk/hs/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159: more undefined references to `memset_with_concurrent_readers(void*, int, unsigned long)' follow
      collect2: error: ld returned 1 exit status
      if test `/usr/bin/wc -l < /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs/hotspot_variant-zero_libjvm_gtest_objs_BUILD_GTEST_LIBJVM_link.log` -gt 12; then /bin/echo " ... (rest of output omitted)" ; fi
      /usr/bin/printf "* For target hotspot_variant-zero_libjvm_objs_BUILD_LIBJVM_link:\n"
      * For target hotspot_variant-zero_libjvm_objs_BUILD_LIBJVM_link:
      (/bin/grep -v -e "^Note: including file:" < /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs/hotspot_variant-zero_libjvm_objs_BUILD_LIBJVM_link.log || true) | /usr/bin/head -n 12
      /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/hotspot/variant-zero/libjvm/objs/blockOffsetTable.o: In function `BlockOffsetSharedArray::fill_range(unsigned long, unsigned long, unsigned char)':
      /home/glaubitz/openjdk/hs/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159: undefined reference to `memset_with_concurrent_readers(void*, int, unsigned long)'
      /home/glaubitz/openjdk/hs/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159: undefined reference to `memset_with_concurrent_readers(void*, int, unsigned long)'
      /home/glaubitz/openjdk/hs/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159: undefined reference to `memset_with_concurrent_readers(void*, int, unsigned long)'
      /home/glaubitz/openjdk/hs/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159: undefined reference to `memset_with_concurrent_readers(void*, int, unsigned long)'
      /home/glaubitz/openjdk/hs/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159: undefined reference to `memset_with_concurrent_readers(void*, int, unsigned long)'
      /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/hotspot/variant-zero/libjvm/objs/blockOffsetTable.o:/home/glaubitz/openjdk/hs/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159: more undefined references to `memset_with_concurrent_readers(void*, int, unsigned long)' follow
      collect2: error: ld returned 1 exit status
      if test `/usr/bin/wc -l < /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs/hotspot_variant-zero_libjvm_objs_BUILD_LIBJVM_link.log` -gt 12; then /bin/echo " ... (rest of output omitted)" ; fi
      /usr/bin/printf "\n* All command lines available in /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs.\n"

      * All command lines available in /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs.
      /usr/bin/printf "=== End of repeated output ===\n"
      === End of repeated output ===

      which again can be fixed with:

      diff -r eed8aa5e12df src/share/vm/gc/shared/memset_with_concurrent_readers.hpp
      --- a/src/share/vm/gc/shared/memset_with_concurrent_readers.hpp Tue Aug 22 08:37:17 2017 -0400
      +++ b/src/share/vm/gc/shared/memset_with_concurrent_readers.hpp Tue Aug 22 17:41:51 2017 +0300
      @@ -37,7 +37,7 @@
       // understanding that there may be concurrent readers of that memory.
       void memset_with_concurrent_readers(void* to, int value, size_t size);
       
      -#ifdef SPARC
      +#if defined(SPARC) && !defined(ZERO)
       
       // SPARC requires special handling. See SPARC-specific definition.

      With both changes, the Zero build succeeds without any problems. I am not sure yet, however, whether the above changes are rather a bad workaround or the acceptable fix.

      Build with:

      sh ./configure && make clean CONF=linux-sparcv9-normal-zero-release && MAKE_VERBOSE=y QUIETLY= LOG=debug sh ./configure --with-jvm-variants=zero --with-boot-jdk=/usr/lib/jvm/java-9-openjdk-sparc64 --disable-precompiled-headers --with-debug-level=release --disable-warnings-as-errors --disable-javac-server --with-num-cores=16 && make JOBS=16 MAKE_VERBOSE=y QUIETLY= LOG=debug CONF=linux-sparcv9-normal-zero-release

            glaubitz John Paul Adrian Glaubitz
            glaubitz John Paul Adrian Glaubitz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: