dmd and Archlinux

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 10 17:23:55 PDT 2017


Am Sun, 09 Jul 2017 18:35:09 +0000
schrieb Antonio Corbi <aaacorbi at mail.com>:

> Hi!
> 
> Are there any news about the status of packaging dmd for 
> archlinux?
> 
> The last dmd compiler packaged is 2.074.0 and since the last 
> batch of updated packages in archlinux, dmd generated objects 
> fail to link with libphobos with erros like these:
> 
> /usr/bin/ld: /usr/lib/libphobos2.a(object_a_66e.o): relocation 
> R_X86_64_32 against `.rodata.str1.1' can not be used when making 
> a shared object; recompile con -fPIC
> /usr/bin/ld: /usr/lib/libphobos2.a(object_b_58c.o): relocation 
> R_X86_64_32 against `.rodata.str1.1' can not be used when making 
> a shared object; recompile con -fPIC
> /usr/bin/ld: /usr/lib/libphobos2.a(object_c_7f4.o): relocation 
> R_X86_64_32 against `.rodata.str1.1' can not be used when making 
> a shared object; recompile con -fPIC
> /usr/bin/ld: /usr/lib/libphobos2.a(object_d_a07.o): relocation 
> R_X86_64_32 against `.rodata.str1.1' can not be used when making 
> a shared object; recompile con ...
> 
> A. Corbi

The linker gold (since binutils 2.27) is problematic with DMD
and would emit such errors. (Is ld a symlink to ld.gold in
this case?) Also binutils 2.28 breaks how DMD's druntime
loads shared libraries. You have to either downgrade binutils
or use the hack of adding '-fPIC' when compiling executable
that link against shared libraries. binutils 2.26 should be
the most compatible version for the time being.

-- 
Marco



More information about the Digitalmars-d mailing list