dlang - News Dashboard

D compilers now installed to /usr/lib

Posted: 2019-06-12 by Marco Leise
As of now the D compilers dmd and ldc2 will be installed into '/usr/lib/{dmd,ldc2}/$version' instead of '/opt/{dmd,ldc2}-$version'.

Your currently installed versions of dmd and ldc2 wont work as host compilers until they have been reinstalled. This almost certainly means that you have to bootstrap your recent dmd or ldc2 host compiler again with an older version written in C++, like ldc2-0.17 or dmd-2.067.

binutils 2.28 breaks dmd shared objects

Posted: 2017-07-06 by Marco Leise
We currently have two issues with the linkers in binutils. Since 2.27, the gold linker refuses to work with dmd, but that can be worked around by using ld.bfd (which is the default).

Now with binutils 2.28 we face a new issue. The way the druntime scans shared libraries for modules got broken and you see error messages of the form:

# Fatal Error while loading '/usr/lib/libphobos2.so.XX': # The module '<...>' is already defined in '<...>'

The bug report about that was first opened in May and as of now the answer is to compile all code with '-fPIC'.

# https://issues.dlang.org/show_bug.cgi?id=17375

For you reading this, there are three options to get there:

1. Append '-fPIC' to the DFLAGS of the DMD versions you need to work

 with binutils 2.28. If you only have one, it is in /etc/dmd.conf, if
 you have multiple versions installed pick them from /etc/dmd/.
2. Have the ebuilds append the flags during a reinstall of DMD.

 a) Using the 'selfhost' USE-flag.
 b) By first reinstalling DMD 2.067 (the last C++ based version) and
    then using that to compile one of the later (self-hosting)
    versions.
3. Install binutils 2.27, use

 # sudo binutils-config x86_64-pc-linux-gnu-2.27
 to activate it, reinstall DMD, then switch back to binutils 2.28.

More... (Archive)