mirleft / ocaml-nocrypto

OCaml cryptographic library
ISC License
111 stars 53 forks source link

Custom runtime does not compile on FreeBSD #115

Open orbitz opened 7 years ago

orbitz commented 7 years ago

I'm not sure if it compiles elsewhere but I get:

/tmp/camlprim076048-c98550.o:(.data+0x1038): undefined reference to `caml_nc_xor_into'
/tmp/camlprim076048-c98550.o:(.data+0x1040): undefined reference to `caml_nc_sha512_init'
/tmp/camlprim076048-c98550.o:(.data+0x1048): undefined reference to `caml_nc_sha512_update'
/tmp/camlprim076048-c98550.o:(.data+0x1050): undefined reference to `caml_nc_sha512_finalize'
/tmp/camlprim076048-c98550.o:(.data+0x1058): undefined reference to `caml_nc_sha512_ctx_size'
/tmp/camlprim076048-c98550.o:(.data+0x1060): undefined reference to `caml_nc_sha384_init'
...

I would guess this is the same issue as:

https://github.com/dbuenzli/mtime/issues/16

orbitz commented 7 years ago

This appears to have been introduced in 0.5.4.

cfcs commented 7 years ago

Cannot reproduce, 0.5.4 installs fine for me on both FreeBSD and Linux.

copy commented 7 years ago

Reproducible test case:

(* test.ml *)
let x = Nocrypto.Hash.digest
;; jbuild
(jbuild_version 1)
(library
  ((name test)
   (libraries (nocrypto))))

Command to reproduce: opam pin add jbuilder --dev-repo && jbuilder utop

This is on 0.5.4.

hannesm commented 7 years ago

@copy thanks for the test case, I could reproduce -- when I pin ocb-stubblr to https://github.com/hannesm/ocb-stubblr.git#fix and recompile nocrypto afterwards, the error is gone.

See https://github.com/pqwy/ocb-stubblr/pull/11 for the fix to ocb-stubblr.

copy commented 7 years ago

@hannesm Thanks for the super-quick fix.