July 15, 2017
On Tuesday, 11 July 2017 at 12:00:51 UTC, Seb wrote:
> On Tuesday, 11 July 2017 at 00:23:55 UTC, Marco Leise wrote:
>> Am Sun, 09 Jul 2017 18:35:09 +0000
>> schrieb Antonio Corbi <aaacorbi@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.
>
> @mleise: OP is using the testing repos where the PIE enforcement already landed [1], but libphobos.a isn't built with -fPIC on Arch yet.
> The Arch developers, however, are aware of the need to rebuild libphobos [2], but maybe we can simply build Phobos with -fPIC by default on Posix [3].
>
> [1] https://www.archlinux.org/todo/pie-rebuild
> [2] https://bugs.archlinux.org/task/54749
> [3] https://github.com/dlang/phobos/pull/5586

Bumping this as the PIE changes have been moved to core and as the maintainers haven't rebuilt Phobos with PIE yet, one will see messages like:

/usr/local/bin/ld: error: /usr/lib/libphobos2.a(encoding_4bd_6d6.o): requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC

A quick fix is:

curl https://i.dlang.io | bash -s dmd-2.074.0
sudo cp ~/dlang/dmd-2.074.0/linux/lib64/libphobos2.a /usr/lib

The official releases [1] are built with PIE=1

[1] http://dlang.org/download.html
July 20, 2017
On Saturday, 15 July 2017 at 19:00:57 UTC, Seb wrote:
> Bumping this as the PIE changes have been moved to core and as the maintainers haven't rebuilt Phobos with PIE yet, one will see messages like:

Looks like dmd got bumped to 2.075, and the problem is now finally gone :)

Thanks to Antonio Rojas for updating the package!

1 2
Next ›   Last »