caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Trying out the arm64 compiler
@ 2013-12-23 15:00 Richard W.M. Jones
  2013-12-23 15:07 ` Richard W.M. Jones
  0 siblings, 1 reply; 7+ messages in thread
From: Richard W.M. Jones @ 2013-12-23 15:00 UTC (permalink / raw)
  To: caml-list; +Cc: benedikt.meurer

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-12-23 22:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-23 15:00 [Caml-list] Trying out the arm64 compiler Richard W.M. Jones
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

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