Skip to content

Commit ebdebf5

Browse files
fix(turboquant): repair static wht declaration
The bumped fork adds an explicit extern after GGML_API, but GGML_API already expands to extern in static builds. Carry a compatibility patch that keeps the symbol declaration-only without producing conflicting specifiers. Assisted-by: Codex:gpt-5 [Codex]
1 parent 6e0645d commit ebdebf5

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ggml-cpu: avoid duplicate extern in static builds
2+
3+
GGML_API expands to extern when GGML_SHARED is disabled. Combining it with
4+
an explicit extern therefore produces an invalid `extern extern` declaration
5+
in the static builds used by LocalAI. The definition in ggml-turbo-quant.c
6+
already carries GGML_API, so this cross-library declaration does not need the
7+
export macro.
8+
9+
diff --git a/ggml/src/ggml-cpu/ops.cpp b/ggml/src/ggml-cpu/ops.cpp
10+
index 755e9ff8c..2a624b90c 100644
11+
--- a/ggml/src/ggml-cpu/ops.cpp
12+
+++ b/ggml/src/ggml-cpu/ops.cpp
13+
@@ -18,6 +18,6 @@ extern "C" {
14+
// handler here and the quantizer there operate on different variables. Whether
15+
// the two happen to unify is a property of the platform's symbol resolution
16+
// (ELF interposition may merge them; two-level-namespace and DLL targets will
17+
// not), which made the group-size propagation silently link-order dependent.
18+
-GGML_API extern int turbo3_cpu_wht_group_size;
19+
+extern int turbo3_cpu_wht_group_size;
20+
}

0 commit comments

Comments
 (0)