Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000470OCamlOCaml generalpublic2001-08-03 11:572001-08-08 17:19
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000470: Problems compiling ocaml-3.02 on solaris !
Description
Hi,

I just tried to compile ocaml-3.02 on

poohocaml/ocaml-3.02> uname -a ;
SunOS pooh 5.7 Generic_106541-12 sun4u sparc SUNW,Ultra-4

with Sun's cc and Gnu gcc 3.0 and encountered several problems. I finally got it
run with Sun's cc without options and without parallel make (-j 2).

Another little problem is that Sparc.S won't compiler with Gnu as. I choose
/usr/ccs/bin/as and it works.

GNU assembler version 2.11 (sparc-sun-solaris2.7) using BFD version 2.11

So I am happy now. Probably you are interesting in the problems :


1st try with WorkShop Compilers 5.0 98/12/15 C 5.0
==================================================

./configure -cc "cc -fast" -prefix /home/mdeil

** Configuration summary **

Directories where Objective Caml will be installed:
        binaries.................. /home/mdeil/bin
        standard library.......... /home/mdeil/lib/ocaml
        manual pages.............. /home/mdeil/man/man1 (with extension .1)
Configuration for the bytecode compiler:
        C compiler used........... cc -fast
        options for compiling.....
        options for linking....... -lnsl -lsocket -lm -lcurses
Configuration for the native-code compiler:
        hardware architecture..... sparc
        OS variant................ solaris
        C compiler used........... cc -fast
        options for compiling.....
        options for linking....... -lnsl -lsocket -lm
        assembler ................ $(AS)
        preprocessed assembler ... $(AS) -P -DSYS_$(SYSTEM)
        profiling with gprof ..... not supported
Source-level replay debugger: supported
Configuration for the external libraries:
        libraries supported ...... unix str num dynlink bigarray threads graph
dbm
The "num" library:
        target architecture ...... supersparc-solaris
The "graph" library:
        options for compiling ....
        options for linking ...... -cclib -lX11
The "labltk" library: configuration failed
kdoertel has logged on pts/17 from kottan.
kdoertel has logged on pts/18 from kottan.
mdeil has logged on pts/19 from 192.168.3.53.

poohocaml/ocaml-3.02> make world

...
boot/ocamlrun boot/ocamlc -I boot -I utils -I parsing -I typing -I bytecomp -I
asmcomp -I driver -I toplevel -c utils/misc.mli
>> Fatal error: cannot open pervasives.cmi
Uncaught exception: Misc.Fatal_error
make: *** [utils/misc.cmi] Error 2
make: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/mdeil/data/soft/ocaml/ocaml-3.02/byterun'
cp byterun/ocamlrun boot/ocamlrun
make: *** Waiting for unfinished jobs....
cd yacc; make all
make: *** Waiting for unfinished jobs....
make[1]: Entering directory `/home/mdeil/data/soft/ocaml/ocaml-3.02/yacc'
cc -fast -O -DNDEBUG -c -o closure.o closure.c
cc -fast -O -DNDEBUG -c -o error.o error.c
cc -fast -O -DNDEBUG -c -o lalr.o lalr.c
cc -fast -O -DNDEBUG -c -o lr0.o lr0.c
cc -fast -O -DNDEBUG -c -o main.o main.c
cc -fast -O -DNDEBUG -c -o mkpar.o mkpar.c
cc -fast -O -DNDEBUG -c -o output.o output.c
cc -fast -O -DNDEBUG -c -o reader.o reader.c
cc -fast -O -DNDEBUG -c -o skeleton.o skeleton.c
cc -fast -O -DNDEBUG -c -o symtab.o symtab.c
cc -fast -O -DNDEBUG -c -o verbose.o verbose.c
cc -fast -O -DNDEBUG -c -o warshall.o warshall.c
cc -fast -O -DNDEBUG -o ocamlyacc closure.o error.o lalr.o lr0.o main.o
mkpar.o output.o reader.o skeleton.o symtab.o verbose.o warshall.o
make[1]: Leaving directory `/home/mdeil/data/soft/ocaml/ocaml-3.02/yacc'
cp yacc/ocamlyacc boot/ocamlyacc
make: *** Waiting for unfinished jobs....
cd stdlib; make COMPILER=../boot/ocamlc all
make: *** Waiting for unfinished jobs....
make[1]: Entering directory `/home/mdeil/data/soft/ocaml/ocaml-3.02/stdlib'
../boot/ocamlrun ../boot/ocamlc -g -nopervasives -c pervasives.mli
../boot/ocamlrun ../boot/ocamlc -g -c array.mli
>> Fatal error: cannot open pervasives.cmi
Uncaught exception: Misc.Fatal_error
make[1]: *** [array.cmi] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/mdeil/data/soft/ocaml/ocaml-3.02/stdlib'
make: *** [coldstart] Error 2

Trying without -fast and without -j 2 for make lead to the same results. Mmmh,
try switching to GCC 3.0. see next

=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*


2nd try with gcc version 3.0
============================

./configure -prefix /home/mdeil

** Configuration summary **

Directories where Objective Caml will be installed:
        binaries.................. /home/mdeil/bin
        standard library.......... /home/mdeil/lib/ocaml
        manual pages.............. /home/mdeil/man/man1 (with extension .1)
Configuration for the bytecode compiler:
        C compiler used........... gcc
        options for compiling..... -fno-defer-pop -Wall -Wno-unused
        options for linking....... -lnsl -lsocket -lm -lcurses
Configuration for the native-code compiler:
        hardware architecture..... sparc
        OS variant................ solaris
        C compiler used........... gcc
        options for compiling..... -Wall -Wno-unused
        options for linking....... -lnsl -lsocket -lm
        assembler ................ $(AS)
        preprocessed assembler ... gcc -c -DSYS_$(SYSTEM)
        profiling with gprof ..... not supported
Source-level replay debugger: supported
Configuration for the external libraries:
        libraries supported ...... unix str num dynlink bigarray threads graph
dbm
The "num" library:
        target architecture ...... supersparc-solaris
The "graph" library:
        options for compiling ....
        options for linking ...... -cclib -lX11
The "labltk" library: configuration failed

poohocaml/ocaml-3.02> make world

...
../boot/ocamlrun ../boot/ocamlc -g -c char.ml
make[1]: *** [char.cmo] Bus Error (core dumped)
make[1]: *** Deleting file `char.cmo'
make[1]: Leaving directory `/home/mdeil/data/soft/ocaml/ocaml-3.02/stdlib'
make: *** [coldstart] Error 2

in another run (don't know what I did to come that far) the procedure came to

../boot/ocamlrun ../boot/ocamlc -g -nopervasives -c pervasives.mli

and I stopped the program after running nearly 45 minutes without any progress.

process is still running
...

Viele Gruesse / Best Regards

-- Mario




TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000633)
administrator (administrator)
2001-08-03 13:15

> I just tried to compile ocaml-3.02 on
> poohocaml/ocaml-3.02> uname -a ;
> SunOS pooh 5.7 Generic_106541-12 sun4u sparc SUNW,Ultra-4
> with Sun's cc and Gnu gcc 3.0 and encountered several problems. I
> finally got it run with Sun's cc without options and without
> parallel make (-j 2).

I'm not surprised "make -j 2" causes problems -- the top-level
Makefile for OCaml strongly relies on sequential building of several
targets. That would explain the "cannot open <file>" fatal errors.

Both "cc -fast" and "gcc" compile OCaml just fine on my test Solaris
machine. The compiler versions are somewhat older than yours, though:
        Solaris 2.6
        cc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2
        gcc version 2.8.1
(Yes, I know, this is ancient, but that's not my machine.)

> ../boot/ocamlrun ../boot/ocamlc -g -c char.ml
> make[1]: *** [char.cmo] Bus Error (core dumped)

This is interesting. It could be a code generation bug in gcc 3.0,
or an "undefined behavior" in the C source for the Caml bytecode
interpreter that is exposed by some gcc 3.0 optimizations. I'll try
to investigate this further.

> Another little problem is that Sparc.S won't compiler with Gnu as. I choose
> /usr/ccs/bin/as and it works.
> GNU assembler version 2.11 (sparc-sun-solaris2.7) using BFD version 2.11

Yes, this is a known issue. GNU as doesn't implement the
"preprocessing" option of Sun's as -- in other terms, it's not a
drop-in replacement for Sun's as, which I consider to be a bug in GNU as.

Thanks for your feedback,

- Xavier Leroy

(0000634)
administrator (administrator)
2001-08-03 14:14


Dear Xavier,

I tried again with cc -fast and it worked (it's worth the optimization ;)).
Maybe I only tested with make -j 2.

Mmmh , sorry.

gcc problem still exists !

Viele Gruesse / Best Regards

-- Mario

Mario Deilmann
Senior Sales Engineer
--------------------------------------------------------------------
//// pallas
Pallas GmbH / Hermuelheimer Str. 10 / 50321 Bruehl / Germany
Mario.Deilmann@pallas.com / www.pallas.com
Tel +49-2232-1896-31 / Fax +49-2232-1896-29
--------------------------------------------------------------------

On Fri, 3 Aug 2001, Xavier Leroy wrote:

> > I just tried to compile ocaml-3.02 on
> > poohocaml/ocaml-3.02> uname -a ;
> > SunOS pooh 5.7 Generic_106541-12 sun4u sparc SUNW,Ultra-4
> > with Sun's cc and Gnu gcc 3.0 and encountered several problems. I
> > finally got it run with Sun's cc without options and without
> > parallel make (-j 2).
>
> I'm not surprised "make -j 2" causes problems -- the top-level
> Makefile for OCaml strongly relies on sequential building of several
> targets. That would explain the "cannot open <file>" fatal errors.
>
> Both "cc -fast" and "gcc" compile OCaml just fine on my test Solaris
> machine. The compiler versions are somewhat older than yours, though:
> Solaris 2.6
> cc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2
> gcc version 2.8.1
> (Yes, I know, this is ancient, but that's not my machine.)
>
> > ../boot/ocamlrun ../boot/ocamlc -g -c char.ml
> > make[1]: *** [char.cmo] Bus Error (core dumped)
>
> This is interesting. It could be a code generation bug in gcc 3.0,
> or an "undefined behavior" in the C source for the Caml bytecode
> interpreter that is exposed by some gcc 3.0 optimizations. I'll try
> to investigate this further.
>
> > Another little problem is that Sparc.S won't compiler with Gnu as. I choose
> > /usr/ccs/bin/as and it works.
> > GNU assembler version 2.11 (sparc-sun-solaris2.7) using BFD version 2.11
>
> Yes, this is a known issue. GNU as doesn't implement the
> "preprocessing" option of Sun's as -- in other terms, it's not a
> drop-in replacement for Sun's as, which I consider to be a bug in GNU as.
>
> Thanks for your feedback,
>
> - Xavier Leroy
>

(0000635)
administrator (administrator)
2001-08-06 10:23

> I tried again with cc -fast and it worked (it's worth the optimization ;)).
> Maybe I only tested with make -j 2.
>
> Mmmh , sorry.
>
> gcc problem still exists !

Yes, and I was able to track it down. It's quite interesting, actually.
The configuration script runs various bits of C code to test for
hardware constraints such as 64-bit alignment of float pointers. But
it compiles those tests without optimization, while the runtime system
is compiled with -O. It so happens that GCC 3.0 generates different
code for float loads and stores depending on whether -O is set;
without -O, 32-bit alignment is supported, and with -O, 64-bit
alignment is required! Hence the crash you reported.

This is now fixed in the working sources. You should be able to get
OCaml 3.02 to compile with gcc 3.0 by running "configure", then edit
the generated config/m.h file and replace
        #undef ARCH_ALIGN_DOUBLE
by
        #define ARCH_ALIGN_DOUBLE

Thanks for the interesting bug report.
Best regards,

- Xavier Leroy

(0000636)
administrator (administrator)
2001-08-08 17:19

Fixed 2001-08-03 by XL.

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker