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

Build failure with glibc >= 2.24: error: 'int readdir_r(DIR*, dirent*, dirent**)' is deprecated

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 11
    • OpenJDK6, openjdk7u, 8u171, 9
    • hotspot
    • None
    • b12

    Description

      It seems that OpenJDK build fails on Linux systems with newer glibc (>= 2.24), because readdir_r got deprecated, see https://lwn.net/Articles/696469/.

      /home/xbmc/shenandoah-jdk9/hotspot/src/os/linux/vm/os_linux.inline.hpp: In static member function 'static dirent* os::readdir(DIR*, dirent*)':
      /home/xbmc/shenandoah-jdk9/hotspot/src/os/linux/vm/os_linux.inline.hpp:109:18: error: 'int readdir_r(DIR*, dirent*, dirent**)' is deprecated [-Werror=deprecated-declarations]
         if((status = ::readdir_r(dirp, dbuf, &p)) != 0) {
                        ^~~~~~~~~
      In file included from /home/xbmc/shenandoah-jdk9/hotspot/src/os/linux/vm/jvm_linux.h:44:0,
                       from /home/xbmc/shenandoah-jdk9/hotspot/src/share/vm/prims/jvm.h:31,
                       from /home/xbmc/shenandoah-jdk9/hotspot/src/share/vm/utilities/debug.hpp:29,
                       from /home/xbmc/shenandoah-jdk9/hotspot/src/share/vm/runtime/globals.hpp:28,
                       from /home/xbmc/shenandoah-jdk9/hotspot/src/share/vm/memory/allocation.hpp:28,
                       from /home/xbmc/shenandoah-jdk9/hotspot/src/share/vm/memory/memRegion.hpp:28,
                       from /home/xbmc/shenandoah-jdk9/hotspot/src/share/vm/gc/shared/barrierSet.hpp:28,
                       from /home/xbmc/shenandoah-jdk9/hotspot/src/share/vm/runtime/handles.hpp:28,
                       from /home/xbmc/shenandoah-jdk9/hotspot/src/share/vm/memory/universe.hpp:28,
                       from /home/xbmc/shenandoah-jdk9/hotspot/src/share/vm/code/oopRecorder.hpp:28,
                       from /home/xbmc/shenandoah-jdk9/hotspot/src/share/vm/asm/codeBuffer.hpp:28,
                       from /home/xbmc/shenandoah-jdk9/hotspot/src/share/vm/asm/assembler.hpp:28,
                       from /home/xbmc/shenandoah-jdk9/hotspot/src/share/vm/precompiled/precompiled.hpp:29:

      Initially assigning to hotspot/runtime, seems the closest one. This might be the important thing to get into 9 or 9u.

      Attachments

        Issue Links

          Activity

            People

              andrew Andrew Hughes
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: