caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Native compilation for today's MIPS
@ 2009-08-10 17:34 rixed
  2009-08-10 23:08 ` [Caml-list] " rixed
  2009-08-21 20:20 ` rixed
  0 siblings, 2 replies; 8+ messages in thread
From: rixed @ 2009-08-10 17:34 UTC (permalink / raw)
  To: caml-list

Hello.

I'm trying to make ocaml native compiler works on a Loongson2F processor
with a GNU/Linux system.

So far, I managed to work around many ABI related issues (I want n32 ABI,
because from the configure script it seams closest from the old MIPS
assembly emmiter and because "the Internet" thinks it's faster than o32).

So, after some minor changes I got ocamlopt and ocamlopt.opt, but the
make opt.opt command fails while compiling camlp4 (or sometime the debugger,
depending on compilation flags) :

../ocamlopt.opt -nostdlib  -c -g -I camlp4 -I stdlib -o camlp4/Camlp4_import.cmx camlp4/Camlp4_import.ml
Fatal error: exception Invalid_argument("index out of bounds")

whatever OCAMLRUNPARAM settings I try, I have no backtrace. So to
figure out where this is comming from I tried gdb but with not much luck :

This GDB was configured as "mips64el-unknown-linux-gnu"...
(gdb) b caml_array_bound_error
Breakpoint 1 at 0x1016d708: file fail.c, line 192.
(gdb) r
Starting program: ocamlopt.opt -nostdlib -I ../stdlib -c -g -I camlp4 -I stdlib -o camlp4/Camlp4_import.cmx camlp4/Camlp4_import.ml

Breakpoint 1, caml_array_bound_error () at fail.c:192
192       if (! array_bound_error_bucket_inited) {
(gdb) bt
#0  caml_array_bound_error () at fail.c:192
#1  0x1016cff8 in caml_c_call () at mips.s:192
Backtrace stopped: frame did not save the PC

Now I'm running out of ideas.
I have cleared all gcc warnings about ABI mismatch but I suspect something
is still wrong in this area. Being new both to Mips and to OCaml does not help,
neither.

So I humbly request for any pointers or ideas about what to look for.

Also, I have to say these flawed ocamlopt and ocamlopt.opt compilers can
actually compile my own poor production of ML programs, which then appear
to run normaly, so Im lacking ML programs of intermediate "difficulty"
to experiment. Is there a test suite somewhere I could use to test the
compiler ? Should I test some particular language construct in particular ?
What's your opinion ?



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

end of thread, other threads:[~2009-08-21 20:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-10 17:34 Native compilation for today's MIPS rixed
2009-08-10 23:08 ` [Caml-list] " rixed
2009-08-11 10:11   ` rixed
2009-08-11 16:38     ` rixed
2009-08-11 18:06     ` rixed
2009-08-12 12:12       ` David MENTRE
2009-08-12 13:46         ` rixed
2009-08-21 20:20 ` rixed

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