caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: "Matthew S. Harris" <mharris@cs.cornell.edu>, caml-list@inria.fr
Subject: Re: Building a cross-compiling ocaml
Date: Tue, 7 Mar 2000 11:54:57 +0100	[thread overview]
Message-ID: <20000307115457.47501@pauillac.inria.fr> (raw)
In-Reply-To: <b366uzhjlw.fsf@tatooine.cs.cornell.edu>; from Matthew S. Harris on Mon, Mar 06, 2000 at 04:30:35PM -0500

> 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.

Right.  You need a native ocamlrun to run ocamlc, not the
cross-compiled ocamlrun.

The easiest solution is as follows:
- leave the sources in byterun/ unchanged, so that the normal build
  procedure of ocaml will work;
- make a copy of byterun/ in, say, byterun.cross;
- modify the sources and Makefile in byterun.cross so that they can be
  cross-compiled and produce an ocamlrun for your target OS;
- use byterun.cross/ocamlrun to run OCaml bytecode executables
  on the target OS.

> My understanding is that bytecode files are entirely
> system-independent

They are almost entirely system-independent.  For instance, if the
target system has different ASCII codes for '\n' and '\r' than the
native system, text I/O will look funny.  (This is the case if you
cross-compile between MacOS on the one side, and Unix or Windows on
the other side.)  This is the only system dependence that I can
remember right now.

- Xavier Leroy



      parent reply	other threads:[~2000-03-08 17:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-06 21:30 Matthew S. Harris
2000-03-07  8:24 ` Sven LUTHER
2000-03-08 17:46   ` Benjamin C. Pierce
2000-03-08 17:55   ` Olivier Bouyssou
2000-03-08 18:20   ` Francois Rouaix
2000-03-09  7:02     ` Sven LUTHER
2000-03-07 10:54 ` Xavier Leroy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20000307115457.47501@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=mharris@cs.cornell.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).