Package: sqlite3
Version: 3.38.3-1
Severity: wishlist
Tags: patch

Hi,

I was investigating why sqlite3 was so "big" and noticed that it links
libsqlite3 statically. The most common reason for doing so is usage of
unexported symbols. Evidently that's not the case here. So why would it
not link dynamically?

I looked into whether doing it was possible. The attached patch makes
sqlite3 link libsqlite3 dynamically. Easy enough. Possibly, we'd have to
guard it by some configure option to make it upstreamable.

How do package sizes change?

libsqlite3-0 has an Installed-Size of 1664 and is obviously unaffected
by the change. Prior to the change, sqlite3 weighs in at Installed-Size
1878. After the change, its size is reduced to 519, but we must now
account for libsqlite3-0, so we effectively get 2183, i.e. a growth of
305. The bulk of that is the (duplicated) contents of of /usr/share/doc.
Given that libsqlite3-0 is pulled by very many packages, and that
/usr/share/doc can be removed in size-constrained settings, the
reduction achieved by dynamic linking seems reasonable to me. Do you
agree?

Helmut
--- sqlite3-3.38.3.orig/Makefile.in
+++ sqlite3-3.38.3/Makefile.in
@@ -657,9 +657,9 @@
 		-avoid-version
 	sed -i "/dependency_libs/s/'.*'/''/" $@
 
-sqlite3$(TEXE):	shell.c sqlite3.c
+sqlite3$(TEXE):	shell.c libsqlite3.la
 	$(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
-		shell.c sqlite3.c \
+		shell.c libsqlite3.la \
 		$(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
 
 sqldiff$(TEXE):	$(TOP)/tool/sqldiff.c sqlite3.lo sqlite3.h

Reply via email to