Question

I have recently been reading up on the D programming language, and am interested in using it for a small application that would run on OpenBSD.

As far as I can see there is no OpenBSD port for the compiler, but I can see a reference to OpenBSD in the posix.mak file. I don't have an OpenBSD development environment handy at the moment, so before I go and prepare one I was wondering if anyone has tried developing with D on OpenBSD.

How did it go? Was it easy to setup? Are there any 'gotchas' to be aware of? Thanks in advance.

Was it helpful?

Solution

The official druntime (for dmd) does not support OpenBSD. In order for everything to work properly with any OS with D, druntime must support it. It's possible that it would build for OpenBSD and work with some stuff (I don't know), but for it to really work properly, it needs to specifically support OpenBSD. There are a number of version blocks specific to OSes, and unless a version block for OpenBSD (or Posix) exists, then that functionality is missing, and won't work. If enough is missing, then nothing will work.

Now, druntime does vary on some level from compiler to compiler, as that's where the lower level, system-specific stuff goes (e.g. the C bindings to glibc and Win32). So, gdc and ldc have their own versions of druntime and may very well support OpenBSD. However, the official compiler, dmd, does not currently do so.

So, if you want to use OpenBSD with D, you're going to have to look at gdc and ldc. I believe that the gdc developers in particular have done some extra work to add additional OSes and architectures, since it's trying to get into gcc-proper, but I really don't know what exactly it supports at this point, and I have no idea what the current state of ldc is. However, there's a decent chance that they support OpenBSD.

OTHER TIPS

I found only this: https://bitbucket.org/goshawk/gdc/src/b3b60fdac583/d/phobos/std/c/openbsd/openbsd.d
So, at least GDC(GCC frontend for D) have some OpenBSD support. But is it working - i couldn't say.
But you can try :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top