bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lock module question


From: Yoann Vandoorselaere
Subject: Re: lock module question
Date: Thu, 06 Mar 2008 20:21:15 +0100

Le mercredi 05 mars 2008 à 18:06 +0100, Bruno Haible a écrit :
> Yoann Vandoorselaere asked:
> > Is it expected that the lock module does not set the -pthread CFLAGS
> > when compiling with GCC on a Linux architecture?
> 
> Yes it is normal. The module description has this, and gnulib-tool echoes it:
> 
>   Link:
>   $(LTLIBTHREAD) when linking with libtool, $(LIBTHREAD) otherwise
> 
> You have to use this Makefile variable for linking those programs which need
> it. Putting it into CFLAGS would have the effect to link _all_ programs with
> the thread libraries, which is not desirable.
> 
> > Using -pthread allow option like -D_REENTRANT to be defined when
> > compiling Gnulib, which sound like a requirement if the program using
> > Gnulib is multithreaded.
> 
> Neither -pthread nor -D_REENTRANT is a requirement for building multithreaded
> programs on Linux with glibc.

Can you confirm the validity of this statement for the old linuxthread
implementation? I recall having problem with it when not enabling the
appropriate CFLAGS.

> On platforms where it is needed (OSF/1 and Solaris), the 'lock' module adds
> -D_REENTRANT to the CPPFLAGS. Make sure to use both CFLAGS and CPPFLAGS in
> your compilation commands; these is automatically done if you use automake.

Thanks for the clarification! I guess this also answer Simon concern:
GnuTLS should probably compile with the appropriate pthread CFLAGS on
platform where it is a requirement in order for the library to be used
by a multithread application.

-- 
Yoann Vandoorselaere | Responsable R&D / CTO | PreludeIDS Technologies
Tel: +33 (0)8 70 70 21 58                  Fax: +33(0)4 78 42 21 58
http://www.prelude-ids.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]