Re: Suggestions request for speed-up kernel compilation

From: Andi Kleen
Date: Sat Apr 25 2009 - 03:54:53 EST


Alessio Igor Bogani <abogani@xxxxxxxxxx> writes:

> I'm a kernel newbie and I would be very happy to receive some tips
> about kernel compilation from experienced developers.
>

Some tricks:

If you just want to test that the file you've been hacking
on compiles you can use make dir/path/file.o

Use the minimum config file for your machines,
except for occasional fuller verification builds

Set the right -j make level. You have to experiment
what is best.

Not enabling CONFIG_DEBUGINFO speeds up compilation significantly

When you use ccache make sure you have the cache directory on
the same partition and enable CCACHE_HARDLINK=1. Alternatively
what also works (but is a bit more expensive) is to put
the ccache cache on a SSD.

What works very well is to throw some money at it -- compilation
scales very well in a cluster. Get the cheapest quad core you can get
as an additional machine and use a tool like icecream
(http://en.opensuse.org/Icecream) to distribute the compilation.

You need special wrappers like
ftp://firstfloor.org/pub/ak/smallsrc/icecache.c to combine
icecream with ccache

I also found using the "gold" linker in latest binutils
speeds up builds because especially when you already
have parallel compilations the linker is often a bottleneck.

-Andi

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/