Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

Fix Windows linker: --allow-multiple-definition for GCC 15.2.0 UCRT64 regression

Martin Vogelf9945e75a423
diff --git a/internal/cbm/cgo_windows.go b/internal/cbm/cgo_windows.go
new file mode 100644
index 000000000..8ee190757
--- /dev/null
+++ b/internal/cbm/cgo_windows.go
@@ -0,0 +1,11 @@
+package cbm
+
+// GCC 15.2.0 (MSYS2 UCRT64) introduced a regression where __imp__wctype
+// from corecrt_wctype.h is no longer a selectany weak symbol, causing
+// "multiple definition" linker errors when many CGo object files are linked.
+// --allow-multiple-definition is the standard workaround for large CGo projects.
+
+/*
+#cgo windows LDFLAGS: -Wl,--allow-multiple-definition
+*/
+import "C"