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

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

      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.

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

              Created:
              Updated:
              Resolved: