www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Phobos and Druntime compiler flags

reply "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
Some questions about the default DFLAGS settings in Phobos and 
Druntime makefiles:

1. Why is -g or -gc not used? Are there any situations where the 
presence of debug information in the static library undesirable?

2. Why is -inline not used in Phobos?

3. Any reason why -gs is not used?
Feb 08 2013
next sibling parent "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
On Friday, 8 February 2013 at 09:24:26 UTC, Vladimir Panteleev 
wrote:
 3. Any reason why -gs is not used?

I just remembered that -gs with -O -lib causes an ICE: http://d.puremagic.com/issues/show_bug.cgi?id=9261
Feb 08 2013
prev sibling next sibling parent reply "David Nadlinger" <see klickverbot.at> writes:
On Friday, 8 February 2013 at 09:24:26 UTC, Vladimir Panteleev 
wrote:
 Some questions about the default DFLAGS settings in Phobos and 
 Druntime makefiles:

 1. Why is -g or -gc not used? Are there any situations where 
 the presence of debug information in the static library 
 undesirable?

 2. Why is -inline not used in Phobos?

 3. Any reason why -gs is not used?

Just to get some extra feedback: LDC currently ships with 2 versions of the standard library, a release one built with the equivalent of "-O -release -inline", and a debug one built with "-g". The debug one is set as "-debuglib" and thus automatically used every time the user compiles their code with "-g", which could lead to some unnecessary slowdowns, as not every time you want to debug into the standard library code. On the other hand, you typically _do_ want to have the assertions in the standard library turned on when you debug your own code, so... David
Feb 08 2013
parent Jacob Carlborg <doob me.com> writes:
On 2013-02-08 14:39, David Nadlinger wrote:

 Just to get some extra feedback: LDC currently ships with 2 versions of
 the standard library, a release one built with the equivalent of "-O
 -release -inline", and a debug one built with "-g".

 The debug one is set as "-debuglib" and thus automatically used every
 time the user compiles their code with "-g", which could lead to some
 unnecessary slowdowns, as not every time you want to debug into the
 standard library code. On the other hand, you typically _do_ want to
 have the assertions in the standard library turned on when you debug
 your own code, so...

I think that's good approach. The use can always remove/change the -debuglib flag if necessary, right? -- /Jacob Carlborg
Feb 08 2013
prev sibling parent Marco Leise <Marco.Leise gmx.de> writes:
Am Fri, 08 Feb 2013 16:02:14 +0100
schrieb Jacob Carlborg <doob me.com>:

 On 2013-02-08 14:39, David Nadlinger wrote:
 
 Just to get some extra feedback: LDC currently ships with 2 versions of
 the standard library, a release one built with the equivalent of "-O
 -release -inline", and a debug one built with "-g".

 The debug one is set as "-debuglib" and thus automatically used every
 time the user compiles their code with "-g", which could lead to some
 unnecessary slowdowns, as not every time you want to debug into the
 standard library code. On the other hand, you typically _do_ want to
 have the assertions in the standard library turned on when you debug
 your own code, so...

I think that's good approach. The use can always remove/change the -debuglib flag if necessary, right?

Yes, there are flags for practically everything, from overriding the standard library to removing function post condition checks. -- Marco
Feb 08 2013