Shared lib support for Linux

Long Chang changlong at jkys.info
Tue Mar 22 19:02:40 PDT 2011


On Tue, Mar 22, 2011 at 8:57 PM, Iain Buclaw <ibuclaw at ubuntu.com> wrote:
> == Quote from Long Chang (changlong at jkys.info)'s article
>> Hello ,
>> The DMD will support shared lib for linux in future,  But I wan't to
>> know when this can be completed .
>> I am try use GDC build libgdruntime.a with -fPIC,  and catch some
>> error I can't fix it .
>> for example:
>> ../../../../libphobos/rt/arraybyte.d
>> ../../../../libphobos/rt/arraybyte.d: In function
>> ‘_arraySliceExpAddSliceAssign_g’:
>> ../../../../libphobos/rt/arraybyte.d:220: error: PIC register ‘ebx
>>>> clobbered in ‘asm’
>> If Druntime team can help GDC team fix this issue will be great .
>> Kind Regards / Long Chang
>
> Ignoring any bugs in Druntime and DMD regarding PIC code generation; GDC puts all
> used registers in any given asm statement in the clobbered list. Without this, GCC
> will not know of their usage, and so assumes the register(s) are free, therefore
> it may decide to use them for storing other data.
>
> Regards
>
>

I delete all error asm code line,  it building success .

But when I build my project, got this error :

gcc -shared -o dmd_xtpl.so dmd_xtpl.o -L/home/opt/usr/local/lib64/
-lgphobos2 -lgdruntime -fPIC
/usr/bin/ld: /home/opt/usr/local/lib64//libgphobos2.a(errno_.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
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status


More information about the Digitalmars-d mailing list