From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 52FDEBBFB for ; Sun, 19 Jun 2005 10:16:19 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5J8GItK031659 for ; Sun, 19 Jun 2005 10:16:19 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA26484 for ; Sun, 19 Jun 2005 10:16:18 +0200 (MET DST) Received: from swordfish.cs.caltech.edu (swordfish.cs.caltech.edu [131.215.44.124]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5J8GHdM031656; Sun, 19 Jun 2005 10:16:18 +0200 Received: from [192.168.1.100] (charter-242-004.caltech.edu [131.215.242.4]) by swordfish.cs.caltech.edu (Postfix) with ESMTP id 0FAEFDF2AB; Sun, 19 Jun 2005 01:16:15 -0700 (PDT) Message-ID: <42B529CD.6070106@cs.caltech.edu> Date: Sun, 19 Jun 2005 01:16:13 -0700 From: Aleksey Nogin Organization: California Institute of Technology, Computer Science Department User-Agent: Mozilla Thunderbird 1.0.2-1.3.3 (X11/20050513) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Xavier Leroy Cc: Caml List Subject: Re: [Caml-list] OCaml 3.08.3 fails to compile under Fedora Core 4 (GCC 4). References: <42B4E6C5.2010405@cs.caltech.edu> <20050619074551.GA623@yquem.inria.fr> In-Reply-To: <20050619074551.GA623@yquem.inria.fr> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 42B529D2.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42B529D1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 gcc:01 ocaml:01 gcc:01 config:01 makefile:01 bignum:01 otherlibs:01 otherlibs:01 decl:01 decl:01 bug:01 ...:98 wrote:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On 19.06.2005 00:45, Xavier Leroy wrote: >>As was already mentioned on this list about a month ago, OCaml 3.08.3 >>fails to compile with GCC4. [...] >>As far as I can tell, last time this came up on this list nobody have >>offered any solutions short of downgrading GCC. Is there any other way >>to get it to work? TIA for any suggestions. > > > A simple workaround: after running configure, change config/Makefile > to set BNG_ASM_LEVEL=0 (instead of 1 or 2). This will turn off all > inline asm stuff, at significant cost in speed of bignum operations. > I've realized that in Fedora Extras 4 the ocaml package contains the following patch: --- ocaml-3.08.3/otherlibs/num/bng_ia32.c.x86 2005-05-09 15:24:29.000000000 -0400 +++ ocaml-3.08.3/otherlibs/num/bng_ia32.c 2005-05-09 22:02:50.000000000 -0400 @@ -121,7 +121,7 @@ "leal 4(%1), %1 \n\t" "decl %2 \n\t" "jnz 1b" - : "+&r" (a), "+&r" (b), "+&rm" (blen), "+&r" (out) + : "+&r" (a), "+&r" (b), "+m" (blen), "+&r" (out) : "rm" (d) : "eax", "edx"); } @@ -164,7 +164,7 @@ "leal 4(%1), %1 \n\t" "decl %2 \n\t" "jnz 1b" - : "+&r" (a), "+&r" (b), "+&rm" (blen), "+&rm" (out), "=&r" (tmp) + : "+&r" (a), "+&r" (b), "+m" (blen), "+m" (out), "=&r" (tmp) : "rm" (d) : "eax", "edx"); } Is this reasonable? Also, http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21291 suggests using -O0 (which seems to work as well). -- Aleksey Nogin Home Page: http://nogin.org/ E-Mail: nogin@cs.caltech.edu (office), aleksey@nogin.org (personal) Office: Moore 04, tel: (626) 395-2200