Skip to content

Zarith compilation fails in 32bit OCaml switches on a 64bit host. #38

@ejgallego

Description

@ejgallego

Ubuntu 18.04, opam 2.0, switch is 4.07.0+32bit:

./configure 
binary ocaml: found in /home/egallego/.opam/4.07.0+32bit/bin
binary ocamlc: found in /home/egallego/.opam/4.07.0+32bit/bin
binary ocamldep: found in /home/egallego/.opam/4.07.0+32bit/bin
binary ocamlmklib: found in /home/egallego/.opam/4.07.0+32bit/bin
binary ocamldoc: found in /home/egallego/.opam/4.07.0+32bit/bin
binary ar: found in /usr/bin
binary perl: found in /usr/bin
binary gcc: found in /usr/bin
binary ocamlopt: found in /home/egallego/.opam/4.07.0+32bit/bin
checking compilation with gcc -O3 -Wall -Wextra : working
include caml/mlvalues.h: found
library dynlink.cmxa: found
binary ocamlfind: found in /home/egallego/.opam/4.07.0+32bit/bin
OCaml's word size is 32
binary uname: found in /bin
include gmp.h: found
library gmp: found
OCaml extended comparison supported
OCaml new hash functions available
OCaml supports -bin-annot to produce documentation

detected configuration:

  native-code:          yes
  dynamic linking:      yes
  asm path:             x86_64
  defines:              -DZ_OCAML_HASH -DZ_OCAML_COMPARE_EXT -DHAS_GMP -DZ_ELF -DZ_DOT_LABEL_PREFIX 
  libraries:             -lgmp
  C options:            -O3 -Wall -Wextra 
  asm options           
  installation path:    /home/egallego/.opam/4.07.0+32bit/lib
  installation method   findlib
$ make
project.mak:151: depend: No existe el archivo o el directorio
./z_pp.pl x86_64
Name "main::extra" used only once: possible typo at ./z_pp.pl line 29.
found assembly file caml_z_x86_64.S
  found abs
  found add
  found div
  found divexact
  found logand
  found lognot
  found logor
  found logxor
  found mul
  found neg
  found pred
  found rem
  found shift_left
  found shift_right
  found sub
  found succ
ocamldep -native  z.ml q.ml big_int_Z.ml z.mli q.mli big_int_Z.mli > depend
ocamlc -I +compiler-libs -bin-annot  -c z.mli
ocamlc -I +compiler-libs -bin-annot  -c z.ml
ocamlc -I +compiler-libs -bin-annot  -c q.mli
ocamlc -I +compiler-libs -bin-annot  -c q.ml
ocamlc -I +compiler-libs -bin-annot  -c big_int_Z.mli
ocamlc -I +compiler-libs -bin-annot  -c big_int_Z.ml
ocamlmklib -failsafe -o zarith z.cmo q.cmo big_int_Z.cmo -lgmp
gcc -DZ_OCAML_HASH -DZ_OCAML_COMPARE_EXT -DHAS_GMP -DZ_ELF -DZ_DOT_LABEL_PREFIX     -c -o caml_z_x86_64.o caml_z_x86_64.S
ocamlc -ccopt "-I/home/egallego/.opam/4.07.0+32bit/lib/ocaml  -DZ_OCAML_HASH -DZ_OCAML_COMPARE_EXT -DHAS_GMP -DZ_ELF -DZ_DOT_LABEL_PREFIX  -O3 -Wall -Wextra " -c caml_z.c
ocamlmklib -failsafe -o zarith caml_z_x86_64.o caml_z.o -lgmp
/usr/bin/ld: la arquitectura i386:x86-64 del fichero de entrada `caml_z_x86_64.o' es incompatible con la salida i386
collect2: error: ld returned 1 exit status
ocamlc -I +compiler-libs -bin-annot  -c zarith_top.ml
ocamlc -o zarith_top.cma -a zarith_top.cmo
ocamlopt -I +compiler-libs  -c z.ml
ocamlopt -I +compiler-libs  -c q.ml
ocamlopt -I +compiler-libs  -c big_int_Z.ml
ocamlmklib -failsafe -o zarith z.cmx q.cmx big_int_Z.cmx -lgmp
ocamlopt -shared -o zarith.cmxs -I . zarith.cmxa -linkall
/usr/bin/ld: se salta el ./libzarith.a incompatible mientras se busca -lzarith
/usr/bin/ld: no se puede encontrar -lzarith
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking
project.mak:79: recipe for target 'zarith.cmxs' failed
make: *** [zarith.cmxs] Error 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions