www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - shared defaultlib with dmd

reply forkit <forkit gmail.com> writes:
so I use this compile command (on Windows, using ldc)

-link-defaultlib-shared=true

Then (in simple example) the size of my compiled .exe:

 From 806KB down to 18KB

Oh. That's so much nicer on my SSD ;-)

(yes, I understand the implictions here of dynamic sharing, but I 
test/compile/debug so much, that I'd like to limit the impact on 
my SSD drive.

But I can't do this with dmd ?? it has not such option ??
Jan 18 2022
next sibling parent reply Adam D Ruppe <destructionator gmail.com> writes:
On Tuesday, 18 January 2022 at 22:04:15 UTC, forkit wrote:
 so I use this compile command (on Windows, using ldc)
On Linux dmd can do `-defaultlib=libphobos2.so` for the same thing. On Windows, dmd cannot handle a shared druntime.
Jan 18 2022
parent forkit <forkit gmail.com> writes:
On Tuesday, 18 January 2022 at 22:09:18 UTC, Adam D Ruppe wrote:
 On Tuesday, 18 January 2022 at 22:04:15 UTC, forkit wrote:
 so I use this compile command (on Windows, using ldc)
On Linux dmd can do `-defaultlib=libphobos2.so` for the same thing. On Windows, dmd cannot handle a shared druntime.
yes. but why? - is it technically too difficult? (ldc seems to have overcome that, if that's true)
Jan 18 2022
prev sibling parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Tue, Jan 18, 2022 at 10:04:15PM +0000, forkit via Digitalmars-d-learn wrote:
 so I use this compile command (on Windows, using ldc)
 
 -link-defaultlib-shared=true
 
 Then (in simple example) the size of my compiled .exe:
 
 From 806KB down to 18KB
 
 Oh. That's so much nicer on my SSD ;-)
 
 (yes, I understand the implictions here of dynamic sharing, but I
 test/compile/debug so much, that I'd like to limit the impact on my
 SSD drive.
[...] Uhm... are you SURE this is actually nicer on your SSD? For all you know, it could be writing the 806KB first and then optimizing that in-place to reduce it to 18KB... Just because the final file size is small doesn't mean there aren't any large intermediate files. T -- Never ascribe to malice that which is adequately explained by incompetence. -- Napoleon Bonaparte
Jan 18 2022
parent forkit <forkit gmail.com> writes:
On Tuesday, 18 January 2022 at 22:35:08 UTC, H. S. Teoh wrote:
 On Tue, Jan 18, 2022 at 10:04:15PM +0000, forkit via 
 Digitalmars-d-learn wrote:
 so I use this compile command (on Windows, using ldc)
 
 -link-defaultlib-shared=true
 
 Then (in simple example) the size of my compiled .exe:
 
 From 806KB down to 18KB
 
 Oh. That's so much nicer on my SSD ;-)
 
 (yes, I understand the implictions here of dynamic sharing, 
 but I test/compile/debug so much, that I'd like to limit the 
 impact on my SSD drive.
[...] Uhm... are you SURE this is actually nicer on your SSD? For all you know, it could be writing the 806KB first and then optimizing that in-place to reduce it to 18KB... Just because the final file size is small doesn't mean there aren't any large intermediate files. T
no. there are no intermediary files. just this, and only this: (bytes) 145 EZ_Compiler_tmpfile.d 15,360 EZ_Compiler_tmpfile.exe 18,384 EZ_Compiler_tmpfile.obj
Jan 18 2022