On 27 January 2005 14:49, Wolfgang Thaller wrote:
> On 27.01.2005, at 05:45, Simon Marlow wrote:
>
>> On 26 January 2005 17:35, Wolfgang Thaller wrote:
>>
>>>> Remember that in a GHC build:
>>>>
>>>> - build refers to the platform we're building on
>>>> - host refers to the platform we're going to run GHC on
>>>> - target refers to the platform that this GHC build targets
>>>
>>> Autoconf defines build, host and target as follows:
>>>
>>>> --build=build-type
>>>> the type of system on which the package is being configured and
>>>> compiled (rarely needed); --host=host-type
>>>> the type of system on which the package will run;
>>>> --target=target-type
>>>> the type of system for which any compiler tools in the package will
>>>> produce code.
>>>
>>> I think that means that we should use *_TARGET_* only in the
>>> compiler itself. Everywhere else (libraries, run-time-system) we
>>> should actually be using *_HOST_*, because this is the system that
>>> the package will run on.
>>
>> Not really - the RTS and libraries are actually going to run on the
>> target. Or maybe you mean the HOST from the point of view of the
>> compiler? This is getting too subtle.
>
> The HOST of the RTS and libraries is the TARGET of the compiler. The
> HOST of the stage1 compiler will probably be the BUILD of the RTS and
> libraries. The RTS and libraries have no TARGET because they don't
> generate code.
> My point is, that the platform that *any code* runs on should always
> be referred to as the HOST from within that code. So the HOST of the
> RTS happens to be the TARGET of the compiler itself. This is how GCC
> does it, IIRC.
Ok, I'm thinking in terms of build/host/target being constant across the
whole GHC build tree, rather than their values changing depending on
what code you're compiling. i.e. we're building the RTS to run on the
TARGET of this GHC build.
Yours seems a reasonable interpretation, too...
It also partly solves the problem: the compiler defines
foo_{BUILD,HOST}_{OS,ARCH}, which when compiling the compiler should be
identical to the ones defined by ghcconfig.h, so there won't be any
clash.
We'll have to define foo_TARGET_{OS,ARCH} to be the same as
foo_HOST_{OS,ARCH} in ghcconfig.h for backwards compatibility.
I'm glad I asked the question now, thanks!
Cheers,
Simon
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc