Integrated: 8348327: Incorrect march flag when building libsleef/vector_math_neon.c

Mikael Vidstedt mikael at openjdk.org
Thu Jan 23 18:40:08 UTC 2025


On Thu, 23 Jan 2025 00:04:47 GMT, Mikael Vidstedt <mikael at openjdk.org> wrote:

> [JDK-8312425](https://bugs.openjdk.org/browse/JDK-8312425) started building the libsleef library with `$(SVE_CFLAGS)` on aarch64. That variable expands to `-march=armv8-a+sve` if the compiler supports it.
> 
> The flag should only be applied to the `vector_math_sve.c` file. Applying it to the whole library means it also gets applied to `vector_math_neon.c`, and the compiler (e.g. GCC) may select SVE instructions when generating code for it. When running the resulting JDK on a CPU which does not support SVE that will lead to an illegal instruction/`SIGILL`.
> 
> Testing:
> 
> * Manually verified that `vector_math_neon.c` does *not* get built with `-march=armv8-a+sve` and that `vector_math_sve.c` (still) does get built with that flag.
> * tier1-5 (in progress)

This pull request has now been integrated.

Changeset: 3ebf8899
Author:    Mikael Vidstedt <mikael at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/3ebf88996f35f397f4396e3d139b9251048de751
Stats:     2 lines in 1 file changed: 0 ins; 0 del; 2 mod

8348327: Incorrect march flag when building libsleef/vector_math_neon.c

Reviewed-by: erikj, vlivanov, shade

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

PR: https://git.openjdk.org/jdk/pull/23245


More information about the hotspot-compiler-dev mailing list