Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Jan 2009 15:27:02 +0100
From:      =?ISO-8859-1?Q?Morgan_Wesstr=F6m?= <>
To:        FreeBSD Questions <>
Subject:   Re: default CFLAGS
Message-ID:  <>
In-Reply-To: <>
References:  <Pine.LNX.4.64.0901241734020.6296@localhost>	<>	<> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
RW wrote:
> On Sat, 24 Jan 2009 12:51:32 +0000
> Saifi Khan <> wrote:
>> on running the command 'make -V CFLAGS', the output is
>> -O2 -fno-strict-aliasing -pipe
>> i haven't setup the CPUTYPE anywhere (not as an env variable nor in
>> /etc/make.conf)
>> So are these default settings for a generc x86 based system ?
> Yes, if you are using i386. 
> Most CPUs have the same default CFLAGS, it's the value of CPUTYPE
> that's passed to the compiler that determines processor optimizations.

If you want to know what gcc processor optimizations will be enabled you
can do this:

Create hello.c:

#include <stdio.h>
	printf("hello, world\n");

Then compile it with -Q -v in addition to the default CFLAGS:

gcc -O2 -fno-strict-aliasing -pipe -Q -v -o hello hello.c

The section "options enabled" will list them all. I usually only add
"-march=native" to my CFLAGS to enable a few more CPU specific


Want to link to this message? Use this URL: <>