This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #15337] Fix static build when configured with --disable-hidden-plt
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: libc-alpha at sourceware dot org, L A Walsh <glibc at tlinx dot org>
- Date: Thu, 04 Apr 2013 09:31:02 -0400
- Subject: Re: [PATCH][BZ #15337] Fix static build when configured with --disable-hidden-plt
- References: <20130404040854 dot GB14860 at spoyarek dot pnq dot redhat dot com>
On 04/04/2013 12:08 AM, Siddhesh Poyarekar wrote:
> Hi,
>
> Static builds fail with the following warning:
>
> /home/tools/glibc/glibc/nptl/../nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S:80:
> undefined reference to `__GI___pthread_unwind'
>
> When the source is configured with --disable-hidden-plt. This is
> because the preprocessor conditional in cancellation.S only checks if
> the build is for SHARED, whereas hidden_def is defined appropriately
> only for a SHARED build that will have symbol versioning *and* hidden
> defs are enabled. The last case is false here.
>
> Attached patch matches up the condition with that in libc-symbols.h.
> Tested x86_64 and x86_64 static builds to verify that this works fine.
> OK to commit?
>
> [BZ #15337]
> * nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
> [IS_IN_libpthread]
> [SHARED && defined DO_VERSIONING && !defined NO_HIDDEN]: Mark
> __pthread_unwind hidden.
>
> diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S b/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
> index b284572..2cc84c1 100644
> --- a/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
> +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
> @@ -22,7 +22,7 @@
> #include "lowlevellock.h"
>
> #ifdef IS_IN_libpthread
> -# ifdef SHARED
> +# if defined SHARED && defined DO_VERSIONING && !defined NO_HIDDEN
> # define __pthread_unwind __GI___pthread_unwind
> # endif
> #else
Looks good to me.
Cheers,
Carlos.