From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA28674 for caml-redistribution@pauillac.inria.fr; Wed, 8 Mar 2000 18:19:40 +0100 (MET) Resent-Message-Id: <200003081719.SAA28674@pauillac.inria.fr> Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA20175 for ; Tue, 7 Mar 2000 11:55:05 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id LAA21102; Tue, 7 Mar 2000 11:54:59 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA08996; Tue, 7 Mar 2000 11:54:57 +0100 (MET) Message-ID: <20000307115457.47501@pauillac.inria.fr> Date: Tue, 7 Mar 2000 11:54:57 +0100 From: Xavier Leroy To: "Matthew S. Harris" , caml-list@inria.fr Subject: Re: Building a cross-compiling ocaml References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1 In-Reply-To: ; from Matthew S. Harris on Mon, Mar 06, 2000 at 04:30:35PM -0500 Resent-From: weis@pauillac.inria.fr Resent-Date: Wed, 8 Mar 2000 18:19:40 +0100 Resent-To: caml-redistribution@pauillac.inria.fr > 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