Thread overview
Phobos and Druntime compiler flags
Feb 08, 2013
Vladimir Panteleev
Feb 08, 2013
Vladimir Panteleev
Feb 08, 2013
David Nadlinger
Feb 08, 2013
Jacob Carlborg
Feb 08, 2013
Marco Leise
February 08, 2013
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?
February 08, 2013
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
February 08, 2013
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
February 08, 2013
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
February 08, 2013
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