www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - gdc and ldc command line examples?

reply "Jeremy DeHaan" <dehaan.jeremiah gmail.com> writes:
Hey all,

I am finally working on moving out of dmd territory and playing 
with gdc and ldc. I was hoping that I could get some links to 
some example command lines. I'm mainly interested command lines 
regarding linking to libraries and building static libraries.

My guess is that gdc will function essentially the same as gcc 
for these things, or at least close enough to where I can figure 
it out, but I have had no experience with ldc and I am having 
trouble tracking down documentation for it.

Thanks!
Mar 30 2015
next sibling parent "Dennis Ritchie" <dennis.ritchie mail.ru> writes:
On Tuesday, 31 March 2015 at 04:59:35 UTC, Jeremy DeHaan wrote:
 Hey all,

 I am finally working on moving out of dmd territory and playing 
 with gdc and ldc. I was hoping that I could get some links to 
 some example command lines. I'm mainly interested command lines 
 regarding linking to libraries and building static libraries.

 My guess is that gdc will function essentially the same as gcc 
 for these things, or at least close enough to where I can 
 figure it out, but I have had no experience with ldc and I am 
 having trouble tracking down documentation for it.

 Thanks!
You can try to read this: http://wiki.dlang.org/GDC/Using_GDC http://llvm.org/docs/CommandGuide/index.html
Mar 30 2015
prev sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Tuesday, 31 March 2015 at 04:59:35 UTC, Jeremy DeHaan wrote:
 Hey all,

 I am finally working on moving out of dmd territory and playing 
 with gdc and ldc. I was hoping that I could get some links to 
 some example command lines. I'm mainly interested command lines 
 regarding linking to libraries and building static libraries.

 My guess is that gdc will function essentially the same as gcc 
 for these things, or at least close enough to where I can 
 figure it out, but I have had no experience with ldc and I am 
 having trouble tracking down documentation for it.

 Thanks!
$ ldc2 | grep link -L=<linkerflag> - Pass <linkerflag> to the linker -c - Do not link -disable-linker-strip-dead - Do not try to remove unused symbols during linking -linkonce-templates - Use linkonce_odr linkage for template symbols instead of weak_odr $ ldc2 | grep lib -debuglib=<lib1,lib2,...> - Default libraries for debug info build (overrides previous) -defaultlib=<lib1,lib2,...> - Default libraries for non-debug-info build (overrides previous) -disable-simplify-libcalls - Disable simplification of well-known C runtime calls -lib - Create static library -shared - Create shared library it's all pretty self-explanatory if you're familiar with the gnu toolchain. Feel free to ask about any specifics.
Mar 31 2015