Cross Compilation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Cross Compilation

Trevor Elliott-3
Hi Everyone,

We're starting to update the HaLVM, which produces Xen binaries from
haskell programs, to a more current version of GHC.  Currently, we build
a stage1 compiler manually, with some patches to the RTS, and trick it
into thinking that it's actually stage2 so that we can use template
haskell.  Ideally, we would like to look at Xen as a cross compilation
target, as that provides a bit of a better path for keeping up to date
with changes in GHC.

After reading some of the documentation on the developers wiki about
cross compilation, it wasn't clear if template haskell is usable by a
stage1 compiler built where target is not host, is this still the case?
  If so, what sort of changes would need to be made to enable this, and
is it something that we could contribute to?

Galois has a little time allocated for updating the HaLVM, and would
like to position ourselves so that staying up to date with GHC releases
is easier in the future :)

Thanks!

--trevor

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2311 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130403/649d4cc5/attachment.bin>

Reply | Threaded
Open this post in threaded view
|

Cross Compilation

Gabor Greif-2
Hi Trevor,

I have Cross+TH on my agenda, but not sure I can start that task
before 2013-05-31.

Here is a suggestion how to proceed, Stephen basically agreed that is
it a workable, albeit little elegant, plan:
http://www.haskell.org/pipermail/ghc-devs/2013-March/000660.html

Cheers,

    Gabor

On 4/3/13, Trevor Elliott <trevor at galois.com> wrote:

> Hi Everyone,
>
> We're starting to update the HaLVM, which produces Xen binaries from
> haskell programs, to a more current version of GHC.  Currently, we build
> a stage1 compiler manually, with some patches to the RTS, and trick it
> into thinking that it's actually stage2 so that we can use template
> haskell.  Ideally, we would like to look at Xen as a cross compilation
> target, as that provides a bit of a better path for keeping up to date
> with changes in GHC.
>
> After reading some of the documentation on the developers wiki about
> cross compilation, it wasn't clear if template haskell is usable by a
> stage1 compiler built where target is not host, is this still the case?
>   If so, what sort of changes would need to be made to enable this, and
> is it something that we could contribute to?
>
> Galois has a little time allocated for updating the HaLVM, and would
> like to position ourselves so that staying up to date with GHC releases
> is easier in the future :)
>
> Thanks!
>
> --trevor
>
>


Reply | Threaded
Open this post in threaded view
|

Cross Compilation

Simon Peyton Jones
I'm delighted to see all this activity around porting GHC to other platforms, making the build system work etc.  Thank you all.

I have not been following any of it in detail (it's beyond both my expertise and bandwidth). I am of course willing to help with anything you need my specific input for, but you'll have to ask me specifically.  On this TH question it sounds as if you know what you are doing, which is great.  In general, TH is built only in stage2 because the compiler compiles and runs interpreted code at compile time.  So the representations (layout of objects, say) that are used by the interpreted code had better be identical to those used by the interpreter itself.

Simon

| -----Original Message-----
| From: ghc-devs-bounces at haskell.org [mailto:ghc-devs-bounces at haskell.org]
| On Behalf Of Gabor Greif
| Sent: 03 April 2013 21:43
| To: Trevor Elliott
| Cc: ghc-devs at haskell.org
| Subject: Re: Cross Compilation
|
| Hi Trevor,
|
| I have Cross+TH on my agenda, but not sure I can start that task before
| 2013-05-31.
|
| Here is a suggestion how to proceed, Stephen basically agreed that is it
| a workable, albeit little elegant, plan:
| http://www.haskell.org/pipermail/ghc-devs/2013-March/000660.html
|
| Cheers,
|
|     Gabor
|
| On 4/3/13, Trevor Elliott <trevor at galois.com> wrote:
| > Hi Everyone,
| >
| > We're starting to update the HaLVM, which produces Xen binaries from
| > haskell programs, to a more current version of GHC.  Currently, we
| > build a stage1 compiler manually, with some patches to the RTS, and
| > trick it into thinking that it's actually stage2 so that we can use
| > template haskell.  Ideally, we would like to look at Xen as a cross
| > compilation target, as that provides a bit of a better path for
| > keeping up to date with changes in GHC.
| >
| > After reading some of the documentation on the developers wiki about
| > cross compilation, it wasn't clear if template haskell is usable by a
| > stage1 compiler built where target is not host, is this still the
| case?
| >   If so, what sort of changes would need to be made to enable this,
| > and is it something that we could contribute to?
| >
| > Galois has a little time allocated for updating the HaLVM, and would
| > like to position ourselves so that staying up to date with GHC
| > releases is easier in the future :)
| >
| > Thanks!
| >
| > --trevor
| >
| >
|
| _______________________________________________
| ghc-devs mailing list
| ghc-devs at haskell.org
| http://www.haskell.org/mailman/listinfo/ghc-devs


Reply | Threaded
Open this post in threaded view
|

Cross Compilation

Gabor Greif-2
On 4/5/13, Simon Peyton-Jones <simonpj at microsoft.com> wrote:

