Subject: Re: mplayer, movies.
To: David Brownlee <abs@netbsd.org>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-help
Date: 05/13/2003 08:49:38
On Tue, 13 May 2003, David Brownlee wrote:

> On Tue, 13 May 2003, henry nelson wrote:
>
> > I'd really like to try something like "submodel optimization" of kernels
> > for some of my older hardware.  How do you pass flags like "-O3 -march=k6-2"
> > to the compiler, and how would I know what value is right for what machine?
> > Haven't any idea what docs I should be looking for.  TIA!
>
> 	devel/cpuflags should tell you the best architecture flags for
> 	your CPU. Look at the cpuflags.mk it installs to work out how
> 	best to add -O3 without breaking any other flag settings :)

Right -- it doesn't always work. All the options themselves are
documented in the gcc info file, that you see with "info gcc". You can
pass them into the kernel build by setting ${COPTS} in the kernel
config file, like so:

makeoptions     COPTS="-O2 -mcpu=i686"

You might also set ${CC} to a different compiler (gcc-3.2.3 and
gcc-3.3 have more knobs for all the various processors, but with 3.3,
more of them are broken), and if you do that, you'll probably also
have to set ${DEFWARNINGS} to "no", to turn off all warnings, just to
get it to build.

It should go without saying, that if you encounter wierd behaviour
from your heavily optimized binaries and kernels, you should try to
reproduce with a standard binary before reporting it as a bug.

Frederick