Skip to contentSkip to conversation

Makefile: add -lm when linking to sqlite3

PATCH New Ross Burton 1 participant 1 message Nov 6, 2018 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: add -lm when linking to sqlite3

If sqlite3 is built with FTS5 then it needs log() from libm.so. This is pulled in automatically when dynamically linking as usual, or if static linking via pkg-config. However as pseudo will link directly to libsqlite3.a this potential linkage is lost and the build will fail with undefined symbols.

Solve this by always linking to libm.

---
 Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile.in +1 -1
index ad6541b..28b5ecb 100644
@@ -73,7 +73,7 @@ WRAPOBJS=pseudo_wrappers.o
 
 # needed for anything that links with pseduo_client.o, pretty much
 CLIENT_LDFLAGS=-ldl -lpthread
-DB_LDFLAGS=@SQLITE_LDARG@ -lpthread
+DB_LDFLAGS=@SQLITE_LDARG@ -lpthread -lm
 
 PSEUDO=$(BIN)/pseudo
 PSEUDODB=$(BIN)/pseudodb
Signature · 1 line
2.11.0