Building DMD on OpenBSD

Joakim via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 17 10:18:23 PDT 2017


On Monday, 17 July 2017 at 16:45:28 UTC, Anonymous wrote:
> On Monday, 17 July 2017 at 09:58:42 UTC, Joakim wrote:
>> The last dmd we released that was written in C++ was 2.067, 
>> for which you can still check out the branch.  You'd have 
>> to build that bootstrap compiler 2.067 first, then worry about 
>> the latest dmd.
>>
>> Since we don't regularly build for OpenBSD, it's 
>> possible that support has slipped behind.  Usually, it's 
>> as easy as adding OpenBSD to a couple more #ifdefs, but 
>> sometimes you need to adapt the dmd source also for a rarely 
>> used platform like OpenBSD.
>
> I managed to build the bootstrap dmd without any trouble. Btw 
> the wiki page doesn't mention that the dependency is *GNU* 
> Make which is typically installed as gmake on BSDs. Then I 
> tried building the new dmd and got (in dmd/src):
>
> CC=c++ dmd -of../generated/openbsd/release/64/idgen ddmd/idgen.d
> Error: cannot find source code for runtime library file 
> 'object.d'
>        dmd might not be correctly installed. Run 'dmd 
> -man' for installation instructions.
>        config file: /etc/dmd.conf
> Specify path to file 'object.d' with -I switch
> gmake[1]: *** [posix.mak:437: 
> ../generated/openbsd/release/64/idgen] Error 1
>
> Now I'm trying to figure out the /etc/dmd.conf business. I 
> found ini/freebsd/bin64/dmd.conf in the 2.067 dmd folder so I 
> guess I'll start from there. Thanks for the help so far.

Unfortunately, dmd has not kept porters in mind and hasn't kept 
the C++ version updated, or kept a workflow that enables easy 
bootstrapping:

http://forum.dlang.org/thread/xgtbpcvbikxlilanrzqa@forum.dlang.org

You will have to build druntime and phobos for 2.067 also and 
collect it all in a different location, which you could invoke to 
bootstrap a new dmd.  You may run into issues related to D/C++ 
integration when building the latest dmd, as that hasn't been 
tested on OpenBSD, only FreeBSD.

Why do you want the latest dmd on OpenBSD?  I ask because it will 
likely require some work, though likely not a lot.


More information about the Digitalmars-d mailing list