Proposal: configuration for cross compilation

Kai Nacke via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Tue May 6 09:36:58 PDT 2014


Hi David!

On Tuesday, 6 May 2014 at 12:01:32 UTC, David Nadlinger via
digitalmars-d-ldc wrote:
> This looks like a good start. Two ideas:
>  - What format do you want to use for the config file? 
> libconfig, like we are doing right now? (I didn't know what to 
> make of the missing quotes in your example.)

I want to use libconfig as it provides the base features. However
I did not validate the syntax of my example file.

>  - Do more specific keys always completely override what a more 
> general configuration group might contain? If yes, might there 
> be situations where this gets cumbersome? The example I'm 
> thinking about here is a possible future druntime version with 
> different "ports" directories for the platform specific files, 
> as has been discussed in the past. In this case, there might be 
> an additional import path per platform, which should just be 
> added to the other list of locations. (The question would be 
> whether a facility to address this would be worth the added 
> complexity, though…)

I thought about this, too. Some keys tend to be additive. The
switches key is a good example: if I want to add a switch to the
mips64 section (e.g. -mcpu=octeon) then it would be boring to
specify the path to the import modules again. But I dislike the
idea that not all keys work in the same way.

I solution would be specify to the behaviour in the config file
with = (final assigment) and += (add to less specific definition):

default:
{
      switches = [ "...", "..."]
}

mips64-*-linux:
{
      switches += [ "-mcpu=octeon" ]
}

As I don't know if this is possible with libconfig I would
postpone this to the D version of ldc.

> Another topic we need to address after this has been finalized 
> is how to best integrate cross-compilation into the build 
> process (this mainly concerns building druntime/Phobos).

Yes, that is a different topic which needs a solution....

> Glad to see progress on this front!

:-) I currently have too much targets to always fiddle around
with the config file.

Regards,
Kai


More information about the digitalmars-d-ldc mailing list