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

ocaml build fails on Solaris 10/x64 #3943

Closed
vicuna opened this issue Jan 1, 2006 · 5 comments
Closed

ocaml build fails on Solaris 10/x64 #3943

vicuna opened this issue Jan 1, 2006 · 5 comments
Assignees
Labels

Comments

@vicuna
Copy link

vicuna commented Jan 1, 2006

Original bug ID: 3943
Reporter: majid
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2006-08-30T11:42:46Z)
Resolution: not a bug
Priority: normal
Severity: major
Version: 3.09.0
Category: ~DO NOT USE (was: OCaml general)
Related to: #4663
Monitored by: avatariks majid

Bug description

Building ocaml 3.09 on Solaris 10/x64 fails with the following message:

boot/ocamlrun boot/ocamlc -nostdlib -I boot -warn-error A -I utils -I parsing -I
typing -I bytecomp -I asmcomp -I driver -I toplevel -c utils/consistbl.ml
boot/ocamlrun boot/ocamllex parsing/linenum.mll
12 states, 323 transitions, table size 1364 bytes
Fatal error: exception Sys_error("Invalid argument")
gmake: *** [parsing/linenum.ml] Error 2

Additional information

I am attaching a full log of the configure/make world session

File attachments

@vicuna
Copy link
Author

vicuna commented Jan 3, 2006

Comment author: @xavierleroy

Note that gcc and OCaml are configured for x86 (32 bits) not x86_64 (64 bits).
Could this be a 32-bit app / 64-bit system call compatibility issue?

It would be helpful to identify which system call fails. Something like

truss boot/ocamlrun boot/ocamllex parsing/linenum.mll

should show a trace of system calls.

Consider also compiling ocamlrun in debug mode (see INSTALL file) and
running byterun/ocamlrund under a debugger with arguments boot/ocamllex parsing/linenum.mll.

@vicuna
Copy link
Author

vicuna commented Jan 5, 2006

Comment author: majid

It is indeed a 32/64 bit issue, as ocaml compiles and installs just fine on another Solaris 10 machine running on an AMD Athlon XP (32 bit).

I am attaching the results of truss.

@vicuna
Copy link
Author

vicuna commented Jan 9, 2006

Comment author: majid

I manage to build using:

configure -cc "/usr/sfw/bin/gcc -m64" -host x86_64-solaris10 -with-pthreads

(after having patched configure with the patch attached so it recognizes /usr/sfw/bin/gcc as gcc to supply -fPIC instead of -KPIC, and so it uses amd64 as the target instead of ia32).

I cannot build "make opt" yet, as compilation of amd64.S aborts with the following error message:

