uClibc-0.9.33: ARM NPTL static link failure with sigprocmask vs. setjmp

Johannes Stezenbach js at sig21.net
Mon Feb 20 22:00:44 UTC 2012


On Tue, Feb 21, 2012 at 12:11:37AM +0800, Tony Wu wrote:
> 
> The sigaction, sigprocmask, and sigfillset static link issue has
> already been addressed in the future branch back in Apr. 2011, but the
> future branch is not merged yet.
> 
> Until then, you can try to cherry-pick the following patches manually.
> 8ab3145f396eb35d15466b0666270ba8dad69da5
> aed47156856366c6aaf29a54e68fed39733f6bce

With those patches applied to uClibc-0.9.33 my application
linked successfully. (I cannot test if it runs atm, though.)

Attached are the patches refreshed so they apply to uClibc-0.9.33.


Thanks,
Johannnes
-------------- next part --------------
commit 8ab3145f396eb35d15466b0666270ba8dad69da5
Author: Austin Foxley <austinf at cetoncorp.com>
Date:   Fri Apr 22 15:06:18 2011 -0700

    nptl: remove sigaction, sigprocmask, and sigfillset from libpthread
    
    Having them defined in both places was causing errors with static linking
    
    Signed-off-by: Austin Foxley <austinf at cetoncorp.com>

---
 libpthread/nptl/sysdeps/pthread/Makefile.in |   27 ++-------------------------
 1 file changed, 2 insertions(+), 25 deletions(-)

--- uClibc-0.9.33.orig/libpthread/nptl/sysdeps/pthread/Makefile.in	2012-02-01 22:21:04.000000000 +0100
+++ uClibc-0.9.33/libpthread/nptl/sysdeps/pthread/Makefile.in	2012-02-20 19:55:03.000000000 +0100
@@ -33,17 +33,12 @@ libpthread_pthread_CSRC = \
 	pthread_spin_init.c \
 	pthread_spin_unlock.c \
 	pt-longjmp.c \
-	pt-sigaction.c \
-	pt-sigfillset.c \
-	pt-sigprocmask.c \
 	tpp.c
 CFLAGS-pthread = $(SSP_ALL_CFLAGS) -DNOT_IN_libc -DIS_IN_libpthread
 CFLAGS-pthread_barrier_wait.c = -D_GNU_SOURCE
 CFLAGS-pthread_spin_destroy.c = -D_GNU_SOURCE
 CFLAGS-pthread_spin_init.c = -D_GNU_SOURCE
 CFLAGS-pthread_spin_unlock.c = -D_GNU_SOURCE
-CFLAGS-pt-sigfillset.c = -I$(top_srcdir)libc/signal
-CFLAGS-pt-sigprocmask.c = -I$(top_srcdir)libc/sysdeps/linux/common
 CFLAGS-unwind-forcedunwind.c = -fexceptions -fasynchronous-unwind-tables
 
 CFLAGS-OMIT-librt-cancellation.c = -DIS_IN_libpthread
@@ -53,8 +48,7 @@ CFLAGS-librt-cancellation.c = -DIS_IN_li
 CFLAGS-rt-unwind-resume.c = -DIS_IN_librt				\
 			    -fexceptions -fasynchronous-unwind-tables
 
-libpthread-so-y += $(patsubst %,$(libpthread_pthread_OUT)/%.oS, \
-	pt-sigaction pt-sigprocmask unwind-forcedunwind)
+libpthread-so-y += $(patsubst %,$(libpthread_pthread_OUT)/%.oS, unwind-forcedunwind)
 
 librt-pt-routines-y = librt-cancellation.c
 librt-pt-shared-only-routines-y = rt-unwind-resume.c
