Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 May 2001 15:53:22 -0700
From:      Kris Kennaway <kris@obsecurity.org>
To:        Nuno Teixeira <nuno.mailinglists@pt-quorum.com>
Cc:        freebsd-stable@FreeBSD.ORG
Subject:   Re: CFLAGS Optimization
Message-ID:  <20010507155322.A69703@xor.obsecurity.org>
In-Reply-To: <20010507230417.F508-100000@gateway.bogus>; from nuno.mailinglists@pt-quorum.com on Mon, May 07, 2001 at 11:36:31PM %2B0100
References:  <20010507230417.F508-100000@gateway.bogus>

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

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

On Mon, May 07, 2001 at 11:36:31PM +0100, Nuno Teixeira wrote:
> Hello to all,
>=20
> I came from Linux and at that time I used CFLAGS to optimize general
> programs and linux kernel.
>=20
> For example:
>=20
> [i686]:
> CFLAGS=3D'-O9 -funroll-loops -ffast-math -malign-double -mcpu=3Dpentiumpro
> -march=3Dpentiumpro -fomit-frame-pointer -fno-exceptions'

This ridiculous level of optimization *will* give you problems (BTW,
what exactly do you think -O9 is supposed to do in gcc? Nothing more
than -O3, I think you'll find).  You can only safely use this kind of
optimization in individual programs which you have tested continue to
work when compiled that way; gcc is just too broken for this to work
in general.

For a general compiler setting, -O is the most you should go if you
don't want your binaries to break; the FreeBSD mailing lists are full
of documented cases where this has been demonstrated.

> Can I use CFLAGS on FreeBSD too? If I put the CFLAGS on
> /etc/defaults/make.conf, the kernel is affected by it?
> Does CFLAGS can optimize programs and kernel on FreeBSD OS?

It's all documented in /etc/defaults/make.conf -- come back if you
still have questions.

Kris
--XsQoSWH+UP9D9v3l
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.5 (FreeBSD)
Comment: For info see http://www.gnupg.org

iD8DBQE69ydhWry0BWjoQKURAr3OAKCHEWDH5tleDQ+uA1MVuUtTbMQE+ACeKRZT
tprrfK+dCICqjp+ZmZE1EbA=
=A8qw
-----END PGP SIGNATURE-----

--XsQoSWH+UP9D9v3l--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




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