/usr/sfw/bin/gcc -m64 -I../byterun -DCAML_NAME_SPACE -DNATIVE_CODE -DTARGET_amd64 -DSYS_solaris -O -D_FILE_OFFSET_BITS=64 -D_REENTRANT -c -o unix.o unix.c
gcc -c -DSYS_solaris -o amd64.o amd64.S ||
{ echo "If your assembler produced syntax errors, it is probably unhappy with the"; echo "preprocessor. Check your assembler, or try producing amd64.o by hand."; exit 2; }
Assembler:
"/var/tmp//ccI1fzre.s", line 7 : Illegal register: "rsp"
"/var/tmp//ccI1fzre.s", line 7 : Syntax error
"/var/tmp//ccI1fzre.s", line 7 : Illegal register: "rax"
"/var/tmp//ccI1fzre.s", line 8 : Illegal register: "rax"
"/var/tmp//ccI1fzre.s", line 8 : Syntax error
"/var/tmp//ccI1fzre.s", line 8 : Illegal register: "rip"
"/var/tmp//ccI1fzre.s", line 9 : Illegal mnemonic
"/var/tmp//ccI1fzre.s", line 9 : Illegal register: "rsp"
"/var/tmp//ccI1fzre.s", line 9 : Syntax error
"/var/tmp//ccI1fzre.s", line 9 : Illegal register: "rax"
"/var/tmp//ccI1fzre.s", line 10 : Illegal register: "rax"
"/var/tmp//ccI1fzre.s", line 10 : Syntax error
"/var/tmp//ccI1fzre.s", line 10 : Illegal register: "rip"
"/var/tmp//ccI1fzre.s", line 13 : Illegal register: "r15"
"/var/tmp//ccI1fzre.s", line 13 : Syntax error
"/var/tmp//ccI1fzre.s", line 13 : Illegal register: "rip"
"/var/tmp//ccI1fzre.s", line 14 : Illegal register: "r14"
"/var/tmp//ccI1fzre.s", line 14 : Syntax error
"/var/tmp//ccI1fzre.s", line 14 : Illegal register: "rip"
"/var/tmp//ccI1fzre.s", line 16 : Illegal mnemonic
"/var/tmp//ccI1fzre.s", line 16 : Illegal register: "r13"
"/var/tmp//ccI1fzre.s", line 16 : Syntax error
"/var/tmp//ccI1fzre.s", line 17 : Illegal mnemonic
"/var/tmp//ccI1fzre.s", line 17 : Illegal register: "r12"
"/var/tmp//ccI1fzre.s", line 17 : Syntax error
"/var/tmp//ccI1fzre.s", line 18 : Illegal mnemonic
"/var/tmp//ccI1fzre.s", line 18 : Illegal register: "rbp"
"/var/tmp//ccI1fzre.s", line 18 : Syntax error
"/var/tmp//ccI1fzre.s", line 19 : Illegal mnemonic
"/var/tmp//ccI1fzre.s", line 19 : Illegal register: "r11"
"/var/tmp//ccI1fzre.s", line 19 : Syntax error
Too many errors - Goodbye
If your assembler produced syntax errors, it is probably unhappy with the
preprocessor. Check your assembler, or try producing amd64.o by hand.
gmake[1]: *** [amd64.o] Error 2
gmake[1]: Leaving directory `/home/majid/src/ocaml-3.09.1/asmrun'
gmake: *** [runtimeopt] Error 2

@vicuna
Copy link
Author

vicuna commented Jan 9, 2006

Comment author: majid

Changing ASPP with yet another patch to configure (attached configure2.txt supersedes configure.txt) so it uses /usr/sfw/bin/gcc instead of just gcc will get amd64.o to compile. The build fails downstream, presumably because ocamlopt is not calling the right assembler or giving it the right options (e.g. -xarch=amd64 if using Solaris /usr/ccs/bin/as).

cd stdlib; gmake allopt
gmake[1]: Entering directory /home/majid/src/ocaml-3.09.1/stdlib' ../boot/ocamlrun ../ocamlopt -warn-error A -nostdlib ./Compflags pervasives.cmx-c pervasives.ml Assembler: "/tmp/camlasm91eb37.s", line 11 : Illegal mnemonic "/tmp/camlasm91eb37.s", line 11 : Syntax error "/tmp/camlasm91eb37.s", line 419 : Illegal mnemonic "/tmp/camlasm91eb37.s", line 419 : Syntax error "/tmp/camlasm91eb37.s", line 466 : Illegal mnemonic "/tmp/camlasm91eb37.s", line 466 : Syntax error "/tmp/camlasm91eb37.s", line 472 : Illegal mnemonic "/tmp/camlasm91eb37.s", line 472 : Syntax error "/tmp/camlasm91eb37.s", line 496 : Illegal mnemonic "/tmp/camlasm91eb37.s", line 496 : Syntax error "/tmp/camlasm91eb37.s", line 536 : Illegal mnemonic "/tmp/camlasm91eb37.s", line 536 : Syntax error "/tmp/camlasm91eb37.s", line 542 : Illegal mnemonic "/tmp/camlasm91eb37.s", line 542 : Syntax error "/tmp/camlasm91eb37.s", line 548 : Illegal mnemonic "/tmp/camlasm91eb37.s", line 548 : Syntax error "/tmp/camlasm91eb37.s", line 554 : Illegal mnemonic "/tmp/camlasm91eb37.s", line 554 : Syntax error "/tmp/camlasm91eb37.s", line 560 : Illegal mnemonic "/tmp/camlasm91eb37.s", line 560 : Syntax error "/tmp/camlasm91eb37.s", line 566 : Illegal mnemonic "/tmp/camlasm91eb37.s", line 566 : Syntax error "/tmp/camlasm91eb37.s", line 572 : Illegal mnemonic "/tmp/camlasm91eb37.s", line 572 : Syntax error "/tmp/camlasm91eb37.s", line 578 : Illegal mnemonic "/tmp/camlasm91eb37.s", line 578 : Syntax error "/tmp/camlasm91eb37.s", line 584 : Illegal mnemonic "/tmp/camlasm91eb37.s", line 584 : Syntax error "/tmp/camlasm91eb37.s", line 591 : Illegal register: "rbx" "/tmp/camlasm91eb37.s", line 591 : Syntax error "/tmp/camlasm91eb37.s", line 591 : Illegal register: "rdi" Too many errors - Goodbye Assembler error, input left in file /tmp/camlasm91eb37.s gmake[1]: *** [pervasives.cmx] Error 2 gmake[1]: Leaving directory/home/majid/src/ocaml-3.09.1/stdlib'
gmake: *** [libraryopt] Error 2

@vicuna
Copy link
Author

vicuna commented Aug 30, 2006

Comment author: @xavierleroy

There are two separate issues here:

1- The close() system call that returns EINVAL (see the truss output).
This is a Solaris bug: close() is not even allowed to ever return EINVAL
according to the Single Unix Specification.

2- The Solaris compilers appear to produce 32-bit apps by default and to require special options to produce 64-bit apps. This is OK except that OCaml's configuration makes it hard or even impossible to select the options appropriate for a 64-bit app. I might look into this later when I get access to a Solaris/AMD64 platform.

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

2 participants