gdc and ldc command line examples?

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 31 02:52:30 PDT 2015


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.


More information about the Digitalmars-d-learn mailing list