Aalbus-linux / Aalbus

The master repository for the Aalbus distribution
Other
22 stars 0 forks source link

LTO the kernel in release images #7

Open RoastVeg opened 3 years ago

RoastVeg commented 3 years ago

First I'd like to say that this distro exactly aligns with my ideals for distro creation. Thank you so much for devoting as much time as you already have to this project, I am excited to see it progress forward into my (and your!) ideal Unix.

One of the majormost advantages to using an LLVM toolchain over GNU is the possibility of performing Link Time Optimisation for all those packages where it does not break them, which will almost certainly meen significant gains both in size (I know you ar eager to reduce the image down from that hefty >1.3GB) and speed.

The kernel is, as I'm sure you're aware, already persuing this. Is this something you would be interesting in adding to the default build flags for this distribution (which should be relatively easy since you maintain your own pkgsrc), and removing on a case-by-case basis?

staalmannen commented 3 years ago

I am already having -flto=thin as default label. There are only a few pkgsrc packages where I have had to add -fno-lto to the CFLAGS to disable lto (musl is one of them). I think that with kernel 5.12 I might try to enable lto also for the kernel build. I also aim to move llvm to packages/releases after llvm 12 is released.

After I have managed to build a bootable image (next milestone, currently stuck on kernel compilation where I am running into something stupid related to __stack_chk_fail which should not even be enabled there), the next TODO is to work on infrastructure (web page, binary repositories, ...).

When the binary repositories are up and running, I can trim down the base image significantly (I expect it to be almost as small as Alpine), and the user can set up their own development environment by installing the binaries. I think I will still also release the fat/complete image which does not depend on the infrastructure (pkgsrc, source based).

RoastVeg commented 3 years ago

Ah I'm very pleased to hear -flto=thin is enabled by default.

nickdesaulniers commented 3 years ago

Let us know if you have any issues. :)

staalmannen commented 3 years ago

Thanks :) This year has been busier than expected (work, divorce, ...) so I have unfortunately had much less time than I would like to work on this.

I built a "cheat" kernel with gcc to start figuring out all the other components where I am equally clueless (bootloader, initrd, init, creating a live ISO, ...). Making the "base" image that is basically self-hosting was the easy part I think...