From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 22 21:07:04 2006 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.ORG Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5769316A4A7 for ; Fri, 22 Dec 2006 21:07:04 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout3.cac.washington.edu (mxout3.cac.washington.edu [140.142.32.166]) by mx1.freebsd.org (Postfix) with ESMTP id 36C8B13C461 for ; Fri, 22 Dec 2006 21:07:04 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.141] (may be forged)) by mxout3.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW06.09) with ESMTP id kBMHsKJ1025588 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 22 Dec 2006 09:54:20 -0800 X-Auth-Received: from [128.208.4.96] (dzihan.cs.washington.edu [128.208.4.96]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW06.09) with ESMTP id kBMHsJAZ011526 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 22 Dec 2006 09:54:20 -0800 Message-ID: <458C1BCB.6040907@u.washington.edu> Date: Fri, 22 Dec 2006 09:54:19 -0800 From: Garrett Cooper User-Agent: Thunderbird 1.5.0.8 (X11/20061108) MIME-Version: 1.0 To: freebsd-hackers@FreeBSD.ORG References: <200612220850.kBM8oDD0037287@lurza.secnetix.de> In-Reply-To: <200612220850.kBM8oDD0037287@lurza.secnetix.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.2.2.285561, Antispam-Engine: 2.5.0.283055, Antispam-Data: 2006.12.22.93433 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' Cc: Subject: Re: Properly controlling CFLAGS/CXXFLAGS X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2006 21:07:04 -0000 Oliver Fromme wrote: > Garrett Cooper wrote: > > I was wondering (looking at the make.conf manpage), what's the > > best way to control one's CFLAGS/CXXFLAGS. I'd prefer if only a few > > ports would have optimized compiler flags, while the rest of the system > > used a safe set of compiler flags. > > The simplest way is to use conditionals in /etc/make.conf > depending on the ports directory: > > .if ${.CURDIR:M*/somecategory/someport} > CFLAGS= -O3 -pipe > CFLAGS+= -DSOMETHING > .endif > > > CFLAGS= -O2 -pipe > > Using -O2 without -fno-strict-aliasing will break certain > programs. The default is -O2 -fno-strict-aliasing -pipe > and it is _not_ recommended to override it globally, or > otherwise you're guaranteed to shoot yourself in the foot, > sooner or later. > > > COPTFLAGS= ${CFLAGS} -msse -msse2 -mfpmath=sse,387 > > That will break kernel compiles. Again, you should not > override COPTFLAGS, unless you know exactly what you're > doing. > > Best regards > Oliver > > Interesting. No wonder I didn't have it in my Gentoo /etc/make.conf. It appears (from what I see) that maybe -fno-strict-aliasing has been enabled by default (at least it doesn't show up in the GCC 4.1.1 manpage on FC5). -Garrett