Subject: Re: Compiler flags
To: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
From: David Brownlee <abs@netbsd.org>
List: port-sparc
Date: 03/16/2003 01:53:28
On Sat, 15 Mar 2003, Hauke Fath wrote:

> >Look at pkgsrc/devel/cpuflags.
>
> ...which has its own set of problems. Setting COPTS unconditionally in
> /etc/mk.conf causes it not to be set in the system makefiles, and you may
> end up without any optimization. That in turn can cause 'interesting'
> compile faults.

	That would have been a problem for kernel compiles - cpuflags
	adds ${DEFCOPTS} to ${COPTS} to avoid this. Before august
	'02 it didn't do this which was decidedly suboptimal.

> >From my /etc/mk.conf (for sun4m):
>
> .if ${_HOST_ARCH} == ${MACHINE_ARCH}
> CFLAGS +=               -mcpu=supersparc -mtune=supersparc
> CXXFLAGS +=             -mcpu=supersparc -mtune=supersparc
> COPTS =                 -mcpu=supersparc -mtune=supersparc -O2 -pipe
> .endif

	If cpuflags detects you are cross compiling it avoids setting
	any compiler flags :)

	If anyone finds cpuflags doesn't pick the right flags for any
	situation - just let me know :)

-- 
		David/absolute          -- www.netbsd.org: No hype required --