Version française
Home     About     Download     Resources     Contact us    
Browse thread
PowerPC 405
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: xclerc <xavier.clerc@i...>
Subject: Re: [Caml-list] PowerPC 405

Le 27 mars 09 à 18:19, Xavier Leroy a écrit :

> Just to complement Basile's excellent answers:
>
>> Do you know if it is possible to compile caml code on a PowerPC 405
>> from the Vertex 4 family ?
>> We'd like to put this processor in a FPGA.  On the Caml's website,
>> it is written "PowerPC" but is it only for Macintosch ?
>
> Not just Macintosh: PowerPC/Linux is also supported and works very
> well.
>
>> Yes, it will run Linux. It will have the uclibC or even the lib C.
>
> Then you're in good shape.  I would expect a basic OCaml system to
> work with uclibC, although a number of external libraries might not.
> With GNU libC, everything will work but watch out for code size:
> glibc is big!
>
>> The best case is to run native code for better performance. We'd
>> like to cross-compile for the PowerPC.
>
> Setting up OCaml as a cross-compiler is a bit of a challenge at the
> moment.  As a prerequisite, you'll need a complete cross-compilation
> environment for C: cross-compiler, cross-binutils, libraries and
> header files for your target.  It sounds obvious but in my experience
> that's quite hard to get right.  Then, there is a bit of configuration
> magic to be done on the OCaml side.  Write back for help if you're
> going to follow this way.

I have built a MacOS-to-Linux cross-compiler last week.
I do confirm that the hard part is getting a cross-[g]cc up and running.
In fact, this is so tedious that I strongly encourage to resort to  
either
a prepackaged cross-[g]cc (from binaries, from a Linux packaging
system, whatever), or to the excellent "crosstool" available at :
	http://www.kegel.com/crosstool/

On the OCaml side, there are very few things to do and they are
quite straightforward. First, you have to emulate the behaviour of
"./configure" by producing "config/m.h", "config/s.h", and "config/ 
Makefile"
by hand. This is easier than it may sound, just start from "config/m- 
templ.h",
"config/s-temp.h", and "config/Makefile-templ" (these are  
comprehensively
commented).
Then, you will have to slightly patch some Makefiles, and you are done.

I will setup a webpage with all the necessary steps and patches as soon
as I get my notes organized. This will allow us to share knowledge on  
the subject.

Xavier Clerc