Version française
Home     About     Download     Resources     Contact us    
Browse thread
OCaml 3.08.3 fails to compile under Fedora Core 4 (GCC 4).
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Aleksey Nogin <nogin@c...>
Subject: Re: [Caml-list] OCaml 3.08.3 fails to compile under Fedora Core 4 (GCC 4).
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