glibc build error: linking nptl static - V2.17

Carlos O'Donell
Tue Apr 2 14:19:00 GMT 2013

On Mon, Apr 1, 2013 at 10:36 PM, L A Walsh <> wrote:
> I'm getting an undefined reference when trying to build a static version
> of glibc for standalone/rescue tool building but am getting the following
> link error:
> /home/tools/glibc/glibc/nptl/../nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S:80:
> undefined reference to `__GI___pthread_unwind'

Unfortunately this isn't a very well tested configuration.

You have two options:

(a) Roll up your sleeves and get dirty and find out why you have an
undefined reference to a "global library-internal function".

My first guess is this:

#ifdef IS_IN_libpthread
# ifdef SHARED
#  define __pthread_unwind __GI___pthread_unwind
# endif
# ifndef SHARED
        .weak __pthread_unwind
# endif

You can pretty easily see that it has no conditional for !SHARED (or
static) when building within libpthread.

Until you fix this it won't work.

(b) Back off on some of the configure flags you are using.

You can still link statically without those flags, but some cases
might load libraries.


More information about the Libc-help mailing list