This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH][BZ #15337] Fix static build when configured with --disable-hidden-plt
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: libc-alpha at sourceware dot org
- Cc: L A Walsh <glibc at tlinx dot org>
- Date: Thu, 4 Apr 2013 09:38:54 +0530
- Subject: [PATCH][BZ #15337] Fix static build when configured with --disable-hidden-plt
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