apk: build static
authorRosen Penev <rosenp@gmail.com>
Thu, 28 Nov 2024 21:15:29 +0000 (13:15 -0800)
committerRobert Marko <robimarko@gmail.com>
Fri, 29 Nov 2024 10:32:34 +0000 (11:32 +0100)
commit39b0f081ecaf4fb9acc622d694dc52293a4dda1f
tree81a2e4c984ffc6376b776bc3c343d91158d3696f
parent55dfe3fcea88c108c8b89e96138975965e60bc08
apk: build static

libapk as a library is used nowhere else and makes no sense to link it
shared. By linking static, we can take advantage of LTO and get the size
reduced further.

Some numbers locally:

Before:

168K staging_dir/target-mips_24kc_musl/root-ath79/usr/bin/apk*
252K staging_dir/target-mips_24kc_musl/root-ath79/usr/lib/libapk.so.2.99.0*

Static:
344K staging_dir/target-mips_24kc_musl/root-ath79/usr/bin/apk*

Static + LTO:
305K staging_dir/target-mips_24kc_musl/root-ath79/usr/bin/apk*

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17109
Signed-off-by: Robert Marko <robimarko@gmail.com>
package/system/apk/Makefile