RFR: [8u] Build failed on Ubuntu 18.04 due to deprecated-declarations warnings

Jie Fu fujie at loongson.cn
Wed Mar 20 04:09:44 UTC 2019


Hi all,

Unless a runtime failure is triggered, I think the simplest way to fix 
this issue is to change the build system since deprecated-declarations 
warnings are not errors at all.

deprecated-declarations warnings seem to be treated as errors only for 
hotspot build.
But why not for jdk build?
There are also deprecated-declarations warnings when building jdk:
------------------------------------------------------------------------
jdk8u/jdk/src/solaris/native/java/util/TimeZone_md.c:136:5: warning: 
‘readdir64_r’ is deprecated [-Wdeprecated-declarations]
jdk8u/jdk/src/solaris/native/java/io/UnixFileSystem_md.c:310:5: warning: 
‘readdir64_r’ is deprecated [-Wdeprecated-declarations]
jdk8u/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c:693:5: 
warning: ‘readdir64_r’ is deprecated [-Wdeprecated-declarations]
jdk8u/jdk/src/solaris/native/sun/management/OperatingSystemImpl.c:83:5: 
warning: ‘readdir_r’ is deprecated [-Wdeprecated-declarations]
jdk8u/jdk/src/solaris/native/sun/xawt/XWindow.c:836:5: warning: 
‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
jdk8u/jdk/src/solaris/native/sun/xawt/XWindow.c:836:5: warning: 
‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
jdk8u/jdk/src/solaris/native/sun/xawt/XWindow.c:840:5: warning: 
‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
jdk8u/jdk/src/solaris/native/sun/xawt/XWindow.c:841:5: warning: 
‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
jdk8u/jdk/src/solaris/native/sun/xawt/XWindow.c:842:5: warning: 
‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
jdk8u/jdk/src/solaris/native/sun/xawt/XWindow.c:843:5: warning: 
‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
jdk8u/jdk/src/solaris/native/sun/xawt/XWindow.c:858:13: warning: 
‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
jdk8u/jdk/src/solaris/native/sun/xawt/XWindow.c:861:13: warning: 
‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
jdk8u/jdk/src/solaris/native/sun/xawt/XWindow.c:868:13: warning: 
‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
jdk8u/jdk/src/solaris/native/sun/xawt/XWindow.c:871:13: warning: 
‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
jdk8u/jdk/src/solaris/native/sun/xawt/XlibWrapper.c:1289:9: warning: 
‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
jdk8u/jdk/src/solaris/native/sun/xawt/XlibWrapper.c:1923:5: warning: 
‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
------------------------------------------------------------------------

It seems unfair to accept deprecated-declarations warnings in jdk build 
but not in hotspot build.

Best regards,
Jie


On 2019/3/20 上午2:06, Andrew John Hughes wrote:
> On 19/03/2019 15:09, Martin Buchholz wrote:
>> Probably it's because glibc deprecated readdir, and we don't have
>> --disable-warnings-as-errors by default?
>>
>> (I think warnings should not be errors except as opt-in by openjdk
>> developers/maintainers)
>>
>> On Tue, Mar 19, 2019 at 7:47 AM Andrew Haley <aph at redhat.com> wrote:
>>
>>> On 3/19/19 12:25 PM, Jie Fu wrote:
>>>> To fix build failures caused by deprecated-declarations warnings, can we
>>>> make this change to jdk8u?
>>> This is very GCC-version dependent. We really should probe at configure
>>> time for
>>> these options.
>>>
>>> --
>>> Andrew Haley
>>> Java Platform Lead Engineer
>>> Red Hat UK Ltd. <https://www.redhat.com>
>>> EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
>>>
> If this is because of readdir_r, then that's on my radar to backport
> once we've branched for 8u212 (it needs time to soak, so I'm aiming for
> 8u222). I've prefer we fixed this rather than disabling warnings
> unnecessarily.



More information about the build-dev mailing list