New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ocamlc.opt on cygwin32/64 can not link to unix library #7268
Comments
Comment author: @alainfrisch The problem is that ocamlc.opt is linked (of course) with the native runtime, and this runtime does not expose caml_debugger_* symbols. The DLL is opened in "not for execution" mode, but the DLL itself, in its entry point, will trigger the relocation. I don't think there is a way to prevent the DLL entry point from being executed (or is it?). So I can see two options:
|
Comment author: @alainfrisch Also, note that this only affects the Cygwin port, not other Windows ports (which go though LoadLibraryEx and pass some flag which disable the execution of the DLL entry point). |
Comment author: @alainfrisch Fixed in flexdll: |
Comment author: persol I still get the same error when trying now to use ocaml 4.04 on cygwin64. When can I expect the fixes to flexdll reach the official cygwin distribution? Can I compile flexdll myself and replace the current cygwin flexdll (v.034) in the mean time? |
Comment author: antron I can confirm that this is fixed with FlexDLL 0.35. I built FlexDLL from source 1 and replaced the one distributed by Cygwin. Now, I'm actually not sure if this was broken due to FlexDLL, because there seems to be an issue with Cygwin packaging of OCaml. I tried to package OCaml 4.04, and got the error in this issue. The cygport packaging tool was stripping dllunix.so, presumably removing bytecode. I had to add RESTRICT=strip to the .cygport file to prevent this. FYI I package OCaml, Camlp4, OPAM, and now FlexDLL, as Cygwin packages for use in Lwt's AppVeyor builds 2. If interested, I can adapt these packages and release to Cygwin's public repository. |
Comment author: persol Thanks for your help, I will compile flexdll 0.35 and give it a try with ocaml 4.04. Of course it would be great if there will be an official release soon also, I have no knowledge who is the cygwin maintainer for ocaml/flexdll though. |
Comment author: antron I will email the Cygwin mailing list later today. If anyone here has info on this, would be interested to know as well. |
Comment author: antron FlexDLL 0.35 is now installable via Cygwin setup, both on x86 and x86_64. Package submitted by Yaakov Selkowitz. |
Original bug ID: 7268
Reporter: persol
Assigned to: @alainfrisch
Status: resolved (set by @alainfrisch on 2016-07-13T15:42:40Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 4.03.0
Fixed in version: 4.04.0 +dev / +beta1 / +beta2
Category: platform support (windows, cross-compilation, etc)
Monitored by: antron @gasche @diml
Bug description
ocamlc.opt, can not link to unix.cma on cygwin32/cygwin64
Steps to reproduce
$ uname -rsv
CYGWIN_NT-10.0-WOW 2.5.1(0.297/5/3) 2016-04-21 22:12
$ cat foo.ml
let () = print_float (Unix.gettimeofday ()); print_newline ()
$ ocamlc.opt -o foo unix.cma foo.ml
Error: Error on dynamically loaded library: /home/pela/.opam/4.03.0/lib/ocaml/stublibs/dllunix.so: Cannot resolve caml_debugger_cleanup_fork
Additional information
ocamlc works fine
This is a show stopper because ocamlbuild uses ocamlc.opt with the consequence that many opam packages now can't be installed
Have tested this on both cygwin32 and cygwin64 with the same result
The text was updated successfully, but these errors were encountered: