Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Apr 2008 21:11:07 +0200
From:      Roland Smith <rsmith@xs4all.nl>
To:        David Allen <the.real.david.allen@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Setting CPUTYPE and CFLAGS in make.conf
Message-ID:  <20080409191107.GA2998@slackbox.xs4all.nl>
In-Reply-To: <2daa8b4e0804091135w4b31ea67vf6334fa83845a4e1@mail.gmail.com>
References:  <2daa8b4e0804081314o25b9773bn844734b674856e8c@mail.gmail.com> <20080409184435.3bb4b91c@gumby.homeunix.com.> <2daa8b4e0804091135w4b31ea67vf6334fa83845a4e1@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--FCuugMFkClbJLl1L
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Apr 09, 2008 at 11:35:51AM -0700, David Allen wrote:
> > Avoid setting CFLAGS unless you have a good reason - Gentoo
> > documentation has a lot to answer for. CPUTYPE causes "-march" to be
> > applied, so it can affect compatibility. AFAIK both setting do affect
> > world and kernel because CFLAGS can cause a build to fail, and I've
> > seen matching march settings in kernel builds.
> >
> > > Or are those settings relevant to the
> > > compilation process only?  Or to both the compilation process and the
> > > actual performance of the binary?
> >
> > It can be either, -O2 is related to execution, -pipe speeds-up
> > compilation.
>=20
> Thank you for your reply.   It's starting to make a lot more sense.
> Just to confirm, then, if there's no CPUTYPE set,  I can then set up
> a build server on an Opteron box, for example, to build world, kernel
> and ports binaries that can then be installed on my Thinkpad or
> a PIII box?

Only if they use the same architecture! If your opteron is running amd64, i=
ts
binaries won't run on a pIII, which can only run the i386 architecture.

If you read through /usr/src/share/mk/bsd.cpu.mk you can see the
different CPU types and the effect they have on build
parameters. E.g. on the i386 architecture, if no CPUTYPE is set, the CPU
type is set to i486, which is the lowest common denominator that gcc suppor=
ts.

Roland
--=20
R.F.Smith                                   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)

--FCuugMFkClbJLl1L
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.8 (FreeBSD)

iEYEARECAAYFAkf9FMsACgkQEnfvsMMhpyW/OgCfQZRBbzVwSSBk3T9tQL+NYlfj
QJgAnjYzT5m07jh6MdxqMbHN+l9n1Z8P
=WSmu
-----END PGP SIGNATURE-----

--FCuugMFkClbJLl1L--



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