Building agains dynamic libptread in Debian Stable

Greg Hudson ghudson at MIT.EDU
Mon Jul 9 12:24:07 EDT 2012

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".)

> I've seen that the pre-compiled Ubuntu packages are linked against

>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

> I need it in order to be able to load a GSS mechanism
> which requires this dependency to be satisfied (the mechanism is
> from project-moonshot).

Isn't this just a matter of needing libpthread as a dependency?

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

More information about the krbdev mailing list