From: Keir Fraser Subject: Re: [PATCH2] Don't optimize function calls with -g Date: Fri, 07 Mar 2008 13:36:31 +0000 Message-ID: References: <20080306160138.GB10848@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20080306160138.GB10848@implementation.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Samuel Thibault , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Should be in config/StdGNU.mk and config/SunOS.mk. Is optimize-sibling-call= s a gcc option that is supported in all our supported gcc versions? Note that we do CFLAGS ?=3D ... in StdGNU.mk and SunOS.mk right now. Probably these should be changed to +=3D. That still allows extra CFLAGS to be passed in on the make command line, but avoids the weird subservience of these debug-related CFLAG additions. Whether SunOS should really have different usage of omit-frame-pointer is open to argument. The Sun guys like to have frame pointers always, and it seems that is basically a general policy across Solaris binaries, so I let them have that difference. -- Keir On 6/3/08 16:01, "Samuel Thibault" wrote: > Samuel Thibault, le Thu 06 Mar 2008 15:55:09 +0000, a =E9crit : >> Use -fno-omit-frame-pointer in addition to -g >> as that permits to use simple stack walk while debugging >=20 > Even better: >=20 >=20 >=20 > Don't optimize function calls with -g > -fno-omit-frame-pointer to easily walk the stack > -fno-optimize-sibling-calls to not miss a step >=20 > Signed-off-by: Samuel Thibault >=20 > diff -r fb74347d80c3 Config.mk > --- a/Config.mk Wed Mar 05 12:20:40 2008 +0000 > +++ b/Config.mk Thu Mar 06 15:57:53 2008 +0000 > @@ -55,7 +55,7 @@ endef > endef > =20 > ifeq ($(debug),y) > -CFLAGS +=3D -g > +CFLAGS +=3D -g -fno-omit-frame-pointer -fno-optimize-sibling-calls > endif > =20 > CFLAGS +=3D -fno-strict-aliasing > diff -r fb74347d80c3 extras/mini-os/minios.mk > --- a/extras/mini-os/minios.mk Wed Mar 05 12:20:40 2008 +0000 > +++ b/extras/mini-os/minios.mk Thu Mar 06 15:57:53 2008 +0000 > @@ -15,7 +15,7 @@ DEF_LDFLAGS =3D > DEF_LDFLAGS =3D > =20 > ifeq ($(debug),y) > -DEF_CFLAGS +=3D -g > +DEF_CFLAGS +=3D -g -fno-omit-frame-pointer -fno-optimize-sibling-calls > else > DEF_CFLAGS +=3D -O3 > endif >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel