From owner-freebsd-toolchain@FreeBSD.ORG Tue May 31 18:32:57 2011 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46E871065673; Tue, 31 May 2011 18:32:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 01C2A8FC0C; Tue, 31 May 2011 18:32:57 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:4518:389f:3ae0:4d26] (unknown [IPv6:2001:7b8:3a7:0:4518:389f:3ae0:4d26]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 012075C37; Tue, 31 May 2011 20:32:55 +0200 (CEST) Message-ID: <4DE53450.10109@FreeBSD.org> Date: Tue, 31 May 2011 20:32:48 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18pre) Gecko/20110527 Lanikai/3.1.11pre MIME-Version: 1.0 To: Alexander Best References: <3BF63174-1B29-4A4D-96DD-3ED65ED96EAC@bsdimp.com> <20110527181459.GA29908@freebsd.org> <20110527182906.GA31871@freebsd.org> <86oc2mlsey.fsf@gmail.com> <20110528182326.GA75447@freebsd.org> <20110528202619.GA27204@muon.cran.org.uk> <20110531095742.GA99888@freebsd.org> <4DE4C4CC.4020905@FreeBSD.org> <20110531104639.GA4218@freebsd.org> <24ADBA34-A5FC-4A67-8D6F-3BDAE158285C@gmail.com> <20110531143914.GA30260@freebsd.org> In-Reply-To: <20110531143914.GA30260@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Garrett Cooper , "freebsd-toolchain@FreeBSD.ORG" , Pan Tsu , "freebsd-hackers@FreeBSD.ORG" Subject: Re: [rfc] a few kern.mk and bsd.sys.mk related changes X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2011 18:32:57 -0000 On 2011-05-31 16:39, Alexander Best wrote: ... > ...which leads me to the conclusion that -O should be set when DEBUG was > defined: an all ARCHS. > > right now -fno-omit-frame-pointer is only set on amd64 and powerpc, if the > kernel contains DDB, KDTRACE_FRAME or HWPMC. how about this behavior? shouldn't > -fno-omit-frame-pointer be set uncondtitionally on all archs? No, not unconditionally on all archs. Some arches have no problem debugging when gcc's frame pointer is turned off, namely arm, ia64, mips, powerpc and sparc, if I read the source correctly. On these arches, even -O already sets -fomit-frame-pointer. So, for all arches, if DEBUG is enabled, we could just use -O (as default only, if the user wants to override this for whatever reason, it should be honoured). > just like > -fno-strict-aliasing? That should only be needed in combination with -O2, if that is the default optimization (e.g. if DEBUG is not enabled). IMHO this option should not be forced, if users specify their own CFLAGS/COPTFLAGS. Summarizing, I would suggest: - If DEBUG is enabled, use plain -O by default, on all arches - If DEBUG is disabled, use -O2 -fno-strict-aliasing by default, on all arches.