Version française
Home     About     Download     Resources     Contact us    
Browse thread
Building a cross-compiling ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: mharris@c...
Subject: Building a cross-compiling ocaml
I am trying to get ocaml to produce code that can be linked against
the libc of a different operating system (the University of Utah's
OSKit project, for those who may know it).  The key facts are:

  - The target architecture is the same, so all the normal build tools
    and commands work; I just need to add some compile-time and
    link-time options so gcc will use the proper header files and
    libraries.

  - I'm using a different libc than the native (Linux) one, so the
    ocamlrun produced in this manner cannot be run locally.  In other
    words, the normal build process gives me a broken ocamlc.

I am not very familiar with the OCaml architecture because I am only
trying to link with some functions written in OCaml.  I tried
following the directions given by Xavier a year ago
<http://pauillac.inria.fr/caml/caml-list/1160.html>, which involved
changing NATIVECCCOMPOPTS and NATIVECCLINKOPTS in config/Makefile, but
the make procedure for stdlib/ involves running ocamlrun, which was
linked with the byterun/* files produced with these options.

My understanding is that bytecode files are entirely
system-independent, so I should just need to get the byterun/* files
built with the alternate library.  But since ocamlrun, which is used
by ocamlc, is built from these files, I have a circular dependency: I
need to run an ocamlc under Linux to produce the files that I will
link with the alternate libc.  What is the best way to resolve this?


Matthew