RFR: 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)

Thank you for the reviews!

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

PR Comment: https://git.openjdk.org/jdk/pull/23245#issuecomment-2610663920


More information about the hotspot-compiler-dev mailing list