zqqw / pakku

Pacman wrapper with AUR support
GNU General Public License v3.0
39 stars 3 forks source link

LTO - link time optimization #16

Closed zqqw closed 3 years ago

zqqw commented 3 years ago

LTO will soon be default in Arch builds. Testing it, this new compiler option works fine with Pakku, Nim has supported it for a long while.

diff --git a/Makefile b/Makefile
index 04ce4cb..f3049bb 100644
--- a/Makefile
+++ b/Makefile
@@ -55,6 +55,8 @@ NIM_OPTIMIZE = size
 NIM_CACHE_DIR = nimcache

 NIM_OPTIONS = \
+       --passC:"-flto" \
+       --passL:"-flto" \
        --putenv:'PROG_VERSION'="${RVERSION}" \
        --putenv:'PROG_COPYRIGHT'="${COPYRIGHT}" \
        --putenv:'PROG_PKGLIBDIR'="${PKGLIBDIR}" \

Result, a smaller binary:
Total Installed Size:   0.74 MiB
Net Upgrade Size:      -0.12 MiB
zqqw commented 3 years ago

It works! No problems, just in case anyone wondered about this.