GNU hash style is not available on MIPS

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 16
    • Affects Version/s: 16
    • Component/s: infrastructure
    • None
    • b26

      For fun, I tried to build linux-mips64el-zero-fastdebug, and it cannot be built, because linker complains:

      /usr/lib/gcc-cross/mips64el-linux-gnuabi64/6/../../../../mips64el-linux-gnuabi64/bin/ld: .gnu.hash is incompatible with the MIPS ABI
      collect2: error: ld returned 1 exit status

      I believe it is a regression in 16, as GNU hash style was forced with JDK-8200738.

      Dropping --hash-style=gnu makes mips64el build pass:

      diff --git a/make/autoconf/flags-ldflags.m4 b/make/autoconf/flags-ldflags.m4
      index c2e77905663..8ab342eff6a 100644
      --- a/make/autoconf/flags-ldflags.m4
      +++ b/make/autoconf/flags-ldflags.m4
      @@ -66,7 +66,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
           # Add -z,defs, to forbid undefined symbols in object files.
           # add -z,relro (mark relocations read only) for all libs
           # add -z,now ("full relro" - more of the Global Offset Table GOT is marked read only)
      - BASIC_LDFLAGS="-Wl,--hash-style=gnu -Wl,-z,defs -Wl,-z,relro -Wl,-z,now"
      + BASIC_LDFLAGS="-Wl,-z,defs -Wl,-z,relro -Wl,-z,now"
           # Linux : remove unused code+data in link step
           if test "x$ENABLE_LINKTIME_GC" = xtrue; then
             if test "x$OPENJDK_TARGET_CPU" = xs390x; then

      ...ditto forcing the sysv style:

      diff --git a/make/autoconf/flags-ldflags.m4 b/make/autoconf/flags-ldflags.m4
      index c2e77905663..5f8cb0c4814 100644
      --- a/make/autoconf/flags-ldflags.m4
      +++ b/make/autoconf/flags-ldflags.m4
      @@ -66,7 +66,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
           # Add -z,defs, to forbid undefined symbols in object files.
           # add -z,relro (mark relocations read only) for all libs
           # add -z,now ("full relro" - more of the Global Offset Table GOT is marked read only)
      - BASIC_LDFLAGS="-Wl,--hash-style=gnu -Wl,-z,defs -Wl,-z,relro -Wl,-z,now"
      + BASIC_LDFLAGS="-Wl,--hash-style=sysv -Wl,-z,defs -Wl,-z,relro -Wl,-z,now"
           # Linux : remove unused code+data in link step
           if test "x$ENABLE_LINKTIME_GC" = xtrue; then
             if test "x$OPENJDK_TARGET_CPU" = xs390x; then

      ...so we should probably special-case this for MIPS. I see some glibc work is being done to support gnu hash style for MIPS, but meanwhile it would be nice not to break the MIPS builds.

            Assignee:
            Aleksey Shipilev
            Reporter:
            Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: