www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - How to stop DMD from linking against phobos

reply Benjamin Thaut <code benjamin-thaut.de> writes:
Is there a way to stop dmd from linking against phobos?
(Most preferred would be some command line parameters to dmd)

Kind Regards
Benjamin Thaut
Dec 08 2011
next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Thu, 08 Dec 2011 12:50:36 -0500, Benjamin Thaut  
<code benjamin-thaut.de> wrote:

 Is there a way to stop dmd from linking against phobos?
 (Most preferred would be some command line parameters to dmd)

Just don't use dmd to link. I think there is a way to replace phobos, but not just make it disappear. -Steve
Dec 08 2011
prev sibling next sibling parent reply David Nadlinger <see klickverbot.at> writes:
On 12/8/11 6:50 PM, Benjamin Thaut wrote:
 Is there a way to stop dmd from linking against phobos?
 (Most preferred would be some command line parameters to dmd)

 Kind Regards
 Benjamin Thaut

See the -defaultlib and -debuglib switches. druntime is hardcoded anyway, so you could e.g. use: dmd -defaultlib="druntime -debuglib="druntime" Hope this helps, David
Dec 08 2011
parent Jacob Carlborg <doob me.com> writes:
On 2011-12-08 19:11, David Nadlinger wrote:
 On 12/8/11 6:50 PM, Benjamin Thaut wrote:
 Is there a way to stop dmd from linking against phobos?
 (Most preferred would be some command line parameters to dmd)

 Kind Regards
 Benjamin Thaut

See the -defaultlib and -debuglib switches. druntime is hardcoded anyway, so you could e.g. use:

druntime is statically linked with Phobos. -- /Jacob Carlborg
Dec 08 2011
prev sibling next sibling parent reply "Martin Nowak" <dawg dawgfoto.de> writes:
On Thu, 08 Dec 2011 18:50:36 +0100, Benjamin Thaut  
<code benjamin-thaut.de> wrote:

 Is there a way to stop dmd from linking against phobos?
 (Most preferred would be some command line parameters to dmd)

 Kind Regards
 Benjamin Thaut

We should fix defaultlib and debuglib to accept empty values. Can you make a bug report for it. Currently you can call 'dmd ... -v' to see the linker (gcc) call, then you could repeat this step without -lphobos2.
Dec 08 2011
parent mta`chrono <chrono mta-international.net> writes:
 Is there a way to stop dmd from linking against phobos?
 (Most preferred would be some command line parameters to dmd)

We should fix defaultlib and debuglib to accept empty values. Can you make a bug report for it.

# dmd code.d -v -defaultlib="" gcc code.o -o code -m64 -Xlinker -L/usr/lib32 -Xlinker -L/usr/lib64 -Xlinker --export-dynamic -lrt -l -lpthread -lm -lrt This line works for me. I can't tell you why dmd invokes gcc instead of ld. But you could also use -c switch and call the linker manually.
Dec 09 2011
prev sibling parent "Martin Nowak" <dawg dawgfoto.de> writes:
On Fri, 09 Dec 2011 10:17:00 +0100, mta`chrono  
<chrono mta-international.net> wrote:

 Is there a way to stop dmd from linking against phobos?
 (Most preferred would be some command line parameters to dmd)

We should fix defaultlib and debuglib to accept empty values. Can you make a bug report for it.

# dmd code.d -v -defaultlib="" gcc code.o -o code -m64 -Xlinker -L/usr/lib32 -Xlinker -L/usr/lib64 -Xlinker --export-dynamic -lrt -l -lpthread -lm -lrt This line works for me. I can't tell you why dmd invokes gcc instead of ld. But you could also use -c switch and call the linker manually.

Because you need the C runtime startup objects.
Dec 12 2011