On Mon, Dec 05, 2011 at 10:00:37AM +0100, Vitali wrote: > where I just added "-pthread" as you can see, and openconnect normally > compiled and worked properly. > > Anyway I decided to go on with the experiments and poked about > libproxy in ports. > In the patch file > "/usr/ports/net/libproxy/patches/patch-libproxy_cmake_libproxy_cmk" > there was a replacement line: > > - target_link_libraries(libproxy modman;m;pthread;dl;${LIBPROXY_LIBRARIES}) > + target_link_libraries(libproxy modman;m;${LIBPROXY_LIBRARIES}) > > which I edited for: > > + target_link_libraries(libproxy modman;m;pthread;${LIBPROXY_LIBRARIES}) > > I put back only "pthread" as you see, rebuilt libproxy and gave > openconnect a new try, and this time it built with no errors. > > Here is my conversation with the openconnect developer > https://plus.google.com/u/0/113990329890790578682/posts/fxytv9BTkcY > > I wonder why "pthread" had been removed from libproxy? Or maybe I've > lost something? I found no information on the OpenBSD site about this.
Because we don't link libraries with -lpthread but with -pthread (see pthreads(3) and the comment at the top of the aforementioned patch). The effect is that pthread is not recorded in the library itself. Under OpenBSD, you need to explicitely link the binary with -pthread if it requires pthread_* functions. So what you did first was good, that is just add -pthread to CFLAGS/LDFLAGS. -- Antoine