[jdk11u-dev] RFR: 8344458: [11u] Add initial support for building with XCode 14 [v3]

Andrew John Hughes andrew at openjdk.org
Thu Nov 21 02:13:26 UTC 2024


On Tue, 19 Nov 2024 14:08:39 GMT, Antonio Vieiro <duke at openjdk.org> wrote:

>> An implementation of [JDK-8344458](https://bugs.openjdk.org/browse/JDK-8344458) that adds conditional support for building on `macos` with `XCode 14` while keeping compatibility with previous `XCode` versions.
>> 
>> The PR is separated in three commits for easier review:
>> 
>> - First commit adds a new `--enable-xcode14` configuration flag (which is currently disabled in GHA) and two additional variables:
>>     - `CFLAGS_XCODE14_DEPR_DECLARATIONS` (empty on current XCode versions, set to and `-Wno-deprecated-declarations` when `--enable-xcode14`is used)
>>     - And `CFLAGS_XCODE14_DEPR_NON_PROTOTYPE` (empty on current XCode versions, set to `-Wno-deprecated-non-prototype` when `--enable-xcode14` is used).
>> - The second commit applies `CFLAGS_XCODE14_DEPR_DECLARATIONS` to those parts of the codebase that use the deprecated `sprintf` function (i.e., avoiding `sprintf` usage errors in XCode 14).
>> - The third commit applies `CFLAGS_XCODE14_DEPR_NON_PROTOTYPE` to those parts of AWT lib that generate a compilation error (i.e., avoiding the `passing arguments to a function without prototype`).
>> 
>> Since the new flag `--enable-xcode14` is not set **the build should run exactly the same on the current XCode versions** and, consequently, the GitHub checks should pass on all platforms, including the current `macos-12` & `XCode 13.4.1`.
>
> Antonio Vieiro has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Removed doc instructions as per review

I tried with clang 15, 16, 17 & 18 on Linux and did not see similar errors with `-Wdeprecated-declarations` and `-Wdeprecated-non-prototype`. With `--disable-warnings-as-errors` on, it gets as far as running the built JDK, which then segfaults. I think this may be due to undefined behaviour issues mentioned in [JDK-8229258](https://bugs.openjdk.org/browse/JDK-8229258) and [JDK-8276453](https://bugs.openjdk.org/browse/JDK-8276453)

With warnings as errors on (the default), it fails with:

~~~
+ /usr/bin/head -n 15
/localhome/andrew/projects/openjdk/upstream/jdk11u-dev/src/hotspot/share/compiler/compilerDefinitions.cpp:85:13: error: implicit conversion from 'const intx' (aka 'const long') to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-const-int-float-conversion]
    if (v > max_intx) {
          ~ ^~~~~~~~
1 error generated.
~~~

which I believe is [JDK-8287052](https://bugs.openjdk.org/browse/JDK-8287052)

Is `--disable-warnings-as-errors` not sufficient to make the GHA build work on MacOS 13? It's not an ideal solution but it's a less disruptive way to keep a working MacOS build in the short term.

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

PR Comment: https://git.openjdk.org/jdk11u-dev/pull/2966#issuecomment-2489920360


More information about the jdk-updates-dev mailing list