Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makefile: Use pipes rather than temporary files for intermediate steps
GCC supports the use of pipes for intermediate compilation steps (e.g. passing the generated assembly code to the assembler) as a replacement for temporary files. This bypasses VFS and other layers which can introduce substantial amounts of overhead and instead redirects data directly between processes. The final product and generated code are unaffected. Memory usage while compiling is slightly higher. Tests showed a substantial reduction in build time when using GCC to compile an x86 4.19 kernel: Using temporary files in tmpfs: 2m41s Using pipes: 2m36s Similar benefits were observed with an Android arm64 4.9 kernel: Using tmpfs: 5m34s Using pipes: 4m33s Enable the feature when possible (i.e. when the compiler supports it) to speed up builds at effectively no cost for many setups, particularly those with weaker CPUs. Test: kernel compiles and boots Signed-off-by: Danny Lin <[email protected]> Signed-off-by: Alexander Winkowski <[email protected]>
- Loading branch information