From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 1CDEC7ED1D for ; Wed, 14 Oct 2015 17:59:35 +0200 (CEST) IronPort-PHdr: 9a23:ieoSgB0zKRU/fSpYsmDT+DRfVm0co7zxezQtwd8ZsegeKfad9pjvdHbS+e9qxAeQG96Lt7QU1KGH6OjJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd6OyZTonLHps7ToICx2xxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cYk7sb+sVBSaT3ebgjBfwdVWx+cjN92Mq+jgXOQwKJrlsRVmEbiB9BBQ6NuArmU5n4tAPmtucn3SCBIcDsVvY4VGLxwb1sTUrYgTkGOiRx1GzNjd042JJSvhOsvVpbzpTTcamUMuB/d+XTZ4VJFiJ6Qs9NWnkZUcuHZIwVAr9EZL4Aog== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=xavier.leroy@gmail.com; spf=Pass smtp.mailfrom=xavier.leroy@gmail.com; spf=None smtp.helo=postmaster@mail-wi0-f169.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of xavier.leroy@gmail.com) identity=pra; client-ip=209.85.212.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="xavier.leroy@gmail.com"; x-sender="xavier.leroy@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of xavier.leroy@gmail.com designates 209.85.212.169 as permitted sender) identity=mailfrom; client-ip=209.85.212.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="xavier.leroy@gmail.com"; x-sender="xavier.leroy@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wi0-f169.google.com) identity=helo; client-ip=209.85.212.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="xavier.leroy@gmail.com"; x-sender="postmaster@mail-wi0-f169.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0B+AQCxeh5WlKnUVdFehGi5BIkcggqCRDsRAQEBAQEBAQEQAQEBAQcLCwkfMIIfggcBAQEDARIRHQESJQEBAwELAQUFGAICBRYLAgIJAwIBAgEiAQUBHAYNCAEBHod3AwoIBaIKgTE+MYtJhGWJLScNhHkBAQgcAQUOgRSFVIR+h32BRQEEhzqHBIdXjRuBWIcrEI8IgiM1gRc3ZoNKb4ZvAQEB X-IPAS-Result: A0B+AQCxeh5WlKnUVdFehGi5BIkcggqCRDsRAQEBAQEBAQEQAQEBAQcLCwkfMIIfggcBAQEDARIRHQESJQEBAwELAQUFGAICBRYLAgIJAwIBAgEiAQUBHAYNCAEBHod3AwoIBaIKgTE+MYtJhGWJLScNhHkBAQgcAQUOgRSFVIR+h32BRQEEhzqHBIdXjRuBWIcrEI8IgiM1gRc3ZoNKb4ZvAQEB X-IronPort-AV: E=Sophos;i="5.17,681,1437429600"; d="scan'208";a="182796927" Received: from mail-wi0-f169.google.com ([209.85.212.169]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 14 Oct 2015 17:59:34 +0200 Received: by wieq12 with SMTP id q12so89862656wie.1 for ; Wed, 14 Oct 2015 08:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=P/Q3jreoWAG0O2wxfXLrV8dRAMyCtQCv/jYu8iceQys=; b=RJvNfXxnAWHFBnXwPEA2P5SN02NuiHFRXmhF0HSDjYGnR4CnsaM7UDwppx24Rodjl6 daODnNgcGA30tLjwUnGch9vZblWfB0YRvqM+9IJ0GCBwiOOaaCoLVuyTQiblpScXh/q2 TGkwcCfM2TX9wpVM7nlQyo6Vc4pNdcxEX76a+eQnWcVZEFKx6mrihLzq0z0SwYJGew2X lrb1FSmeZDGMteRlj4ovAlq3CKSvju+5x0JrdQ/DfixnddfeWplhnn9DYEc8Ot2TUR9j W1V1qhg0gHUkoeQADSwnYQKFtteOUk+9vrRYAsVb/rp+ZnFoaQ2OMLIFnt7q3wQGUg4g QwAQ== X-Received: by 10.194.205.229 with SMTP id lj5mr5003943wjc.57.1444838371551; Wed, 14 Oct 2015 08:59:31 -0700 (PDT) Received: from [192.168.1.2] ([108.61.122.216]) by smtp.gmail.com with ESMTPSA id ly4sm10856557wjb.4.2015.10.14.08.59.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2015 08:59:30 -0700 (PDT) Sender: Xavier Leroy To: Stefan Hellermann References: <561CFDBE.5090708@ocamlpro.com> Cc: caml-list@inria.fr From: Xavier Leroy X-Enigmail-Draft-Status: N1110 Message-ID: <561E7BE1.9070402@inria.fr> Date: Wed, 14 Oct 2015 17:59:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Application crashing when build with cross-compiler On 14/10/15 14:29, Stefan Hellermann wrote: > I tried to reproduce this on a x86_32 cross-compiled target, but failed. I > tried to create exactly the same environment for x86_32, same libc, same > compiler, same kernel. Only difference to compiling for my target is > endianess, mips is big endian and x86_32 is little endian. Well, MIPS can also run in little-endian ("mipsel" in Debian speak), but I'm assuming you run a big-endian MIPS kernel. I see Debian has a Unison package for mips and other big-endian platforms, which I presume works, so it's not an endianness dependency in Unison itself nor in the OCaml libraries that Unison depends on. > Is there anything else I can try? You could build the OCaml runtime in debug mode: cd /path/to/ocaml/sources/byterun && make ocamlrund Then use it to run Unison: /path/to/ocaml/sources/byterun/ocamlrund unison file1 file2 ocamlrund is compiled without C optimizations and with a lot of internal checks, so it could help find possible problems with your cross C compiler or target C library. > Can someone point me to a few test scripts > which I could run on the mips target and see if something fails? There's always the testsuite/ part of the OCaml source distribution, which you could run either on the target or on the host through qemu. cd /path/to/ocaml/sources/testsuite && make BYTECODE_ONLY=true all Adrien Nader adds: > Hmmmm, endianess is indeed likely to cause troubles. I'm skeptical. Wrong endianness in config/m.h would cause ocamlrun to crash immediately. > Do the cross-build from x86_64 to ix86 (or the other way round) and > look for warnings from as (need the end of the build iirc). The original poster is using bytecode, as native-code generation is not available for MIPS anyway. - Xavier Leroy