On Mon, Feb 16, 2009 at 09:06:25AM -0800, patrick keshishian wrote:
> man cc
> /-pthread
> nn
> 
>        -pthreads
>            Add support for multithreading using the POSIX threads
>            library.  This option sets flags for both the
>            preprocessor and linker.  This option does not affect
>            the thread safety of object code produced  by the
>            compiler or that of libraries supplied with it.
> 

that doesn't answer the questions.

> 
> On Mon, Feb 16, 2009 at 5:32 AM, cnav <[email protected]> wrote:
> > Hi,
> >
> > I just applied following patch:
> > http://cnav.pl/clamav-configure.patch
> >
> > to clamav sources. And after that libclamav seems to work with pthreads.
> > ldd /usr/local/lib/libclamav.so.5.4
> > /usr/local/lib/libclamav.so.5.4:
> >        Start    End      Type Open Ref GrpRef Name
> >        084ef000 28522000 dlib 1    0   0 /usr/local/lib/libclamav.so.5.4
> >        0d4b9000 2d4bd000 rlib 0    1   0
> > /usr/local/lib/libclamunrar_iface.so.5.4
> >        010a0000 210a5000 rlib 0    2   0 /usr/local/lib/libclamunrar.so.5.4
> >        06d89000 26d8d000 rlib 0    1   0 /usr/local/lib/libbz2.so.10.4
> >        091a8000 291af000 rlib 0    1   0      /usr/local/lib/libgmp.so.7.1
> >        0a04b000 2a12a000 rlib 0    1   0 /usr/local/lib/libiconv.so.5.0
> >        02484000 2248d000 rlib 0    1   0      /usr/lib/libpthread.so.11.0
> >        05a7c000 25a84000 rlib 0    3   0      /usr/lib/libz.so.4.1
> >
> > Manuals says to use -pthread.
> > http://www.openbsd.org/cgi-bin/man.cgi?query=pthreads&sektion=3
> >
> > My question are:
> > What is the difference between those two libs ?
> > And why with -lpthread it's working and without not?

-pthread won't link libpthread into shared objects, while -lpthread
will.  use -pthread when linking the executables that will load
libclamav.

-- 
[email protected]
SDF Public Access UNIX System - http://sdf.lonestar.org

Reply via email to