Update:

The changes have been merged into dmd and phobos master.
Almost all tests pass, some fail because something is not implement in libc and 
for a few I don't know yet what's the problem. I spent a lot of time on this 
already and didn't want this this to hold back the initial support.
There might still be minor issues all over the place because hand translating 
almost the entire libc headers into D is tedious work. I heavily relied on a 
test that checks that struct sizes and layouts match. Even though I checked the 
constants multiple times some might still be wrong. Thankfully lots of them are 
common with glibc on linux but there were lots of cases with subtle differences.

I have backports to gcc-11 and gcc-14/15 which are enough to bootstrap or cross 
compile an initial gdc (for both i686 and x86_64) that can then be used to 
build dmd. How is Dlang currently bootstrapped in debian and gentoo?
I also opened merge requests against gdc and ldc to wire up the relevant parts 
in their build systems which should make this easier once it is all available 
in a release.
I have not done much with ldc other than making sure it can successfully be 
built with either dmd or gdc and rebuild itself.

One issue with llvm was that the default LLVM_HOST_TRIPLE (xxxx-unknown-gnu) 
gets normalized to xxxx-unknown-unknown-gnu instead of xxxx-unknown-hurd-gnu 
which initially caused ldc to not correctly detect the os as Hurd. This seems 
to work with clang because there is an additional check to recognize 
*-unknown-gnu as a Hurd target presumably for compatibility with gcc.

The only other major project that tried to build so far is dub where I 
encountered problem with the compiler running out of memory compiling all the 
source files at once. Replacing the custom build script with meson to compile 
each file one by one helped with that.
I have had a lot of fun and learned a lot trying to get this to work although 
it was a bit more work than I initially thought. Many thanks to all the people 
that helped especially the helpful people on the Dlang forum and the dmd and 
gdc maintainers.

Y.

Reply via email to