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

GNU hash style is not available on MIPS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: infrastructure
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b26

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: