Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 May 2011 20:32:48 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Alexander Best <arundel@freebsd.org>
Cc:        Garrett Cooper <yanegomi@gmail.com>, "freebsd-toolchain@FreeBSD.ORG" <freebsd-toolchain@FreeBSD.ORG>, Pan Tsu <inyaoo@gmail.com>, "freebsd-hackers@FreeBSD.ORG" <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: [rfc] a few kern.mk and bsd.sys.mk related changes
Message-ID:  <4DE53450.10109@FreeBSD.org>
In-Reply-To: <20110531143914.GA30260@freebsd.org>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DE53450.10109>