ericcurtin / initoverlayfs

GNU General Public License v2.0
0 stars 0 forks source link

Use meson #8

Open ericcurtin opened 1 year ago

ericcurtin commented 1 year ago

At the moment to build, it's gcc a single file, but we will eventually split into multiple files where we will need a build tool like meson

ericcurtin commented 1 year ago

Maybe we can delay this:

time gcc -O0 pre-init.c

real    0m0.101s
user    0m0.085s
sys 0m0.015s

at the moment, everything is compiled as a single compilation unit, this has an advantage as the compiler can see everything and do aggressive optimisation. Since pre-init is designed to run in initramfs, having this aggressive optimisation makes sense in order to keep binary size small. At the time of writing the binary is 32K.

If build times get slower, like greater than a second, maybe we can consider splitting the code up.

As an alternative, we should split things into separate .h files to prepare for the case where this project needs to be split into separate compilation units.

This is what is called a unity build.