__FILE__ and __LINE__ again...

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Sep 12 06:56:37 PDT 2013


On Thu, Sep 12, 2013 at 03:37:58PM +0200, Dicebot wrote:
> On Tuesday, 10 September 2013 at 16:58:54 UTC, H. S. Teoh wrote:
> >On Tue, Sep 10, 2013 at 06:50:03PM +0200, Dicebot wrote:
> >>On Tuesday, 10 September 2013 at 16:45:33 UTC, H. S. Teoh wrote:
> >>>but you can get rid of this with link-time optimization (on Posix,
> >>>you'd add -L-gc-sections to your dmd command-line: this will cause
> >>>ld to delete code sections that are never referenced, which
> >>>includes the log() instantiations if indeed they have been
> >>>inlined).
> >>
> >>Using `--gc-sections` requires each function and data item to be
> >>placed into its own section (-fdata-sections and -ffunction-sections
> >>in gcc). AFAIK dmd does not do it.
> >
> >Hmm. Does that mean gdc supports that, then?
> 
> Actually I was wrong, looks like DMD does section differentiation by
> default. I am wondering if --gc-sections should be made default on
> Linux targets...

Interesting. However, I ran into some runtime segfaults caused by
--gc-sections yesterday. I didn't investigate further, but that makes me
hesitant to make --gc-sections the default. Something, somewhere, is
being broken by --gc-sections. It doesn't happen in all cases, though.
Only some of my programs are affected by it.

I should investigate this when I get some time.


T

-- 
Let's call it an accidental feature. -- Larry Wall


More information about the Digitalmars-d-learn mailing list