Re: jdk build fails due to "warning: ‘readdir_r’ is deprecated"

Thomas Stüfe thomas.stuefe at gmail.com
Mon Mar 12 07:45:44 UTC 2018


Thanks a lot for digging this up! That may very well be.

I see that we locally disable the warning in os_linux.inline.hpp. My error
happens when compiling the jdk, among others TimeZone_md.c. I do not see
that we pass -Wdeprecated-declarations.

I am still unsure whether this is a new issue or an existing one I
uncovered in by environment. Unfortunately I have to drive to the office
now and will then be back in gcc 4.8 land. Have to pick this up again next
weekend (or just install a saner Linux).

Thank you!

Thomas




On Mon, Mar 12, 2018 at 8:26 AM, David Holmes <david.holmes at oracle.com>
wrote:

> We already dealt with this in the VM:
>
> http://hg.openjdk.java.net/jdk10/master/rev/f5f2a2d13775
>
> by disabling the warning.
>
> That suggests to me that this warning must have been disabled in the JDK
> build too. So perhaps recent flag reworking has modified that. ??
>
> David
>
>
> On 12/03/2018 5:15 PM, David Holmes wrote:
>
>> Hi Thomas,
>>
>> On 12/03/2018 5:02 PM, Thomas Stüfe wrote:
>>
>>> Hi all,
>>>
>>> maybe someone has an idea:
>>>
>>> I build on a freshly installed Linux instance (MX17), using gcc 6.3.0.
>>>
>>> I get this error:
>>>
>>> Creating support/modules_cmds/jdk.pack/unpack200 from 7 file(s)
>>> /shared/projects/openjdk/jdk-hs/source/src/jdk.management/un
>>> ix/native/libmanagement_ext/OperatingSystemImpl.c:
>>> In function ‘read_dir’:
>>> /shared/projects/openjdk/jdk-hs/source/src/jdk.management/un
>>> ix/native/libmanagement_ext/OperatingSystemImpl.c:83:5:
>>> warning: ‘readdir_r’ is deprecated [-Wdeprecated-declarations]
>>>       if (readdir_r(dirp, entry, &p) == 0) {
>>>       ^~
>>> In file included from
>>> /shared/projects/openjdk/jdk-hs/source/src/hotspot/os/posix/include/jvm_md.h:34:0,
>>>
>>>                   from
>>> /shared/projects/openjdk/jdk-hs/source/src/hotspot/share/include/jvm.h:32,
>>>
>>>                   from
>>> /shared/projects/openjdk/jdk-hs/source/src/jdk.management/un
>>> ix/native/libmanagement_ext/OperatingSystemImpl.c:29:
>>> /usr/include/dirent.h:183:12: note: declared here
>>>   extern int readdir_r (DIR *__restrict __dirp,
>>>              ^~~~~~~~~
>>>
>>> I digged and was not able to pin it to any recent change. I also think  I
>>> never successfully built on this box, so it may be my environment.
>>>
>>> Could it be that my gcc is too new?
>>>
>>
>> We've built with gcc 7 so it can't be that on its own. May be a
>> combination of gcc and glibc version. It was deprecated in glibc 2.24.
>>
>> David
>>
>> Thanks! Thomas
>>>
>>>



More information about the build-dev mailing list