digitalmars.D - dmd and Archlinux
- Antonio Corbi (19/19) Jul 09 2017 Hi!
- Nemanja Boric (20/39) Jul 09 2017 Hm, I can't reproduce this issue with dmd 2.074.0-1. I've just
- Antonio Corbi (6/27) Jul 09 2017 Thank's!
- Seb (11/30) Jul 09 2017 I think the Arch Linux TUs are in the process of enabling -fPIC
- Antonio Corbi (5/17) Jul 09 2017 Hi Seb!
- Seb (9/29) Jul 09 2017 Maybe phobos/5586 [1] helps us. Of course the package would need
- Marco Leise (11/34) Jul 10 2017 The linker gold (since binutils 2.27) is problematic with DMD
- Seb (10/46) Jul 11 2017 @mleise: OP is using the testing repos where the PIE enforcement
- Jonathan M Davis via Digitalmars-d (5/14) Jul 11 2017 PIC and PIE may make sense from security perspective, but they've sure m...
- Marco Leise (9/26) Jul 12 2017 Am Tue, 11 Jul 2017 06:21:33 -0600
- Seb (13/61) Jul 15 2017 Bumping this as the PIE changes have been moved to core and as
- Vladimir Panteleev (4/7) Jul 19 2017 Looks like dmd got bumped to 2.075, and the problem is now
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
Jul 09 2017
On Sunday, 9 July 2017 at 18:35:09 UTC, Antonio Corbi wrote: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. CorbiHm, I can't reproduce this issue with dmd 2.074.0-1. I've just installed dmd and it works out of the box: ``` ➜ arch tmp% pacman -Q | grep phob libphobos-devel 1:2.074.0-1 ➜ arch tmp% pacman -Q | grep dmd dmd 1:2.074.0-1 ➜ arch tmp% cat test.d import std.stdio; void main() { writeln("hello!"); } ➜ arch tmp% dmd -c test.d ➜ arch tmp% dmd test.o ➜ arch tmp% ./test hello! ```
Jul 09 2017
On Sunday, 9 July 2017 at 19:15:15 UTC, Nemanja Boric wrote:On Sunday, 9 July 2017 at 18:35:09 UTC, Antonio Corbi wrote:Thank's! In my case the error persists. I'm using the testing repo...so I think it must be related to that. A. Corbi[...]Hm, I can't reproduce this issue with dmd 2.074.0-1. I've just installed dmd and it works out of the box: ``` ➜ arch tmp% pacman -Q | grep phob libphobos-devel 1:2.074.0-1 ➜ arch tmp% pacman -Q | grep dmd dmd 1:2.074.0-1 ➜ arch tmp% cat test.d import std.stdio; void main() { writeln("hello!"); } ➜ arch tmp% dmd -c test.d ➜ arch tmp% dmd test.o ➜ arch tmp% ./test hello! ```
Jul 09 2017
On Sunday, 9 July 2017 at 18:35:09 UTC, Antonio Corbi wrote: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. CorbiI think the Arch Linux TUs are in the process of enabling -fPIC by default, see e.g. [1] - it might be releated to this? In any case - building dmd/druntime/phobos with -fPIC enabled is a good idea and since 2.072.2 the official releases do so. Not sure why it's not done on Arch, maybe because Dicebot stepped down as maintainer? (see [2, 3]). [1] https://lists.archlinux.org/pipermail/arch-dev-public/2017-July/028918.html [2] http://forum.dlang.org/post/o6fbbu$1qli$1 digitalmars.com [3] http://forum.dlang.org/post/o6sldo$1pad$1 digitalmars.com
Jul 09 2017
On Sunday, 9 July 2017 at 19:21:48 UTC, Seb wrote:On Sunday, 9 July 2017 at 18:35:09 UTC, Antonio Corbi wrote:Hi Seb! I think you are right. Official releases (the ones downloaded from dlang.org via curl) work for me. A. Corbi[...]I think the Arch Linux TUs are in the process of enabling -fPIC by default, see e.g. [1] - it might be releated to this? In any case - building dmd/druntime/phobos with -fPIC enabled is a good idea and since 2.072.2 the official releases do so. Not sure why it's not done on Arch, maybe because Dicebot stepped down as maintainer? (see [2, 3]). [1] https://lists.archlinux.org/pipermail/arch-dev-public/2017-July/028918.html [2] http://forum.dlang.org/post/o6fbbu$1qli$1 digitalmars.com [3] http://forum.dlang.org/post/o6sldo$1pad$1 digitalmars.com
Jul 09 2017
On Sunday, 9 July 2017 at 19:33:45 UTC, Antonio Corbi wrote:On Sunday, 9 July 2017 at 19:21:48 UTC, Seb wrote:Maybe phobos/5586 [1] helps us. Of course the package would need to be rebuilt by the Arch Linux maintainers. Something I am not sure whether they are interested - the packages are orphaned and flagged out-of-date since more than a month [2]. Maybe you have an idea? [1] https://github.com/dlang/phobos/pull/5586 [2] http://forum.dlang.org/post/ppyeysvwmgjpchazuuwk forum.dlang.orgOn Sunday, 9 July 2017 at 18:35:09 UTC, Antonio Corbi wrote:Hi Seb! I think you are right. Official releases (the ones downloaded from dlang.org via curl) work for me. A. Corbi[...]I think the Arch Linux TUs are in the process of enabling -fPIC by default, see e.g. [1] - it might be releated to this? In any case - building dmd/druntime/phobos with -fPIC enabled is a good idea and since 2.072.2 the official releases do so. Not sure why it's not done on Arch, maybe because Dicebot stepped down as maintainer? (see [2, 3]). [1] https://lists.archlinux.org/pipermail/arch-dev-public/2017-July/028918.html [2] http://forum.dlang.org/post/o6fbbu$1qli$1 digitalmars.com [3] http://forum.dlang.org/post/o6sldo$1pad$1 digitalmars.com
Jul 09 2017
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. CorbiThe 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
Jul 10 2017
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>: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/5586Hi! 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. CorbiThe 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.
Jul 11 2017
On Tuesday, July 11, 2017 12:00:51 PM MDT Seb via Digitalmars-d wrote: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/5586PIC and PIE may make sense from security perspective, but they've sure made dealing with some the Linux distros over the last year or so a bit of a pain. - Jonathan M Davis
Jul 11 2017
Am Tue, 11 Jul 2017 06:21:33 -0600 schrieb Jonathan M Davis via Digitalmars-d <digitalmars-d puremagic.com>:On Tuesday, July 11, 2017 12:00:51 PM MDT Seb via Digitalmars-d wrote:It adds to security and adds another shovel of dirt on the grave of x86. X86 needs to emulate access to global constants in PIE, while amd64 is using offsets relative to the instruction pointer. RIP x86. (pun intended!) -- Marcomleise: 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/5586PIC and PIE may make sense from security perspective, but they've sure made dealing with some the Linux distros over the last year or so a bit of a pain. - Jonathan M Davis
Jul 12 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: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.htmlAm Sun, 09 Jul 2017 18:35:09 +0000 schrieb Antonio Corbi <aaacorbi mail.com>: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/5586Hi! 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. CorbiThe 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.
Jul 15 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!
Jul 19 2017