On Sun, Feb 24, 2008 at 7:50 AM, Nick Andrew <nick@nick-andrew.net> wrote:
The problem with this is that it is very static. As you are well
aware, options differ between gcc versions. Some options also differ
in result depending on the gcc version; for example, -ftree-vectorize
in gcc 3.x versus gcc 4.x. I believe that it would be cleaner to have
the custom flag menu and suggest some flags for specific uses, such as
-Os, in the help description. It might look something like:
help
You can use this to easily set custom gcc CFLAGS to be used
for the entire kernel build process (including modules).
Examples include:
~"-Os" to optimize for size, i.e. for an embedded system or for
more efficient cache usage
~"-s" to strip all symbol table and relocation information
Other compiler flags can be used for increasing or reducing
optimisation, enabling debugging, cross compilation
and so on. Please use "info gcc" or "man gcc" for more
reference.
If unsure, leave blank.
And for LDFLAGS, examples include:
~"-S" to strip all debugging symbols, which are usually unnecessary
unless you intend to debug the kernel
~"-s" to strip all symbol information from the kernel
And for MAKEFLAGS, examples could include:
~"-j{n}" where n is the number of jobs you'd like to run for
make. This will make the kernel building process be greatly
faster. A good rule of thumb is for n to be 1 + the number of
processor cores that are on the compiling machine.
~"-K" to attempt to continue compilation, even if errors are
encountered, running until all other compilation paths (that
do not depend on any that have errored) complete.
These are of course, just a few examples, but it serves to show the idea.
Glad you agree. ;)
Is anyone else out there reading these messages? Cleaning and
"upgrading" the kernel's configuration and build systems is something
that could both use a lot of input and a lot of helping hands. ;) If
you've any patches for usability, aesthetics, optimization,
configuration or build robustness, etc., now would be the time to
share.
--