[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#854787: unusable plugin



Package: libzarith-ocaml
Version: 1.4.1-1
Severity: important

Hello,

$ cat plugin.ml
print_endline Z.(to_string (one + of_string Sys.argv.(1)))
$ cat loader.ml
open Dynlink
let () =
  try
    loadfile "/usr/lib/ocaml/zarith/zarith.cmxs";
    loadfile "plugin.cmxs"
  with Error e -> prerr_endline (error_message e)
$ ocamlfind ocamlopt -package zarith -shared -o plugin.cmxs plugin.ml
$ ocamlfind ocamlopt -package dynlink -linkpkg -linkall -o loader loader.ml
$ ./loader 42
error loading shared library: /tmp/glondu/plugin.cmxs: undefined symbol: camlZ

My suspicion is that zarith.cmxs has been compiled without -linkall:

$ ocamlopt -linkall -shared -I /usr/lib/ocaml/zarith -o zarith.cmxs zarith.cmxa
$ sed -i 's@/usr/lib/ocaml/zarith/@@' loader.ml
$ ocamlfind ocamlopt -package dynlink -linkpkg -linkall -o loader loader.ml
$ ./loader 42
43

Cheers,

-- 
Stéphane

-- System Information:
Debian Release: 9.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.8.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libzarith-ocaml depends on:
ii  libc6                                   2.24-8
ii  libgmp10                                2:6.1.2+dfsg-1
ii  ocaml-base-nox [ocaml-base-nox-4.02.3]  4.02.3-9

libzarith-ocaml recommends no packages.

libzarith-ocaml suggests no packages.

-- no debconf information

Reply to: