Re: passing my own compiler options into linux kernel compiling

From: Ed Sweetman (ed.sweetman@wmich.edu)
Date: Thu Jul 24 2003 - 16:41:09 EST


Sam Ravnborg wrote:
> On Thu, Jul 24, 2003 at 09:16:17AM +0200, Michal Semler wrote:
>
>>Hello,
>>
>>I use gcc-3.3 and I would like compile my kernel with flags:
>>
>>-O4 -march=pentium3 -mcpu=pentium3

-mcpu is taken care of by -march in gcc3
-O4 does nothing, -O3 is the highest gcc3 goes, and -O3 does cause
problems with certain code.

I'd suggest also -ftracer as it is supposed to help your standard -O2
level optimizations do their jobs. How well, probably not very noticable
in real life, but then neither is -march=pentium3 over i686.

>>Is there any way to do this?
>
> Only way to specify -O4 is to manually edit top-level Makefile.
> Change the assignment to CFLAGS (not hOSTCFLAGS as someone suggested).
>
> The -m options are set in arch/i386/Makefile.
> The best way to set them is to select the correct processor type.
>
> Sam
>
basically, makefiles are supposed to add the value of CFLAGS to their
flag variable. CXXFLAGS for c++ arguments. But i understand why the
kernel doesn't do this since it needs strict management over the build.

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



This archive was generated by hypermail 2b29 : Thu Jul 31 2003 - 22:00:23 EST