Should Druntime and Phobos be built with -gs ?

Vladimir Panteleev vladimir at thecybershadow.net
Wed Dec 5 19:48:20 PST 2012


On Thursday, 6 December 2012 at 03:31:42 UTC, Brad Roberts wrote:
> On 12/5/2012 10:32 AM, Vladimir Panteleev wrote:
>> On Tuesday, 4 December 2012 at 12:11:37 UTC, Jacob Carlborg 
>> wrote:
>>> Isn't it better to ship Phobos and druntime with debug 
>>> versions of the libraries as well.
>> 
>> Yes, providing something immediately usable with the -debuglib 
>> switch would be nice (I'd imagine a build without -O or
>> -inline). However, if the performance impact of -gs is 
>> negligible, there's little reason not to enable it in the 
>> release
>> version of Phobos. Those who want every 0.x% of performance 
>> can always build/write their own library.
>
> If it's the right thing to be doing, the better question is 
> 'why isn't it the default' and not an option that has to be
> turned on?

That's a good question, but changing DMD switches is probably not 
worth it at this point.

I took a look at what GCC does:

"-O also turns on -fomit-frame-pointer on machines where doing so 
does not interfere with debugging."

That's interesting... so, at least in some situations, there is 
some way to get a proper stack trace without stack frames.


More information about the Digitalmars-d mailing list