Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems compiling ocaml-3.02 on solaris ! #2887

Closed
vicuna opened this issue Aug 3, 2001 · 4 comments
Closed

Problems compiling ocaml-3.02 on solaris ! #2887

vicuna opened this issue Aug 3, 2001 · 4 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Aug 3, 2001

Original bug ID: 470
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug 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

@vicuna
Copy link
Author

vicuna commented Aug 3, 2001

Comment author: administrator

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 " 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

@vicuna
Copy link
Author

vicuna commented Aug 3, 2001

Comment author: administrator

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 " 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

@vicuna
Copy link
Author

vicuna commented Aug 6, 2001

Comment author: administrator

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

@vicuna
Copy link
Author

vicuna commented Aug 8, 2001

Comment author: administrator

Fixed 2001-08-03 by XL.

@vicuna vicuna closed this as completed Aug 8, 2001
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant