caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Warning: gcc -O2 bad for compiling Ocaml
@ 2000-04-26  8:48 Basile STARYNKEVITCH
  0 siblings, 0 replies; only message in thread
From: Basile STARYNKEVITCH @ 2000-04-26  8:48 UTC (permalink / raw)
  To: Fabrice Le Fessant, Xavier Leroy; +Cc: caml-list

Hello All,

I compiled ocaml-2.99+18 (2000-04-14, from CVS). But I wanted to get a
little faster runtime (compiled with gcc-2.95.2 on a Linux Suse6.2
-glibc2- AMDK6 PC, my home machine). So I edited manually
config/Makefile to add -O2 at end of BYTECCCOMPOPTS and
NATIVECCCOMPOPTS.

This seems to work ok for Ocaml proper (make bootstrap runs ok, as
do make opt, make ocamlopt.opt etc...). 

But I tried to compile Fabrice Le Fessant latest patched efun editor 
"http://pauillac.inria.fr/efuns/ftp/efuns-017+1.src.tar.gz"

This does not work (in efuns/efuns, make opt fails), ending with:

ocamlopt.opt  -I ../ocamlsrc -I ../dynlink -I ../toolkit -I ../concur -I /h1/basile/ltmp/efuns/xlib -I /h1/basile/ltmp/efuns/common -c ebuffer.ml
The compiled interfaces keymap.cmi and ebuffer.cmi
make inconsistent assumptions over interface Efuns
make[1]: *** [ebuffer.cmx] Erreur 2

This is repeatable on other systems.

I thought there was a bug in Ocaml or Efuns. The bug was mine:

   DO NOT COMPILE OCAML WITH gcc -O2

(the same bug appears with other optimizations such as -Os or
-fomit-frame-ponter)


My public apologies to Fabrice (Le Fessant) and Xavier (Leroy) for
having lost their time.

I suggest adding in Ocaml INSTALL file the following line of advice:

  Warning: do not compile the Ocaml system with any other optimisation
  that gcc -O. On somes occasions, compiling Ocaml with gcc -O2 produces
  a buggy compiler or runtime.

################ résumé francais:

Il faut éviter de compiler l'environement OCaml avec gcc -O2 (ou toute
autre optimisation que -O). Dans certains cas, cela produit un
compilateur ou un système d'exécution incorrect.

Mes excuses publiques pour avoir fait perdre leur temps à Fabrice (Le
Fessant) and Xavier (Leroy) à ce propos.

################


-- 
Basile STARYNKEVITCH - 8 rue de la Faiencerie, 92340 BOURG LA REINE (France)
tel 01.46.65.45.53. email = basile point starynkevitch at wanadoo point fr
http://perso.wanadoo.fr/starynkevitch/basile 
antispam: <abuse@wanadoo.fr>




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-04-26 13:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-26  8:48 Warning: gcc -O2 bad for compiling Ocaml Basile STARYNKEVITCH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).