Nothing much that can be done here except get the package maintainer to fix the installation paths of ldc.<br><br>The phobos/druntime sources will always differ between each compiler runtime library as there're many local changes that aren't accepted in upstream.<br><br>--<br>Iain<br><br><br><br><br>-------- Original Message --------<br>On Nov 20, 2019, 10:51 PM, mipri via D.gnu < d.gnu@puremagic.com> wrote:<br>Howdy,<br>This was the case in Fedora 30, and is now the case in Fedora 31.<br>RPMs are available for gdc and for ldc2, but when both are<br>installed gdc can't compile anything as it tries to load a version<br>of phobos installed by ldc2 which has features gdc doesn't yet<br>support. For someone who's decided to just use gdc for a project,<br>they have the easy fix of just uninstalling ldc2, but I'd expect<br>that someone evaluating D as a language will be interested in<br>comparing the different compilers, so all the compilers will be<br>installed--and then only dmd and ldc will be functional.<br>As commands:<br>dnf install gcc-gdc ldc<br>echo 'void main() { import std.stdio; writeln("hello"); }' ><br>hello.d<br>gdc hello.d<br>This will fail due to ldc-phobos-devel's files in /usr/include/d:<br>/usr/include/d/core/internal/hash.d:426:16: error: basic type<br>expected, not foreach<br>426 | static foreach (i; 0 .. T.sizeof / size_t.sizeof)<br>| ^<br>/usr/include/d/core/internal/hash.d:426:16: error: no identifier<br>for declarator _error_<br>426 | static foreach (i; 0 .. T.sizeof / size_t.sizeof)<br>| ^<br>/usr/include/d/core/internal/traits.d:175:12: error: declaration<br>expected, not 'foreach'<br>175 | static foreach (Ti; T)<br>| ^<br>/usr/include/d/core/internal/traits.d:175:26: error: no<br>identifier for declarator T<br>175 | static foreach (Ti; T)<br>| ^<br>/usr/include/d/core/internal/traits.d:175:26: error: declaration<br>expected, not ')'<br>175 | static foreach (Ti; T)<br>| ^<br>/usr/include/d/core/internal/traits.d:182:5: error: unrecognized<br>declaration<br>182 | }<br>| ^<br>gdc installs its own files into path[1] but prefers<br>/usr/include/d:<br>import path[0] = /usr/include/d<br>import path[1] = /usr/lib/gcc/x86_64-redhat-linux/9/include/d<br>and I haven't found a way, in gdc's manpage or in (the much less<br>examined) gcc documentation, to skip the first path. I'm also not<br>sure what a proper fix would be. Maybe the ldc rpm should be<br>updated to install phobos into a similarly ldc-specific directory.<br>Maybe a gdc update will happen soon and ldc's phobos files will be<br>acceptable to it.<br>Mainly I want to mention it here so that people can find it and<br>not<br>just think that gdc is broken on Fedora, like I thought for a good<br>while.<br>