[dmd-internals] DMD now requires a working D compiler to be build

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Mon Mar 9 00:12:47 PDT 2015


On 3/8/2015 8:43 PM, Daniel Murphy wrote:
> "Walter Bright"  wrote in message news:mdj3l3$1hup$1 at digitalmars.com...
>
>> Never needed to build a cross compiler.
>
> You did when adding 64-bit targets.  ie dmd is a 32->64 and 64->32 cross compiler.

Not really. I never had to compile one one machine and copy the result onto another.


> Anyway, in this situation:
>
> We want to target new platform X.
> Platform X has a c++ compiler but no D compiler available.
> 2.067 is the last version that can be built without a D compiler.
> DMD master can be built with 2.067 or later.
>
> The obvious (to me) way to get a working compiler on the platform is:
> 1. Add cross-compiling support targeting X to DMD master
> 2. Cross-compile DMD for X
>
> Or alternatively:
> 1. Add ability to target X to 2.067 C++ source
> 2. Compile 2.067 on X with C++ compiler
> 3. Add ability to target X to DMD master
> 4. Compile DMD master with native 2.067 dmd binary
>
> The second method is the only one I can think of that requires 2.067 can be
> compiled C++-only, and it also seems to require a lot more effort than the
> cross-compiling method.
>
> Which would you expect to use if adding support to dmd for eg arm/linux?
> Is there another method I'm missing?
>
> I think the only hard requirement is that there is a binary package available
> capable of targeting the platform, or the last C++ version can target it.
> For platforms that the C++ version has never supported, cross-compiling is the
> best option to produce the first set of native binaries.

How easy it is to copy the files over would decide which method is more 
convenient. Besides, it is likely the vast majority of the work would be in the 
back end, which remains in C++.


More information about the Digitalmars-d mailing list