Re: assembly

From: Xavier Leroy (
Date: Tue Oct 26 1999 - 19:31:36 MET DST

Date: Tue, 26 Oct 1999 19:31:36 +0200
From: Xavier Leroy <>
To: Hongwei Xi <>,
Subject: Re: assembly
In-Reply-To: <>; from Hongwei Xi on Sun, Oct 24, 1999 at 03:45:59PM -0400

> Could someone tell me how to compile assembly code
> generated by ocamlopt?
> I am doing some experiment. I have generated some
> assembly code using ocamlopt and modified it. Now
> I'd like to compile the modified code. What object
> files are needed for doing this?

If you run ocamlopt with the -verbose option, it will display all the
calls to the assembler and the linker that it performs. In
particular, you'll see what assembler flags are used on your platform.

I'd guess that something like the below should work:

        ocamlopt -S -c
        <transform foo.s>
        as <machine-dependent options> -o foo.o foo.s
        ocamlopt -o myprog foo.cmx

Hope this helps,

- Xavier Leroy

This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:27 MET