Building DMD on OpenBSD

Seb seb at
Fri Dec 28 01:28:31 UTC 2018

On Wednesday, 26 December 2018 at 21:17:13 UTC, Ryan wrote:
> On Tuesday, 18 July 2017 at 21:01:24 UTC, Anonymous wrote:
>> On Tuesday, 18 July 2017 at 05:11:30 UTC, Kai Nacke wrote:
>>> In master there is already some OpenBSD support. Some time 
>>> ago I worked on druntime support but I still need to finish 
>>> this. Mostly there is nothing magic here - just translating 
>>> the header files. The only non-obvious work is required for 
>>> the module/shared library stuff (in rt.sections). If there is 
>>> an OpenBSD expert around who can help here it would be nice.
>> Maybe talk to OpenBSD porters on their mailing list. I'll 
>> put my stuff on github as soon as I can.
> Sorry to drag up an old post but I am also interested in 
> getting dmd on openbsd as it is my OS for my main laptop at 
> home.  Has there been any progress with this anywhere?  If not, 
> I would like to give it a try.  My experience with D is 
> currently limited but I have a decent understanding of the 
> OpenBSD build system (I am no expert but I have ported some 
> things to OpenBSD in the past).
> I did look around a bit but I could not find any (official) 
> instructions on how to build the bootstrap version to use to 
> build the latest version of dmd.  Is it pretty much straight 
> forward or are there other considerations that I need to be 
> aware of?

There's the dmd-cxx branch of DMD which was an attempt of 
back-porting Ian's GDC fixes to DMD. So essentially dmd-cxx is 
something like 2.076 (though without static foreach), but it 
doesn't pass the druntime nor Phobos testsuite (it might be 
enough to build DMD master).

The last C++-only version of DMD is 2.068, but in the meantime a 
lot changed.

DragonflyBSD support for DMD and LDC has been added at the end of 
last year (see e.g. [1] or the respective GitHub PRs). I think 
the process should be relatively similar:
- fixing/adding the bindings in druntime in LTS DMD or LDC, s.t. 
it can be compiled for DMD (you don't need Phobos to build DMD, 
though the build scripts might expect it as the testsuite 
partially requires it).
- building the last LTS version
- bootstrap yourself to master (you'll probably need to build 
sth. like 2.079 as an intermediate step)
- build the latest master

However, it might be possible to use LDC to cross-compile 
directly for OpenBSD and self yourself all this bootstrapping 

Good luck and don't hesitate to ask for more help here, on IRC or 


More information about the Digitalmars-d mailing list