* OCaml 3.08.3 fails to compile under Fedora Core 4 (GCC 4). @ 2005-06-19 3:30 Aleksey Nogin 2005-06-19 7:45 ` [Caml-list] " Xavier Leroy 0 siblings, 1 reply; 5+ messages in thread From: Aleksey Nogin @ 2005-06-19 3:30 UTC (permalink / raw) To: Caml List As was already mentioned on this list about a month ago, OCaml 3.08.3 fails to compile with GCC4. Specifically, when I try to compile 3.08.3 under the recently released Fedora Core 4, I get: In file included from bng.c:21: bng_ia32.c: In function ‘bng_ia32_mult_add_digit’: bng_ia32.c:111: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm' 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. -- 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] OCaml 3.08.3 fails to compile under Fedora Core 4 (GCC 4). 2005-06-19 3:30 OCaml 3.08.3 fails to compile under Fedora Core 4 (GCC 4) Aleksey Nogin @ 2005-06-19 7:45 ` Xavier Leroy 2005-06-19 8:16 ` Aleksey Nogin 0 siblings, 1 reply; 5+ messages in thread From: Xavier Leroy @ 2005-06-19 7:45 UTC (permalink / raw) To: Aleksey Nogin; +Cc: Caml List > 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. - Xavier Leroy ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] OCaml 3.08.3 fails to compile under Fedora Core 4 (GCC 4). 2005-06-19 7:45 ` [Caml-list] " Xavier Leroy @ 2005-06-19 8:16 ` Aleksey Nogin 2005-06-19 10:00 ` Xavier Leroy 0 siblings, 1 reply; 5+ messages in thread From: Aleksey Nogin @ 2005-06-19 8:16 UTC (permalink / raw) To: Xavier Leroy; +Cc: Caml List 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] OCaml 3.08.3 fails to compile under Fedora Core 4 (GCC 4). 2005-06-19 8:16 ` Aleksey Nogin @ 2005-06-19 10:00 ` Xavier Leroy 2005-06-19 22:27 ` John Skaller 0 siblings, 1 reply; 5+ messages in thread From: Xavier Leroy @ 2005-06-19 10:00 UTC (permalink / raw) To: Aleksey Nogin; +Cc: Caml List > I've realized that in Fedora Extras 4 the ocaml package contains the > following patch: > - : "+&r" (a), "+&r" (b), "+&rm" (blen), "+&r" (out) > + : "+&r" (a), "+&r" (b), "+m" (blen), "+&r" (out) > Is this reasonable? Yes, very much so. You'll get better performance than with the workaround I suggested (disabling inline asm). I need to run a few tests with gcc 4, but eventually will fix the problem along these lines. > Also, > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21291 suggests using -O0 > (which seems to work as well). That wil be costly in performance, especially if -O0 is applied to the whole OCaml runtime system (not just otherlibs/num). - Xavier Leroy ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] OCaml 3.08.3 fails to compile under Fedora Core 4 (GCC 4). 2005-06-19 10:00 ` Xavier Leroy @ 2005-06-19 22:27 ` John Skaller 0 siblings, 0 replies; 5+ messages in thread From: John Skaller @ 2005-06-19 22:27 UTC (permalink / raw) To: Xavier Leroy; +Cc: Caml List On Sun, 2005-06-19 at 12:00 +0200, Xavier Leroy wrote: > > I've realized that in Fedora Extras 4 the ocaml package contains the > > following patch: > > - : "+&r" (a), "+&r" (b), "+&rm" (blen), "+&r" (out) > > + : "+&r" (a), "+&r" (b), "+m" (blen), "+&r" (out) > > Is this reasonable? > > Yes, very much so. You'll get better performance than with the > workaround I suggested (disabling inline asm). I need to run a few > tests with gcc 4, but eventually will fix the problem along these lines. Hmm .. I just build CVS Ocaml branch release308 on x86-64/amd64 platform with gcc 4.0 .. seems to work: skaller@rosella:/work/ocaml$ ./ocamlc.opt -version 3.08.3+3 (2005-05-18) However I get another problem: ../../boot/ocamlrun ../boot/camlp4r -nolib -I ../boot q_MLast.cmo pa_extend.cmo -o pa_o_fast.ppo -verbose pa_o_fast.ml ---------------------------------- Parse error in entry [expr], rule: [ "("; ")" | "("; SELF; ":>"; type; ")" | "("; SELF; ":"; type; ":>"; type; ")" | "("; SELF; ":"; type; ")" | "("; SELF; ","; LIST1 expr SEP ","; ")" | "("; SELF; ")" ] ---------------------------------- File "pa_o_fast.ml", line 759, characters 7-9: Parse error: ')' or [expr] expected after '(' (in [expr]) Uncaught exception: Stream.Error("')' or [expr] expected after '(' (in [expr])") make[2]: *** [pa_o_fast.cmx] Error 2 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-06-19 22:27 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-06-19 3:30 OCaml 3.08.3 fails to compile under Fedora Core 4 (GCC 4) Aleksey Nogin 2005-06-19 7:45 ` [Caml-list] " Xavier Leroy 2005-06-19 8:16 ` Aleksey Nogin 2005-06-19 10:00 ` Xavier Leroy 2005-06-19 22:27 ` John Skaller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox