www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Does dmd use static or dynamic linking with the Phobos Library?

reply "WhatMeWorry" <kc_heaser yahoo.com> writes:
Is this user configurable?  I came across the sentence in the D 
Compiler/Linking section:

"The actual linking is done by running gcc"

I thought that maybe this meant that I could pass a gcc option 
like -static or -shared through dmd, but it errored out.

Thanks in advance.
Apr 30 2012
next sibling parent "Nick Sabalausky" <SeeWebsiteToContactMe semitwist.com> writes:
"WhatMeWorry" <kc_heaser yahoo.com> wrote in message 
news:ezfjpijdnokmihhrptnq forum.dlang.org...
 Is this user configurable?  I came across the sentence in the D 
 Compiler/Linking section:

 "The actual linking is done by running gcc"

 I thought that maybe this meant that I could pass a gcc option 
 like -static or -shared through dmd, but it errored out.

 Thanks in advance.

Static. Dynamic linking with Phobos is currently being worked on.
Apr 30 2012
prev sibling next sibling parent "WhatMeWorry" <kc_heaser yahoo.com> writes:
On Tuesday, 1 May 2012 at 02:47:35 UTC, Nick Sabalausky wrote:
 "WhatMeWorry" <kc_heaser yahoo.com> wrote in message
 news:ezfjpijdnokmihhrptnq forum.dlang.org...
 Is this user configurable?  I came across the sentence in the 
 D Compiler/Linking section:

 "The actual linking is done by running gcc"

 I thought that maybe this meant that I could pass a gcc option 
 like -static or -shared through dmd, but it errored out.

 Thanks in advance.

Static. Dynamic linking with Phobos is currently being worked on.

I should also have read more before posting. Just found this link. http://prowiki.org/wiki4d/wiki.cgi?D__Tutorial/CompilingLinkingD#Linkingmanually
Apr 30 2012
prev sibling parent Jacob Carlborg <doob me.com> writes:
On 2012-05-01 04:46, WhatMeWorry wrote:
 Is this user configurable? I came across the sentence in the D
 Compiler/Linking section:

 "The actual linking is done by running gcc"

 I thought that maybe this meant that I could pass a gcc option like
 -static or -shared through dmd, but it errored out.

Unfortunately you cannot pass GCC options. You can only pass linker options using the -L flag. So if you pass: dmd -L-foo DMD will translate that to: gcc -Xlinker -foo Note that DMD has the -shared flag. But the runtime isn't capable to handle dynamic libraries. -- /Jacob Carlborg
May 01 2012