solus-project / ypkg

Modern, declarative, structured build format
https://solus-project.com/
GNU General Public License v3.0
56 stars 20 forks source link

.a files not stripped #24

Closed sunnyflunk closed 7 years ago

sunnyflunk commented 7 years ago

As discussed, examine.py doesn't understand the .a 'current ar archive' format to strip them and the few .a files that are included in Solus are waaaay larger than they need to be.

ikeydoherty commented 7 years ago

zlib before ypkg changes:

552K    install/usr/lib64/libz.a
ikeydoherty commented 7 years ago

And after changes...

552K    libz.a

..lol. Strip doesn't work on the LTO objects.

ikeydoherty commented 7 years ago

OK so with LTO - prior to changes:

552K    install/usr/lib64/libz.a
120K    install/usr/lib64/libz.so.1.2.11
ikeydoherty commented 7 years ago

Without LTO - post changes:

124K    install/usr/lib64/libz.a
96K install/usr/lib64/libz.so.1.2.11
ikeydoherty commented 7 years ago

TL;DR Our stripping is broken in general for LTO - and missed completely for .a

ikeydoherty commented 7 years ago

OK so LTO is super cranky. To alleviate this I'm switching us to binutils 2.27, enabling ld.gold, making bfd the default, and providing the bfd liblto_plugin link in GCC..

ikeydoherty commented 7 years ago

binutils change in Solus https://git.solus-project.com/packages/binutils/commit/?h=binutils-2.27-22

ikeydoherty commented 7 years ago

Enabling LTO plugin + gold in GCC: https://git.solus-project.com/packages/gcc/commit/?h=gcc-6.3.0-22

ikeydoherty commented 7 years ago

Solved

ikeydoherty commented 7 years ago

Final results:

Hostside:

556K    /usr/lib64/libz.a

New build of zlib:

168K    install/usr/lib64/libz.a