@@ -104,26 +98,9 @@ $(libpthread_pthread_OUT)/pt-crtn.S: $(l
 		-e '/@TRAILER_BEGINS/,$$p' $< > $@.tmp
 	$(Q)mv $@.tmp $@
 endif
-# It would have been easier to just add dummy files that include the real
-# impl, but ok.
-# Special rules needed since we do objdir->objdir compilation for these 3.
-# First symlink them, then build them. Rob would freak out on these. Sheesh! ;)
-pthread-lc-fwd = sigfillset sigprocmask
-$(patsubst %,$(libpthread_pthread_OUT)/pt-%.c,$(pthread-lc-fwd)): | $(libpthread_pthread_OUT)
-	$(do_ln) $(call rel_srcdir)$(patsubst pt-%,$(libpthread_pthread_DIR)/%,$(@F)) $@
-$(patsubst %,$(libpthread_pthread_OUT)/pt-%.oS,$(pthread-lc-fwd)): $(libpthread_pthread_OUT)/pt-%.oS: $(libpthread_pthread_OUT)/pt-%.c
-	$(compile.c)
-$(patsubst %,$(libpthread_pthread_OUT)/pt-%.o,$(pthread-lc-fwd)): $(libpthread_pthread_OUT)/pt-%.o: $(libpthread_pthread_OUT)/pt-%.c
-	$(compile.c)
-ifeq ($(DOPIC),y)
-$(patsubst %,$(libpthread_pthread_OUT)/pt-%.os,$(pthread-lc-fwd)): $(libpthread_pthread_OUT)/pt-%.os: $(libpthread_pthread_OUT)/pt-%.c
-	$(compile.c)
-endif
 
 objclean-y += CLEAN_libpthread/nptl/sysdeps/pthread
 
 CLEAN_libpthread/nptl/sysdeps/pthread:
 	$(do_rm) $(addprefix $(libpthread_pthread_OUT)/*., o os oS s S) \
-		$(libpthread_pthread_OUT)/defs.h \
-		$(addprefix $(libpthread_pthread_DIR)/, \
-			pt-sigfillset.c pt-sigprocmask.c)
+		$(libpthread_pthread_OUT)/defs.h
-------------- next part --------------
commit aed47156856366c6aaf29a54e68fed39733f6bce
Author: Peter S. Mazinger <ps.m at gmx.net>
Date:   Thu May 12 23:47:00 2011 +0200

    include pthreadP.h for SIGCANCEL
    
    based on a patch from Kevin Cernekee <cernekee at gmail.com>
    
    Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>

---
 libc/signal/sigfillset.c                      |    3 +++
 libc/sysdeps/linux/c6x/sigaction.c            |    3 +++
 libc/sysdeps/linux/common/__rt_sigtimedwait.c |    1 +
 libc/sysdeps/linux/common/sigprocmask.c       |    3 +++
 4 files changed, 10 insertions(+)

--- uClibc-0.9.33.orig/libc/signal/sigfillset.c	2012-02-01 22:21:04.000000000 +0100
+++ uClibc-0.9.33/libc/signal/sigfillset.c	2012-02-20 19:50:28.000000000 +0100
@@ -19,6 +19,9 @@
 #include <errno.h>
 #include <signal.h>
 #include <string.h>
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+# include <pthreadP.h>	/* SIGCANCEL */
+#endif
 
 
 /* Set all signals in SET.  */
--- uClibc-0.9.33.orig/libc/sysdeps/linux/c6x/sigaction.c	2012-02-01 22:21:04.000000000 +0100
+++ uClibc-0.9.33/libc/sysdeps/linux/c6x/sigaction.c	2012-02-20 19:49:25.000000000 +0100
@@ -28,6 +28,9 @@
 #include <string.h>
 #include <sys/syscall.h>
 #include <bits/kernel_sigaction.h>
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+# include <pthreadP.h>	/* SIGCANCEL */
+#endif
 
 #define SA_RESTORER	0x04000000
 
--- uClibc-0.9.33.orig/libc/sysdeps/linux/common/__rt_sigtimedwait.c	2012-02-01 22:21:04.000000000 +0100
+++ uClibc-0.9.33/libc/sysdeps/linux/common/__rt_sigtimedwait.c	2012-02-20 19:51:28.000000000 +0100
@@ -16,6 +16,7 @@
 
 # ifdef __UCLIBC_HAS_THREADS_NATIVE__
 #  include <sysdep-cancel.h>
+#  include <pthreadP.h>	/* SIGCANCEL */
 
 static int do_sigtimedwait(const sigset_t *set, siginfo_t *info,
 						   const struct timespec *timeout)
--- uClibc-0.9.33.orig/libc/sysdeps/linux/common/sigprocmask.c	2012-02-01 22:21:04.000000000 +0100
+++ uClibc-0.9.33/libc/sysdeps/linux/common/sigprocmask.c	2012-02-20 19:49:25.000000000 +0100
@@ -11,6 +11,9 @@
 
 #if defined __USE_POSIX
 #include <signal.h>
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+# include <pthreadP.h>	/* SIGCANCEL */
+#endif
 
 #undef sigprocmask
 


More information about the uClibc mailing list