shared lib

Jerry jlquinn at optonline.net
Mon Nov 14 08:31:09 PST 2011


Ellery Newcomer <ellery-newcomer at utulsa.edu> writes:

> trying to build a .so file (actually, trying to resuscitate pyd) with gdc.
>
> celerid is spitting out
>
> gdc -fPIC -nostartfiles -shared -fdebug {lots of object files plus some
> link directives}
>
> which is spitting out
>
> /usr/bin/ld: /usr/lib64/libgphobos2.a(object_.o): relocation
> R_X86_64_32S against `_D11TypeInfo_Pv6__initZ' can not be used when
> making a shared object; recompile with -fPIC
> /usr/lib64/libgphobos2.a: could not read symbols: Bad value
>
> any ideas what might be wrong?

Shared libs on linux require things to be compiled with -fPIC so the
code can be relocated.  The error looks like phobos wasn't build with
position-independent code.  Beyond that I don't know.

Jerry


More information about the Digitalmars-d-learn mailing list