On Wed, 16 Sep 2026 02:59:23 GMT, Daniel Hu <[email protected]> wrote:

> The change removes `$CFLAGS_WARNINGS_ARE_ERRORS` for reasons stated below. 
> `ARG_ARGUMENT` is also removed as it's a no-op and I believe it was 
> unintentionally added.
> 
> The issue is as title describes. When `bash configure` is run with the flags 
> `--enable-aarch64-sve` and `--with-extra-cflags='-Wall'` the following error 
> appears:
> 
> 
> bash configure --enable-aarch64-sve --with-extra-cflags='-Wall'
> ...
> checking for --enable-aarch64-sve... enabled, from command line
> configure: error: Option --enable-aarch64-sve is not available
> configure exiting with result code 1 
> 
> 
> This is problematic as the JDK cannot be built with cflag `-Wall` without 
> disabling aarch64 libsleef SVE features. The only workaround is excluding 
> problematic cflags that fail the `--enable-aarch64-sve` compiler check probe, 
> but that is undesirable.
> 
> Moreover, this is a regression as when building JDK25 these intrinsics from 
> [JDK-8312425](https://bugs.openjdk.org/browse/JDK-8312425) built fine with 
> `-Wall` as the compiler check did not include the `-Werror` flag or 
> `$CFLAGS_WARNINGS_ARE_ERRORS`. Only after `--enable-aarch64-sve` was added 
> from [JDK-8366777](https://bugs.openjdk.org/browse/JDK-8366777) did this 
> build regression appear as now the SVE compiler check includes `-Werror`
> 
> Testing: with this change, `bash configure --enable-aarch64-sve 
> --with-extra-cflags='-Wall'` no longer errors. Moreover, before when building 
> with `bash configure --with-extra-cflags='-Wall'` the JDKs fail on Graviton3 
> machines on the following jtreg:
> * jtreg:test/hotspot/jtreg/compiler/vectorapi/TestVectorMathLib.java
> * jtreg:test/jdk/jdk/incubator/vector/DoubleVector256Tests.java
> * jtreg:test/jdk/jdk/incubator/vector/DoubleVectorMaxTests.java
> * jtreg:test/jdk/jdk/incubator/vector/FloatVector256Tests.java
> * jtreg:test/jdk/jdk/incubator/vector/FloatVectorMaxTests.java
> * jtreg:test/jdk/jdk/incubator/vector/VectorMathLibraryLocaleTest.java
> 
> With this change, a `bash configure --with-extra-cflags='-Wall'` build passes 
> the previously failing jtreg on a Graviton3 machine.
> 
> An alternative fix could modify the compiler check code to not error under 
> the stricter cflags. But I opted to simply remove the `-Werror` since it 
> wasn't there originally, I don't think it adds anything meaningful to the 
> compiler check, and it's the simplest fix.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

The compiler error from config.log:

configure:178801: checking if Arm SVE ACLE is supported
configure:178827: /usr/bin/gcc -c   -Wall -march=armv8-a+sve -Werror  
conftest.c >&5
conftest.c: In function ‘main’:
conftest.c:29:21: error: unused variable ‘r’ [-Werror=unused-variable]
   29 |           svint32_t r = svdup_n_s32(1)
      |                     ^
conftest.c: In function ‘a’:
conftest.c:23:28: error: control reaches end of non-void function 
[-Werror=return-type]
   23 |           svfloat64_t a() {}
      |                            ^
cc1: all warnings being treated as errors
configure:178827: $? = 1


Alternatively, could fix the inline code to be compliant with stricter cflags. 
I'm open to whichever implementation.

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

PR Comment: https://git.openjdk.org/jdk/pull/32896#issuecomment-5703474497

Reply via email to