> I'm delighted to see all this activity around porting GHC to other
> platforms, making the build system work etc.  Thank you all.
>
> I have not been following any of it in detail (it's beyond both my expertise
> and bandwidth). I am of course willing to help with anything you need my
> specific input for, but you'll have to ask me specifically.  On this TH
> question it sounds as if you know what you are doing, which is great.  In
> general, TH is built only in stage2 because the compiler compiles and runs
> interpreted code at compile time.  So the representations (layout of
> objects, say) that are used by the interpreted code had better be identical
> to those used by the interpreter itself.

Right, so the current train of thought is to be very conservative and
not enable TH for stage 1, unless both conditions are met:
 - the bootstrap compiler has identical version to the to-be-built
stage1 compiler
 - we are building a stage1 cross-compiler.

I have no idea whether this will work out, but shall give it a try. Of
course the possibility exists that the necessary build system changes
are too complex, in which case I'll need some counseling.

Cheers,

    Gabor

>
> Simon
>
> | -----Original Message-----
> | From: ghc-devs-bounces at haskell.org [mailto:ghc-devs-bounces at haskell.org]
> | On Behalf Of Gabor Greif
> | Sent: 03 April 2013 21:43
> | To: Trevor Elliott
> | Cc: ghc-devs at haskell.org
> | Subject: Re: Cross Compilation
> |
> | Hi Trevor,
> |
> | I have Cross+TH on my agenda, but not sure I can start that task before
> | 2013-05-31.
> |
> | Here is a suggestion how to proceed, Stephen basically agreed that is it
> | a workable, albeit little elegant, plan:
> | http://www.haskell.org/pipermail/ghc-devs/2013-March/000660.html
> |
> | Cheers,
> |
> |     Gabor
> |
> | On 4/3/13, Trevor Elliott <trevor at galois.com> wrote:
> | > Hi Everyone,
> | >
> | > We're starting to update the HaLVM, which produces Xen binaries from
> | > haskell programs, to a more current version of GHC.  Currently, we
> | > build a stage1 compiler manually, with some patches to the RTS, and
> | > trick it into thinking that it's actually stage2 so that we can use
> | > template haskell.  Ideally, we would like to look at Xen as a cross
> | > compilation target, as that provides a bit of a better path for
> | > keeping up to date with changes in GHC.
> | >
> | > After reading some of the documentation on the developers wiki about
> | > cross compilation, it wasn't clear if template haskell is usable by a
> | > stage1 compiler built where target is not host, is this still the
> | case?
> | >   If so, what sort of changes would need to be made to enable this,
> | > and is it something that we could contribute to?
> | >
> | > Galois has a little time allocated for updating the HaLVM, and would
> | > like to position ourselves so that staying up to date with GHC
> | > releases is easier in the future :)
> | >
> | > Thanks!
> | >
> | > --trevor
> | >
> | >
> |
> | _______________________________________________
> | ghc-devs mailing list
> | ghc-devs at haskell.org
> | http://www.haskell.org/mailman/listinfo/ghc-devs
>


Reply | Threaded
Open this post in threaded view
|

Cross Compilation

Trevor Elliott-3
In reply to this post by Gabor Greif-2
Hi Gabor,

Thanks for the pointer.  I think that we're going to focus our effort
on getting the HaLVM to work as a cross compilation target for GHC, and
possibly working on getting the threaded runtime working with Xen.  Is
there a wiki page that describes your current path forward on getting
TH working with a cross-compiler?

Thanks!

--trevor

On Wed 03 Apr 2013 01:43:16 PM PDT, Gabor Greif wrote:

> Hi Trevor,
>
> I have Cross+TH on my agenda, but not sure I can start that task
> before 2013-05-31.
>
> Here is a suggestion how to proceed, Stephen basically agreed that is
> it a workable, albeit little elegant, plan:
> http://www.haskell.org/pipermail/ghc-devs/2013-March/000660.html
>
> Cheers,
>
>      Gabor
>
> On 4/3/13, Trevor Elliott <trevor at galois.com> wrote:
>> Hi Everyone,
>>
>> We're starting to update the HaLVM, which produces Xen binaries from
>> haskell programs, to a more current version of GHC.  Currently, we build
>> a stage1 compiler manually, with some patches to the RTS, and trick it
>> into thinking that it's actually stage2 so that we can use template
>> haskell.  Ideally, we would like to look at Xen as a cross compilation
>> target, as that provides a bit of a better path for keeping up to date
>> with changes in GHC.
>>
>> After reading some of the documentation on the developers wiki about
>> cross compilation, it wasn't clear if template haskell is usable by a
>> stage1 compiler built where target is not host, is this still the case?
>>    If so, what sort of changes would need to be made to enable this, and
>> is it something that we could contribute to?
>>
>> Galois has a little time allocated for updating the HaLVM, and would
>> like to position ourselves so that staying up to date with GHC releases
>> is easier in the future :)
>>
>> Thanks!
>>
>> --trevor
>>
>>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2311 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130405/aba637b0/attachment.bin>