Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Mar 2011 22:56:52 +0000
From:      Alexander Best <arundel@freebsd.org>
To:        George Liaskos <geo.liaskos@gmail.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: r219385 build error.
Message-ID:  <20110307225652.GA61509@freebsd.org>
In-Reply-To: <AANLkTinfQv3y0yohB4qtRL9JOktqa76SvB%2Bw0WpEzAXh@mail.gmail.com>
References:  <AANLkTikc-Z9mjmQ7EWnWdqz297hHQ_Kt2k9z05FaNv-y@mail.gmail.com> <20110307205957.GA47557@freebsd.org> <AANLkTimJpsr=38UPswCXUmajNixTs1qS-8FxT36xAK4V@mail.gmail.com> <20110307214935.GA53914@freebsd.org> <AANLkTinfQv3y0yohB4qtRL9JOktqa76SvB%2Bw0WpEzAXh@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue Mar  8 11, George Liaskos wrote:
> > either "native" or "nocona" (actually native should evaluate to nocona):
> >
> > touch _native_test.c && gcc -march=native -### _native_test.c
> >
> > should tell which -march and -mtune settings gcc assumes for "native".
> >
> > indeed there are some known problems with "native", but i think those are
> > limited to architectures such as mips and arm. with i386 or amd64 "native"
> > shouldn't cause any problems.
> >
> > i think core2 was always wrong to set in make.conf, because the base gcc simply
> > does not support it. however so many people are trying to boost speed etc. by
> > adding make.conf options they find scattered over the internet and on various
> > linux dist wikis, that core2 was added as a workaround so people could use it
> > (even though it wasn't supported).
> 
> I still don't understand how bsd.cpu.mk is going to handle "native" as
> value to set CPUTYPE / MACHINE_CPU, or this is irrelevant?
> Would it be better to use the following?

"native" doesn't get handled by bsd.cpu.mk at all! it gets passed to gcc
directly and gcc choses -m{tune,arch} on it's own.

don't add -march=* directly to CFLAGS. this is bound to go wrong at some
point. use CPUTYPE to set the cpu and CFLAGS for -O*, -pipe, etc.

also please keep in mind that the optimisations that can be achieved by
finetuning make.conf are rather minor. some people think that with
cflags and cpu juju they can boost the OS. i don't believe that's true. the
chances are much greater that you're adding a problematic switch and end up
with binaries during installworld that segfault. so it's not really worth
getting into this kinda trouble just for the sake of optimisation.

a simple

CPUTYPE ?= native
COPTFLAGS = -O0 -pipe
CFLAGS = -O2 -pipe

should be close to perfekt. ;)

cheers.
alex

> 
> CPUTYPE?=nocona
> NO_CPU_CFLAGS=yes
> NO_CPU_COPTFLAGS=yes
> CFLAGS+= -march=native
> 
> Thank you for your clarifications.

-- 
a13x



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110307225652.GA61509>