|
|
|
|
|
by roblabla
2683 days ago
|
|
$ musl-gcc test.c -O2
$ ls -laB a.out
.rwxr-xr-x 15,776 roblabla 15 Feb 16:49 a.out
$ musl-gcc test.c -O2 -ffunction-sections -fdata-sections -Wl,--gc-sections -static
$ ls -laB a.out
.rwxr-xr-x 17,864 roblabla 15 Feb 16:48 a.out
Static linking with MUSL added 2088 bytes of overhead. Likely only the code that was needed.It's true that without proper care, you might end up importing a whole lot of useless stuff though. |
|
FWIW, I believe (but could very well be wrong) the reason that this works this well with MUSL is that every function is defined in its own translation unit. I doubt that Qt and KDE do that.