Building agains dynamic libptread in Debian Stable

Alejandro Perez Mendez alex at um.es
Mon Jul 9 13:34:03 EDT 2012


El 09/07/12 17:24, Greg Hudson escribió:
> On 07/09/2012 09:00 AM, Alejandro Perez Mendez wrote:> I have
> successfully compiled Kerberos in a Debian Stable. However, all
>> the binaries are not dynamically linked against pthread library. For
>> example:
> We use weak references such that we will call libpthread functions if
> it's linked into the address space, but won't drag it in ourselves.
> (See k5-thread.h, search for "Weak reference support".)

Thank you for the response. I'll check that file for further information.

>
>> I've seen that the pre-compiled Ubuntu packages are linked against
>> libpthread.so.
>  From what I can tell, this isn't true; however, the Ubuntu packages are
> linked against the system com_err library from ext2fs which is linked
> against libpthread.so.

Then that should be it. I just checked it with ldd, and libpthread were 
there.

>
>> I need it in order to be able to load a GSS mechanism
>> which requires this dependency to be satisfied (the mechanism is
>> mech_eap.so from project-moonshot).
> Isn't this just a matter of mech_eap.so needing libpthread as a dependency?

Well yes. But it also means that I have to change how krb5kdc is built 
(and maybe the kinit), so it includes pthread into the linking 
libraries, right? Something similar as what it is done in 
tests/gss-threads, where $(THREAD_LINKOPTS) are included as linking 
options. Otherwise, the KDC and kinit won't be able to provide the 
functions requested by mech_eap.so.

>
> Russ Allbery wrote:
>> You should normally not use -lpthread on Linux.  -pthread is the correct
>> flag.  However, that flag needs to be passed to the compiler during the
>> link phase as well as the compilation phase for all the correct things to
>> happen; maybe that's not happening for some reason?
> We use PTHREAD_CFLAGS (and thus -lpthread on Linux) when we link
> programs, but deliberately avoid it when linking shared libraries (per a
> comment in pre.in).

I'm talking of including -lpthread when linking programs. That is not 
currently done in my system, using Kerberos 1.10.2. At least for the 
krb5kdc, the gss-client and the gss-server programs.

Regards,
Alejandro


More information about the krbdev mailing list