RFR: 8312591: GCC 6 build failure after JDK-8280982 [v2]

Phil Race prr at openjdk.org
Thu Jul 27 19:40:53 UTC 2023


On Thu, 27 Jul 2023 19:01:35 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> There is a simple build failure after [JDK-8280982](https://bugs.openjdk.org/browse/JDK-8280982) with older GCCs:
>> 
>> 
>> * For target support_native_java.desktop_libawt_xawt_screencast_pipewire.o:
>> In file included from /home/buildbot/worker/build-jdkX-debian9/build/src/java.desktop/unix/native/libpipewire/include/spa/buffer/buffer.h:12:0,
>>                  from /home/buildbot/worker/build-jdkX-debian9/build/src/java.desktop/unix/native/libpipewire/include/pipewire/stream.h:171,
>>                  from /home/buildbot/worker/build-jdkX-debian9/build/src/java.desktop/unix/native/libawt_xawt/awt/screencast_pipewire.h:36,
>>                  from /home/buildbot/worker/build-jdkX-debian9/build/src/java.desktop/unix/native/libawt_xawt/awt/screencast_pipewire.c:33:
>> /home/buildbot/worker/build-jdkX-debian9/build/src/java.desktop/unix/native/libpipewire/include/spa/utils/defs.h:61:24: error: "__clang_major__" is not defined [-Werror=undef]
>>  #elif __GNUC__ >= 7 || __clang_major__ >= 10
>>                         ^~~~~~~~~~~~~~~
>> 
>> 
>> There is an obvious fix for this: we need to check for `defined(__GNUC__)` explicitly before touching `__clang_major__`.
>> 
>> (Yes, GCC 6 is old; but we would like to make sure it builds until we run into hard to resolve build issues. This allows modern JDKs to be built in legacy enterprise environments for e.g. portable builds.)
>> 
>> Additional testing:
>>  - [x] Linux GCC 6 fastdebug build (passes with HarfBuzz warnings, to be fixed separately)
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Disable the warnings instead

Marked as reviewed by prr (Reviewer).

make/modules/java.desktop/lib/Awt2dLibraries.gmk line 248:

> 246:         DISABLED_WARNINGS_gcc_OGLBufImgOps.c := format-nonliteral, \
> 247:         DISABLED_WARNINGS_gcc_OGLPaints.c := format-nonliteral, \
> 248:         DISABLED_WARNINGS_gcc_screencast_pipewire.c := undef, \

At least ignoring it just for the specific compilation units is not too bad.

I'll approve but I'd like to see a comment here as to why its needed - ie just for gcc6 so people have an idea when we might be able to remove it and know not to remove it because it doesn't matter for the current compiler version.

I've still asked upstream to consider applying your first version so that we'd not need this although perhaps it won't matter for long .. once no one cares about gcc6 because we need to move on for other reasons.

-------------

PR Review: https://git.openjdk.org/jdk/pull/14995#pullrequestreview-1550625960
PR Review Comment: https://git.openjdk.org/jdk/pull/14995#discussion_r1276744373



More information about the client-libs-dev mailing list