From: Gerd S. <in...@ge...> - 2012-02-29 13:34:10
|
Am Mittwoch, den 29.02.2012, 09:57 +0100 schrieb Stéphane Glondu: > Le 23/02/2012 00:04, Gerd Stolpmann a écrit : > > it is time for another version of Ocamlnet. The new release 3.5 focuses on > > the system interface, and includes a long list of smaller improvements. > > [...] > > It seems that this new release adds a new dependency to threads in some > situations: > > $ cat test.ml > let () = ignore (Netconversion.ustring_of_uchar `Enc_utf8 0) > $ ocamlfind ocamlopt -package netstring -linkpkg test.ml > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `free_sem_block': > (.text+0x58): undefined reference to `sem_close' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_open': > (.text+0xba): undefined reference to `sem_open' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_close': > (.text+0x10c): undefined reference to `sem_close' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_unlink': > (.text+0x13a): undefined reference to `sem_unlink' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_init': > (.text+0x178): undefined reference to `sem_init' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_destroy': > (.text+0x1d8): undefined reference to `sem_destroy' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_getvalue': > (.text+0x220): undefined reference to `sem_getvalue' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_post': > (.text+0x272): undefined reference to `sem_post' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_wait': > (.text+0x2cc): undefined reference to `sem_wait' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_sem.o): In function > `netsys_sem_wait': > (.text+0x2d8): undefined reference to `sem_trywait' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_spawn.o): In function > `netsys_spawn_nat': > (.text+0x81): undefined reference to `pthread_sigmask' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_spawn.o): In function > `netsys_spawn_nat': > (.text+0xa7b): undefined reference to `pthread_sigmask' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_spawn.o): In function > `netsys_spawn_nat': > (.text+0xb6d): undefined reference to `pthread_sigmask' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_subprocess.o): In function > `sigchld_lock': > (.text+0x34): undefined reference to `pthread_sigmask' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_subprocess.o): In function > `sigchld_unlock': > (.text+0x11a): undefined reference to `pthread_sigmask' > /usr/lib/ocaml/netsys/libnetsys.a(netsys_c_subprocess.o): In function > `netsys_watch_subprocess': > (.text+0x65e): undefined reference to `pthread_create' > collect2: ld returned 1 exit status > File "caml_startup", line 1, characters 0-1: > Error: Error during linking > $ ocamlfind ocamlopt -thread -package netstring -linkpkg test.ml > $ echo $? > 0 > > Whith ocamlnet 3.4.1, the -thread switch was not needed. Is that > expected? Even if it is, I would expect a more explanatory error message... Hmmm, this is strange. Looks like -lrt and -lpthread are missing in the link. The -thread switch shouldn't be necessary. The strange thing is that this aspect did not change between 3.4.1 and 3.5. Already 3.4.1 used pthread directly (no matter whether -thread was given or not given), in order to handle the case correctly where some C library routine starts hidden pthreads. I'll investigate. Gerd > > Cheers, > -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany ge...@ge... Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de *** Searching for new projects! Need consulting for system *** programming in Ocaml? Gerd Stolpmann can help you. ------------------------------------------------------------ |