Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 Sep 2012 23:50:35 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Eitan Adler <lists@eitanadler.com>
Cc:        Jake Smith <jake@avenue22.net>, freebsd-ports@freebsd.org, freebsd-hackers@freebsd.org
Subject:   Re: Building with WITH_DEBUG (-g) in make.conf
Message-ID:  <504677AB.8040908@FreeBSD.org>
In-Reply-To: <CAF6rxgncRbkdKHniV5qRSxxt2OR35LomeyJObugRkBeAYMBV6A@mail.gmail.com>
References:  <53c5133d8fac4f4353eda0add82e2234@viper-webmail.viper.enta.net> <CAF6rxgncRbkdKHniV5qRSxxt2OR35LomeyJObugRkBeAYMBV6A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2012-09-04 17:53, Eitan Adler wrote:
> On 4 September 2012 05:26, Jake Smith <jake@avenue22.net> wrote:
...
>> It got me thinking, is there any reason why it would be a bad idea to build
>> all my ports with debug symbols from now on?
>
>> Are there any performance hits
>
> Yes. Code size grows and the flags may enable internal
> debugging in the program itself.

There's a difference between just using '-g', which should never change
the behaviour of the program at runtime, and adding -DDEBUG or similar
flags on the command line, which may or may not enable extra code, or
even cause totally different code paths.

What is not different, is that both -g and other debugging options will
generally cause compiling and linking to take longer, since these stages
will have to process the additional debug information.


>> or security risks with this?
>
> no.

You cannot know in general.  If debug options enable a different code
path, you might as well get a security problem with it for free. :)

I have seen many debug printf's which could easily be exploited for
buffer overruns, etc.

However, only using '-g' should make no difference, indeed.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?504677AB.8040908>