Re: processor optimisations for pkgsrsc
From: Brian A. Sekcli (lavalamp_at_spiritual-machines.org)
Date: 10/19/03
- Previous message: Brian A. Sekcli: "Re: Keyboard freezes afterboot"
- In reply to: Psyco F. die Geissel der Galaxis: "processor optimisations for pkgsrsc"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 19 Oct 2003 00:26:54 -0400
> Well, looked through the packagesrc-docu but didn't find any information
> about using a specific target architecture. Seems not to be of the
> /etc/mk.conf either?
CPUFLAGS(1) NetBSD General Commands Manual CPUFLAGS(1)
NAME
cpuflags - determine compiler flags to best target current cpu
SYNOPSIS
cpuflags [cc_pathname]
DESCRIPTION
cpuflags queries the current cpu type and gcc version, then outputs
appropriate compiler options to best target code for that cpu. If no
options exist to target the current cpu then nothing is output.
In the event of the cpu not being recognised, a warning is sent to
stderr.
If cc_pathname is not specified it defaults to the first cc found in the
path.
ENVIRONMENT
The makefile fragment /usr/pkg/share/mk/cpuflags.mk will set the follow-
ing make(1) variables, plus add CPU_FLAGS and CPU_DIR to .MAKEFLAGS for
sub-makes.
CPU_FLAGS The output of cpuflags
CPU_DIR CPU_FLAGS with spaces stripped (eg: for use in PACKAGES)
CFLAGS Has CPU_FLAGS appended
CXXFLAGS Has CPU_FLAGS appended
FILES
/usr/pkg/share/mk/cpuflags.mk Set appropriate compiler flags based
on the output from cpuflags. Suitable
for inclusion in /etc/mk.conf
/usr/pkg/share/mk/optimize_gcc.mk Attempt to set additional -mXXX gcc
flags based on gcc version and pack-
ages being compiled. Note: This is
experimental and not supported.
EXAMPLES
cpuflags can be used to set default flags for building entries from
pkgsrc and recompiling the NetBSD kernel or userland by adding the fol-
lowing to /etc/mk.conf:
.sinclude "/usr/pkg/share/mk/cpuflags.mk"
Those desiring further optimisation can install the lang/gcc3 package,
and add the following to /etc/mk.conf instead:
.sinclude "/usr/pkg/share/examples/gcc/mk.conf"
.sinclude "/usr/pkg/share/mk/cpuflags.mk"
To experiment with optimisations that can break generated code there is
optimize_gcc.mk. This is unsupported, but for full effect add the follow-
ing to /etc/mk.conf:
.sinclude "/usr/pkg/share/examples/gcc/mk.conf"
.sinclude "/usr/pkg/share/mk/cpuflags.mk"
.sinclude "/usr/pkg/share/mk/optimize_gcc.mk"
On all except low memory machines compliation can be speeded up by adding
the following to /etc/mk.conf. (Note this will not affect the binaries
produced)
COPTS+=-pipe
CFLAGS+=-pipe
BUGS
cpuflags still needs to learn about more cpu types - updates welcomed to
<abs@netbsd.org>.
Currently cpuflags is also gcc specific.
NetBSD 1.6 May 31, 2001 NetBSD 1.6
- Previous message: Brian A. Sekcli: "Re: Keyboard freezes afterboot"
- In reply to: Psyco F. die Geissel der Galaxis: "processor optimisations for pkgsrsc"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|