You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Cannot relocate" error with flexdll in OCaml for Windows 4.11 (and older versions) #92
I just installed OCaml for Windows 4.11.1 (4.11.1+mingw64c) and, as before, I tried to install and run the frama-c package, which uses dynamic loading for its plugins. Compilation worked fine, but trying to run it fails with:
I had never seen this issue before; frama-c worked with several previous versions of the OCaml compiler. After testing, I noticed it also happens with older versions of Frama-C, and with OCaml as old as 4.08.1 (I didn't have the time to test other versions; each compilation takes about 1 hour...). So I wonder if something changed on Windows or in flexdll. The same issue happened to one of our users, so it's not just my machine. I'm not sure what to do on the Frama-C side to debug it.
Are there any known issues issues related to the "flexdll error: cannot relocate RELOC_REL32, target is too far" message? Would you have any suggestions on how to proceed to debug this?
By the way, running flexlink -help displays FlexDLL version 0.38fdopen1; so I'm not sure I should contact fdopen directly to ask for help; sorry if the issue is unrelated to you.
Thanks for the tip. I just downgraded to 2.35.2-1 (from 2.36.1-2) and recompiled Why3 and Frama-C, however it still didn't work. I'll try 2.35.1-1, and otherwise try a clean reinstall, just in case.
Oh wait, in fact I had reinstalled the binutils package, not the mingw64-x86_64-binutils, which remained at 2.36...
The longer term fix for OCaml < 4.12 will be to add overrides for the image-base in flexlink and patch the old compilers to use it (so I'll keep the issue open to remind me!)
Just to make sure, is the issue still supposed to happen if I install the OCaml switch 4.12.0+mingw64c? Because I did so, and it still doesn't work with binutils 2.36 (same error).
However, after downgrading to mingw64-x86_64-binutils version 2.35.2-1 and reinstalling the opam switch, I was indeed able to avoid the flexdll error. Thank you very much!
I think we have no constraints w.r.t. OCaml versions, so the backport is not very important to us. Just knowing that it will still work in the future, and that there's a workaround for the current versions, is great!
Activity
dra27 commentedon May 11, 2021
You need to downgrade the Cygwin mingw64 binutils package to 2.35, I’m afraid.
maroneze commentedon May 12, 2021
Thanks for the tip. I just downgraded to 2.35.2-1 (from 2.36.1-2) and recompiled Why3 and Frama-C, however it still didn't work. I'll try 2.35.1-1, and otherwise try a clean reinstall, just in case.
Oh wait, in fact I had reinstalled the
binutilspackage, not themingw64-x86_64-binutils, which remained at 2.36...dra27 commentedon May 12, 2021
You'll need to recompile everything, I'm afraid!
dra27 commentedon May 12, 2021
The longer term fix for OCaml < 4.12 will be to add overrides for the image-base in flexlink and patch the old compilers to use it (so I'll keep the issue open to remind me!)
maroneze commentedon May 12, 2021
Just to make sure, is the issue still supposed to happen if I install the OCaml switch
4.12.0+mingw64c? Because I did so, and it still doesn't work with binutils 2.36 (same error).However, after downgrading to
mingw64-x86_64-binutilsversion 2.35.2-1 and reinstalling the opam switch, I was indeed able to avoid the flexdll error. Thank you very much!dra27 commentedon May 12, 2021
That's right - the fix will be in 4.12.1, but it's non-trivial to back-port the fix from 4.12 to earlier versions.
maroneze commentedon May 12, 2021
Ok, thanks for the clarification.
I think we have no constraints w.r.t. OCaml versions, so the backport is not very important to us. Just knowing that it will still work in the future, and that there's a workaround for the current versions, is great!
yakobowski commentedon Oct 5, 2021
For other people who may stumble upon this, the 4.12.1 fix is ocaml/ocaml#10351.