RFR: 8312591: GCC 6 build failure after JDK-8280982
Aleksey Shipilev
shade at openjdk.org
Wed Jul 26 17:40:41 UTC 2023
On Wed, 26 Jul 2023 12:05:13 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:
>> src/java.desktop/unix/native/libpipewire/include/spa/utils/defs.h line 62:
>>
>>> 60: # define SPA_FALLTHROUGH [[clang::fallthrough]];
>>> 61: #elif defined(__GNUC__) && __GNUC__ >= 7
>>> 62: # define SPA_FALLTHROUGH __attribute__ ((fallthrough));
>>
>> Upstream still has this issue/bug.
>> https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/master/spa/include/spa/utils/defs.h
>> Do they intend to support only GNUC 7 and up ? Not clear. Best to ask.
>
> Ideally, this should be fixed upstream, but while we wait, we can try to fix the build failure in our source by adding definition of `__clang_major__` just before including the [pipewire/stream.h](https://github.com/openjdk/jdk/blob/master/src/java.desktop/unix/native/libawt_xawt/awt/screencast_pipewire.h#L36)
>
>
> // some comment why we are doing this
> #ifndef __clang_major__
> #define __clang_major__ 0
> #endif
>
>
> It looks like that the `defs.h` is the only file that uses `__clang_major__` in libxawt, so this define should be safe.
>
>
> But the question of GCC < 7 support remains open.
Um. If we want to minimize divergence with upstream, defining `__clang_major__` seems riskier than rewriting a single block that uses it incorrectly. Because I cannot be sure if _any other_ `ifdef` that checks `__clang_major__` would work correctly.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14995#discussion_r1275292579
More information about the client-libs-dev
mailing list