From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=NO_REAL_NAME autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 38CF9BBAF for ; Mon, 10 Aug 2009 19:34:23 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmMBAOf2f0rUGyoFkWdsb2JhbACaTgEBAQEJCwoHEwO2BYQYBYFMWw X-IronPort-AV: E=Sophos;i="4.43,354,1246831200"; d="scan'208";a="44532671" Received: from smtp5-g21.free.fr ([212.27.42.5]) by mail4-smtp-sop.national.inria.fr with ESMTP; 10 Aug 2009 19:34:22 +0200 Received: from smtp5-g21.free.fr (localhost [127.0.0.1]) by smtp5-g21.free.fr (Postfix) with ESMTP id 73359D4803C for ; Mon, 10 Aug 2009 19:34:16 +0200 (CEST) Received: from apc.happyleptic.org (happyleptic.org [82.67.194.89]) by smtp5-g21.free.fr (Postfix) with ESMTP id 85925D480A1 for ; Mon, 10 Aug 2009 19:34:14 +0200 (CEST) Received: from fp-desktop.fr.evistel.com (ev [88.169.116.225]) by apc.happyleptic.org (Postfix) with ESMTP id A76F8334EF for ; Mon, 10 Aug 2009 19:34:13 +0200 (CEST) Received: from ccellier by fp-desktop.fr.evistel.com with local (Exim 4.69) (envelope-from ) id 1MaYlB-00021k-7d for caml-list@inria.fr; Mon, 10 Aug 2009 19:34:13 +0200 Date: Mon, 10 Aug 2009 19:34:13 +0200 From: rixed@happyleptic.org To: caml-list@inria.fr Subject: Native compilation for today's MIPS Message-ID: <20090810173413.GA7442@fp-desktop.fr.evistel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam: no; 0.00; compilation:01 mips:01 ocaml:01 compiler:01 mips:01 ocamlopt:01 ocamlopt:01 camlp:01 debugger:01 compilation:01 flags:01 -nostdlib:01 camlp:01 stdlib:01 cmx:01 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 ?