Building DMD on SmartOS

Jason King via Digitalmars-d digitalmars-d at
Sun May 3 09:13:08 PDT 2015

As I recall, the problem is the size of the segment (as created by DMD) is
smaller sum of the sizes of the objects in it (which is by ld complains).
You could try binutils, though usually the use of GNU ld on Illumos
platforms is discouraged (as it tends to get lots of things wrong).  You
can use elfedit, or I think I have a patch that makes things happy around
here somewhere I can try to dig up.

GDC should also probably work, though you'll need to apply the patches that
everyone else does on any Solaris derived platforms (which for unknown
reasons, the gcc folks have refused to accept for the past 10+ years).

On Sun, May 3, 2015 at 5:49 AM, Kai Nacke via Digitalmars-d <
digitalmars-d at> wrote:

> On Sunday, 3 May 2015 at 07:04:17 UTC, Joakim wrote:
>> On Thursday, 30 April 2015 at 17:39:02 UTC, flamencofantasy wrote:
>>> Hello,
>>> I would like to use D on SmartOS.
>>> Since there is no binary installer I tried to build DMD from source by
>>> following the instructions on this page;
>>> Unfortunately I get this error;
>>> [~/d/dmd/src]# make -f posix.mak MODEL=64
>>> no cpu specified, assuming X86
>>> dmd idgen.d
>>> make: dmd: Command not found
>>> posix.mak:320: recipe for target 'idgen' failed
>>> make: *** [idgen] Error 127
>> I spent a couple hours and installed SmartOS in a VM, my first time ever
>> messing with SmartOS though I've run and developed for Solaris before, to
>> see what the status of building dmd is.  While it was a pain getting
>> SmartOS configured, I was finally able to build dmd 2.067 and druntime
>> without a problem, using gcc 4.7 (the clang from pkgin tried to use some
>> linker config that wouldn't work to link even basic test C++ files).
>> Phobos now keeps failing to build on me, but only because I'm low on disk
>> space and it keeps running out of swap.
>> However, linking a small sample file against druntime alone fails, some
>> issue with the deh_beg/deh_end sections:
>> gcc sieve.o ./lib/libdruntime-solaris64.a -o sieve -m64 -lpthread -lm
>> ld: fatal: symbol '_deh_beg' in file sieve.o: section [15].deh_beg: size
>> 0: symbol (address 0, size 0x4) lies outside of containing section
>> ld: fatal: symbol '_deh_end' in file sieve.o: section [17].deh_end: size
>> 0: symbol (address 0, size 0x4) lies outside of containing section
>> ld: fatal: file processing errors. No output written to sieve
>> collect2: error: ld returned 1 exit status
>> I'll finish building phobos and mess around a bit with fixing those
>> sections.  I'll let you know if I get it to work.
> I got the some error. You need a more recent binutils version.
> Regards,
> Kai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Digitalmars-d mailing list