[dmd-internals] -defaultlib vs -debuglib semantics

David Nadlinger via dmd-internals dmd-internals at puremagic.com
Fri May 20 15:44:37 PDT 2016


On 20 May 2016, at 17:28, Михаил Страшун via dmd-internals 
wrote:
> Is this by design? Would that be something you could consider 
> changing?
> Keeping debug symbols in libraries has very low performance impact
> compared to keeping contracts, there doesn't seem to be any practical
> reason to connect linking special kind of library to it.

For LDC (where we have actually been shipping a debug build for a long 
time), I found that there is really no good option of tying the 
defaultlib/debuglib selection to. As you also discovered, some of the 
druntime contracts turn constant-time operations into linear-time ones 
and things like that.

What I ended up doing is to introduce a `-link-debuglib` switch so that 
people can choose explicitly (but the libraries can still be set up in 
the config file and so on). This might not be compatible with DMD's 
command line design philosophy, of course, but you might find some more 
background information searching our GitHub project for "debuglib".

  — David



More information about the dmd-internals mailing list