From owner-freebsd-questions@FreeBSD.ORG Sat Jan 24 14:27:06 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93E191065686 for ; Sat, 24 Jan 2009 14:27:06 +0000 (UTC) (envelope-from freebsd-questions@pp.dyndns.biz) Received: from proxy2.bredband.net (proxy2.bredband.net [195.54.101.72]) by mx1.freebsd.org (Postfix) with ESMTP id 48D2D8FC21 for ; Sat, 24 Jan 2009 14:27:06 +0000 (UTC) (envelope-from freebsd-questions@pp.dyndns.biz) Received: from ironport.bredband.com (195.54.101.120) by proxy2.bredband.net (7.3.127) id 494BF30200B11C35 for freebsd-questions@freebsd.org; Sat, 24 Jan 2009 15:27:04 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnQ5AMezeklV4jp1PGdsb2JhbACBbIclimABAQEBNbVYhUw X-IronPort-AV: E=Sophos;i="4.37,318,1231110000"; d="scan'208";a="477671710" Received: from c-753ae255.107-1-64736c10.cust.bredbandsbolaget.se (HELO gatekeeper.pp.dyndns.biz) ([85.226.58.117]) by ironport1.bredband.com with ESMTP; 24 Jan 2009 15:27:04 +0100 Received: from [192.168.69.67] (phobos [192.168.69.67]) by gatekeeper.pp.dyndns.biz (8.14.2/8.14.2) with ESMTP id n0OER2s3004876 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 24 Jan 2009 15:27:03 +0100 (CET) (envelope-from freebsd-questions@pp.dyndns.biz) Message-ID: <497B2536.7030907@pp.dyndns.biz> Date: Sat, 24 Jan 2009 15:27:02 +0100 From: =?ISO-8859-1?Q?Morgan_Wesstr=F6m?= User-Agent: Thunderbird 2.0.0.19 (X11/20090102) MIME-Version: 1.0 To: FreeBSD Questions References: <20090124124535.3006687c@gumby.homeunix.com> <9a52b1190901240451i14dc544fm1c241d6f43fa897b@mail.gmail.com> <20090124131629.1f9fabe4@gumby.homeunix.com> In-Reply-To: <20090124131629.1f9fabe4@gumby.homeunix.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: default CFLAGS X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jan 2009 14:27:07 -0000 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 main() { 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 optimizations. /Morgan