caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Kip Macy" <kip.macy@gmail.com>
To: "John Carr" <jfc@mit.edu>
Cc: "caml users" <caml-list@inria.fr>
Subject: Re: [Caml-list] Release 3.09.1
Date: Sat, 7 Oct 2006 18:44:00 -0700	[thread overview]
Message-ID: <b1fa29170610071844o302b0a8cuce96d6fa08b71ea4@mail.gmail.com> (raw)
In-Reply-To: <200601071929.k07JTF64008575@w20-575-49.mit.edu>

This has been an immense help in getting ocaml-3.09.3 working on
FreeBSD sparc64 - but I'm still finding that incorrect code is getting
generated for camlPervasives__entry in ocamlc.opt:

0x00000000002379a4 <camlPervasives__entry+0>:   sub  %sp, 0x10, %sp
0x00000000002379a8 <camlPervasives__entry+4>:   stx  %o7, [ %sp + 0x8b7 ]
0x00000000002379ac <camlPervasives__entry+8>:   sethi  %hi(0x405400), %o3
0x00000000002379b0 <camlPervasives__entry+12>:  sethi  %hi(0x405c00), %o2
0x00000000002379b4 <camlPervasives__entry+16>:  add  %o2, 0x30c, %o2
 ! 0x405f0c <camlPervasives__84>
0x00000000002379b8 <camlPervasives__entry+20>:  stx  %o2, [ %o3 + 0x32c ]

The store is not 8-byte aligned so it causes a bus error. In
ocamlopt.opt the generated code does not cause a bus error:

0x0000000000221ca4 <camlPervasives__entry+0>:   sub  %sp, 0x10, %sp
0x0000000000221ca8 <camlPervasives__entry+4>:   stx  %o7, [ %sp + 0x8b7 ]
0x0000000000221cac <camlPervasives__entry+8>:   sethi  %hi(0x40e400), %o3
0x0000000000221cb0 <camlPervasives__entry+12>:  sethi  %hi(0x40ec00), %o2
0x0000000000221cb4 <camlPervasives__entry+16>:  add  %o2, 0x198, %o2
 ! 0x40ed98 <camlPervasives__84>
 0x0000000000221cb8 <camlPervasives__entry+20>:  stx  %o2, [ %o3 + 0x1b8 ]

I'm happy to fix it myself, however, not being familiar with ocaml
internals I'm not sure where to look. Any suggestions? Thanks.


P.S. I added the following diff to get it to work:
kmacy@storage [/shared|18:32|203] diff -u
ocaml-3.09-sparc64/sparc-sparc64.S ocaml-3.09.3/asmrun/sparc-sparc64.S
--- ocaml-3.09-sparc64/sparc-sparc64.S  Sat Dec  3 18:34:25 2005
+++ ocaml-3.09.3/asmrun/sparc-sparc64.S Sat Oct  7 17:20:32 2006
@@ -18,6 +18,9 @@
    using the SPARC 64 bit ABI.  The ABI uses ELF and does not
    prefix symbols with underscore. */

+#define Caml_ml_array_bound_error caml_ml_array_bound_error
+#define Caml_c_call caml_c_call
+#define Caml_array_bound_error caml_array_bound_error
 /* Must be preprocessed by cpp */

 ! Tell the assembler not to complain about use of %g2 and %g3, which
kmacy@storage [/shared|18:32|204] diff -u
ocaml-3.09-sparc64/emit64.mlp ocaml-3.09.3/asmcomp/sparc/emit.mlp
--- ocaml-3.09-sparc64/emit64.mlp       Sat Dec  3 11:10:50 2005
+++ ocaml-3.09.3/asmcomp/sparc/emit.mlp Sat Oct  7 17:46:33 2006
@@ -31,6 +31,7 @@
   begin match Config.system with
     "solaris" -> Solaris
   | "linux" -> Linux
+  | "bsd" -> Solaris
   | "sunos" -> SunOS
   | os -> failwith ("Unknown operating system " ^ os)
   end




On 1/7/06, John Carr <jfc@mit.edu> wrote:
>
> I updated my SPARC 64 bit native code changes to work with version 3.09.1.
>
> http://www.mit.edu/~jfc/ocaml-3.09.1-sparc64.tar.gz
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


      reply	other threads:[~2006-10-08  1:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-04 16:06 Damien Doligez
2006-01-07 19:29 ` [Caml-list] " John Carr
2006-10-08  1:44   ` Kip Macy [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=b1fa29170610071844o302b0a8cuce96d6fa08b71ea4@mail.gmail.com \
    --to=kip.macy@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=jfc@mit.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).