Web lists-archives.com

Problem with Ocaml dllunix.so, flexdll error: cannot relocate, target is too far




Greetings!

I was trying to build an ocaml unit test using ounit, but when I tried
to execute it I got:

Cannot load required shared library dllunix.
Reason: /usr/lib/ocaml/stublibs/dllunix.so: flexdll error: cannot
relocate RELOC_REL32, target is too far: 0xfffffffc12f78b5f
0x12f78b5f.

That .so file is from package ocaml-4.04.2-1. I will provide details
below to reproduce what I was doing, but the simplest way to see the
error is by running the ocaml "toplevel" (aka REPL). Note: the command
to exit it is "#quit;;" -- yes, with two semicolons.

$ ocaml
        OCaml version 4.04.2

# #load "unix.cma";;
Cannot load required shared library dllunix.
Reason: /usr/lib/ocaml/stublibs/dllunix.so: flexdll error: cannot
relocate RELOC_REL32, target is too far: 0xfffffffc12f78b5f
0x12f78b5f.
# #quit;;


Steps I have tried without success:

Run setup and ensure my system is up-to-date, including flexdll (0.35-2).
Revert flexdll to prior version 0.34.
/usr/bin/rebase-trigger fullrebase and then ran setup again.
Uninstall ocamlbuild and ocaml-findlib, install opam, and try to
install ocamlbuild and ocamlfind from there.

The last one fails while trying to install ocamlfind with the same
flexdll error.

Okay, if you've gotten this far, here are the steps to replicate
exactly what I was doing. This is probably
overkill, but anyway...

Prerequisites: ocaml ocaml-findlib ocamlbuild ocaml-ounit

Create square.ml containing:

let square x = x * x;;

Create test.ml containing:

open OUnit2;;

let test1 test_ctxt = assert_equal 25 (Square.square 5);;

let test2 test_ctxt = assert_equal 2401 (Square.square 49);;

let suite = "suite">:::
    ["test1">:: test1;
     "test2">:: test2] ;;

let () =
    run_test_tt_main suite ;;

Build:

ocamlfind ocamlc -o test -package oUnit -linkpkg -g square.ml test.ml

Run:

./test


You should get the same flexdll error as above. Thanks in advance for your help.

cygcheck -s -v -r output is attached but I'll just note my system is
64-bit, running Windows 10.

Regards,
David Conrad

Attachment: cygcheck.out
Description: Binary data

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple