caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rich@annexia.org>
To: caml-list@inria.fr
Cc: benedikt.meurer@googlemail.com
Subject: [Caml-list] Trying out the arm64 compiler
Date: Mon, 23 Dec 2013 15:00:27 +0000	[thread overview]
Message-ID: <20131223150027.GA15442@annexia.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1307 bytes --]

I'm trying to compile OCaml for arm64/aarch64.  I'm currently
trying the trunk branch from:

https://github.com/ocaml/ocaml

which should be identical to SVN.  It requires a trivial patch which
is attached.

I'm using qemu as an arm64 userspace emulator, with Fedora Rawhide:

http://rwmj.wordpress.com/2013/12/22/how-to-run-aarch64-binaries-on-an-x86-64-host-using-qemu-userspace-emulation/#content

Anyway, it hangs, consistently as soon as it tries to run any
ocamlopt-compiled program.  During the compile, the first hang is
here:

../../ocamlcomp.sh -c -w +33..39 -warn-error A -g -nolabels unix.mli

[which runs the just-compiled ocamlc.opt], but even a trivial test
program hangs:

$ echo 'print_endline "hello, world"' > test.ml
$ ./boot/ocamlrun ./ocamlopt -I stdlib stdlib.cmxa test.ml -o test
$ ./test
[hangs here]

Disassembly shows this really is an aarch64 native binary.

Unfortunately because of the technique I'm using (qemu-arm64) I cannot
use gdb or strace to look at where it is hanging, although I am
reasonably sure that it's not hanging *because* of qemu -- at least,
I've been able to compile and run masses of software using gcc under
the same conditions.

Has anyone seen this or have any other ideas?

Am I using the right branch for arm64 work?

Rich.

-- 
Richard Jones
Red Hat

[-- Attachment #2: 0001-Minor-compile-fix-for-arm64.patch --]
[-- Type: text/x-diff, Size: 819 bytes --]

From de5c2f3809771981976d4afd50b701b3f005eedc Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 23 Dec 2013 09:51:55 -0500
Subject: [PATCH] Minor compile fix for arm64.

---
 asmcomp/arm64/emit.mlp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/asmcomp/arm64/emit.mlp b/asmcomp/arm64/emit.mlp
index bc03c5d..1b298da 100644
--- a/asmcomp/arm64/emit.mlp
+++ b/asmcomp/arm64/emit.mlp
@@ -604,7 +604,7 @@ let emit_instr i =
         `	ldr	{emit_reg reg_trap_ptr}, [sp], 16\n`;
         cfi_adjust_cfa_offset (-16);
         stack_offset := !stack_offset - 16
-    | Lraise ->
+    | Lraise k ->
         begin match !Clflags.debug, k with
         | true, (Lambda.Raise_regular | Lambda.Raise_reraise) ->
           `	bl	{emit_symbol "caml_raise_exn"}\n`;
-- 
1.8.3.1


             reply	other threads:[~2013-12-23 15:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-23 15:00 Richard W.M. Jones [this message]
2013-12-23 15:07 ` Richard W.M. Jones
2013-12-23 15:32   ` Richard W.M. Jones
2013-12-23 17:16     ` Richard W.M. Jones
2013-12-23 18:32       ` Richard W.M. Jones
2013-12-23 19:00         ` Anil Madhavapeddy
2013-12-23 22:03         ` Richard W.M. Jones

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=20131223150027.GA15442@annexia.org \
    --to=rich@annexia.org \
    --cc=benedikt.meurer@googlemail.com \
    --cc=caml-list@inria.fr \
    /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).