From 30d59109a93df14e95520ef692295787c71b3a91 Mon Sep 17 00:00:00 2001 From: Jie Fu Date: Sat, 11 Oct 2025 22:34:53 +0800 Subject: [PATCH 1/4] ggml : fix build broken with -march=armv9-a on MacOS Signed-off-by: Jie Fu --- ggml/src/ggml-cpu/ggml-cpu-impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggml/src/ggml-cpu/ggml-cpu-impl.h b/ggml/src/ggml-cpu/ggml-cpu-impl.h index 799e2b11872..713bf85e5a8 100644 --- a/ggml/src/ggml-cpu/ggml-cpu-impl.h +++ b/ggml/src/ggml-cpu/ggml-cpu-impl.h @@ -68,7 +68,7 @@ struct ggml_compute_params { #endif // __VXE2__ #endif // __s390x__ && __VEC__ -#if defined(__ARM_FEATURE_SVE) +#if defined(__ARM_FEATURE_SVE) && defined(__linux__) #include #endif From c99c32d62f611cab484e84b0bfc84fb7516ea283 Mon Sep 17 00:00:00 2001 From: Jie Fu Date: Mon, 13 Oct 2025 19:27:45 +0800 Subject: [PATCH 2/4] Add #pragma message Signed-off-by: Jie Fu --- ggml/src/ggml-cpu/ggml-cpu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ggml/src/ggml-cpu/ggml-cpu.c b/ggml/src/ggml-cpu/ggml-cpu.c index eded6eb77ed..86080964e76 100644 --- a/ggml/src/ggml-cpu/ggml-cpu.c +++ b/ggml/src/ggml-cpu/ggml-cpu.c @@ -689,8 +689,13 @@ bool ggml_is_numa(void) { #endif static void ggml_init_arm_arch_features(void) { -#if defined(__linux__) && defined(__aarch64__) && defined(__ARM_FEATURE_SVE) +#if defined(__aarch64__) && defined(__ARM_FEATURE_SVE) +#if defined(__linux__) ggml_arm_arch_features.sve_cnt = PR_SVE_VL_LEN_MASK & prctl(PR_SVE_GET_VL); +#else + // TODO: add support of SVE for non-linux systems +#pragma message("TODO: to use SVE, sve_cnt needs to be initialized here.") +#endif #endif } From 021ca1b923049df82c5181651d1f5a8e5392b0dc Mon Sep 17 00:00:00 2001 From: Jie Fu Date: Mon, 13 Oct 2025 20:01:46 +0800 Subject: [PATCH 3/4] Address review comment. Signed-off-by: Jie Fu --- ggml/src/ggml-cpu/ggml-cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggml/src/ggml-cpu/ggml-cpu.c b/ggml/src/ggml-cpu/ggml-cpu.c index 86080964e76..13b670499de 100644 --- a/ggml/src/ggml-cpu/ggml-cpu.c +++ b/ggml/src/ggml-cpu/ggml-cpu.c @@ -694,7 +694,7 @@ static void ggml_init_arm_arch_features(void) { ggml_arm_arch_features.sve_cnt = PR_SVE_VL_LEN_MASK & prctl(PR_SVE_GET_VL); #else // TODO: add support of SVE for non-linux systems -#pragma message("TODO: to use SVE, sve_cnt needs to be initialized here.") +#error message("TODO: to use SVE, sve_cnt needs to be initialized here.") #endif #endif } From 4278b2035baafd09ca1bbf22e80a127f1946ccf8 Mon Sep 17 00:00:00 2001 From: Diego Devesa Date: Mon, 13 Oct 2025 14:06:16 +0200 Subject: [PATCH 4/4] Update ggml/src/ggml-cpu/ggml-cpu.c --- ggml/src/ggml-cpu/ggml-cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggml/src/ggml-cpu/ggml-cpu.c b/ggml/src/ggml-cpu/ggml-cpu.c index 13b670499de..ba2a36d9991 100644 --- a/ggml/src/ggml-cpu/ggml-cpu.c +++ b/ggml/src/ggml-cpu/ggml-cpu.c @@ -694,7 +694,7 @@ static void ggml_init_arm_arch_features(void) { ggml_arm_arch_features.sve_cnt = PR_SVE_VL_LEN_MASK & prctl(PR_SVE_GET_VL); #else // TODO: add support of SVE for non-linux systems -#error message("TODO: to use SVE, sve_cnt needs to be initialized here.") +#error "TODO: SVE is not supported on this platform. To use SVE, sve_cnt needs to be initialized here." #endif #endif }