On Mon, 31 Mar 2025 21:53:21 GMT, Vladimir Ivanov <[email protected]> wrote:
> > That commit assumes that vector_math_sve.c should have $(SVE_CFLAGS) on mac
> > as well as on linux. If that is not correct, then it needs to be adjusted.
>
> As of now, Apple Silicon doesn't support SVE/SVE2, so I intentionally
> excluded SVE support on macosx-aarch64. What would be the best way to exclude
> `vector_math_sve.c` on macosx-aarch64?
The best way would be to make sure SVE_CFLAGS is empty on macosx.
diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4
index 73786587735..6e5a70a43a5 100644
--- a/make/autoconf/flags-cflags.m4
+++ b/make/autoconf/flags-cflags.m4
@@ -924,8 +924,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
# Check whether the compiler supports the Arm C Language Extensions (ACLE)
# for SVE. Set SVE_CFLAGS to -march=armv8-a+sve if it does.
# ACLE and this flag are required to build the aarch64 SVE related functions
in
- # libvectormath.
- if test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
+ # libvectormath. Apple Silicon does not support SVE; use macOS as a proxy for
+ # that check.
+ if test "x$OPENJDK_TARGET_CPU" = "xaarch64" && test "x$OPENJDK_TARGET_OS" =
"xlinux"; then
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
AC_LANG_PUSH(C)
OLD_CFLAGS="$CFLAGS"
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24306#issuecomment-2768656092