From 719c1aba008ed25dae2c6414980a20c6eacbe624 Mon Sep 17 00:00:00 2001 From: Aaron Paterson Date: Thu, 22 Oct 2026 20:18:01 -0500 Subject: [PATCH] Link the CLI's libraries after its archives GNU ld resolves symbols left to right, so with -ldl -lm ahead of the archives, the sqrt, pow and ceil calls in sqlite-vec.a went unresolved and make cli failed on Linux. photostructure/sqlite-vec@9db2489 links the libraries last; asg017/sqlite-vec#304 does the same upstream. --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1845396c..e1813027 100644 --- a/Makefile +++ b/Makefile @@ -166,8 +166,9 @@ $(TARGET_CLI): sqlite-vec.h $(LIBS_DIR)/sqlite-vec.a $(LIBS_DIR)/shell.a $(LIBS_ -DSQLITE_ENABLE_STMT_SCANSTATUS -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_EXPLAIN_COMMENTS \ -DSQLITE_EXTRA_INIT=core_init \ $(CFLAGS) $(EXT_CFLAGS) \ - $(EXT_LDFLAGS) -ldl -lm \ - examples/sqlite3-cli/core_init.c $(LIBS_DIR)/shell.a $(LIBS_DIR)/sqlite3.a $(LIBS_DIR)/sqlite-vec.a -o $@ + $(EXT_LDFLAGS) \ + examples/sqlite3-cli/core_init.c $(LIBS_DIR)/shell.a $(LIBS_DIR)/sqlite3.a $(LIBS_DIR)/sqlite-vec.a \ + -ldl -lm -o $@ sqlite-vec.h: sqlite-vec.h.tmpl VERSION