Bind D as a shared lib for ldc

kinke via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Wed Jul 26 05:31:49 PDT 2017


On Wednesday, 26 July 2017 at 06:53:36 UTC, Prasun Anand wrote:
> $ ldc2 -shared -m64 -relocation-model=pic i.d
> /usr/bin/ld: 
> /home/prasun/ldclatest/ldc-1.1.0-pk9rkm4zvdp6pglam7s2/lib/libdruntime-ldc.a(errno.c.o): relocation R_X86_64_PC32 against undefined symbol `__errno_location@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC

The druntime and Phobos libraries you're linking against are 
static ones and haven't been compiled as 
position-independent-code. The LDC 1.3 package ships with shared 
runtime libs too; select them via 
`-defaultlib=druntime-ldc-shared,phobos2-ldc-shared 
-debuglib=druntime-ldc-debug-shared,phobos2-ldc-debug-shared`, 
that should work.


More information about the digitalmars-d-ldc mailing list