When I compile a multithreaded program using ocamlopt from the mingw32-ocaml package for Fedora 11, the linker complains about these missing symbols from threads.a:
_caml_thread_exit _caml_thread_sigmask _caml_wait_signal
On my Fedora 12 box, those symbols are defined in libthreadsnat.a for the non-MinGW ocaml package, and the same OCaml code compiles and links OK.
Could it be that libthreadsnat.a was not built correctly in the Fedora 11 mingw32-ocaml package?
-- Paul -- Paul Steckler National ICT Australia paul DOT steckler AT nicta.com.au
The information in this e-mail may be confidential and subject to legal professional privilege and/or copyright. National ICT Australia Limited accepts no liability for any damage caused by this email or its attachments.
I asked (and no one answered):
Could it be that libthreadsnat.a was not built correctly in the Fedora 11 mingw32-ocaml package?
I looked into this issue myself. The source for libthreadsnat.a (posix.c) assumes the target looks like Linux (or Sun), not Windows. There is a MinGW pthreads library, which gets you some of the way there, but the source also assumes that Unix signals are available on the target.
My conclusion is that you can't get OCaml to use native Win32 threads by building with the MinGW ocaml cross-compiler. Does anyone know any different?
-- Paul -- Paul Steckler National ICT Australia paul DOT steckler AT nicta.com.au
The information in this e-mail may be confidential and subject to legal professional privilege and/or copyright. National ICT Australia Limited accepts no liability for any damage caused by this email or its attachments.
On Fri, May 21, 2010 at 04:47:06PM +1000, Paul Steckler wrote:
I asked (and no one answered):
Could it be that libthreadsnat.a was not built correctly in the Fedora 11 mingw32-ocaml package?
I looked into this issue myself. The source for libthreadsnat.a (posix.c) assumes the target looks like Linux (or Sun), not Windows. There is a MinGW pthreads library, which gets you some of the way there, but the source also assumes that Unix signals are available on the target.
My conclusion is that you can't get OCaml to use native Win32 threads by building with the MinGW ocaml cross-compiler. Does anyone know any different?
I didn't try any multi-threaded programs.
This sounds like an issue for upstream caml-list.
Rich.