From a4733812085f338dfcbb3f31b48747b00eb5c46c Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 14 Nov 2014 18:35:42 +0000 Subject: [PATCH] Only declare __sigpause in installed signal.h when necessary. This patch makes the installed signal.h declare __sigpause only when necessary (when a macro definition of sigpause makes use of __sigpause), rather than unconditionally. This fixes false positives in the linknamespace tests by making it visible to those tests that no use of ISO C functionality will actually bring in the definition of __sigpause and so bring in the other symbols defined in the same object. There is no bug filed in Bugzilla because this is fixing false positives rather than any user-visible bug. Tested for x86_64 (testsuite, and that installed stripped shared libraries are unchanged by this patch). * signal/signal.h (__sigpause): Only declare if [__USE_XOPEN && !__GNUC__]. * include/signal.h (__sigpause): Move declaration above call to libc_hidden_proto. * conform/Makefile (test-xfail-ISO/signal.h/linknamespace): Remove variable. (test-xfail-ISO99/signal.h/linknamespace): Likewise. (test-xfail-ISO11/signal.h/linknamespace): Likewise. --- ChangeLog | 11 +++++++++++ conform/Makefile | 3 --- include/signal.h | 2 +- signal/signal.h | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d3f8cb..a5f2fac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2014-11-14 Joseph Myers + + * signal/signal.h (__sigpause): Only declare if [__USE_XOPEN && + !__GNUC__]. + * include/signal.h (__sigpause): Move declaration above call to + libc_hidden_proto. + * conform/Makefile (test-xfail-ISO/signal.h/linknamespace): Remove + variable. + (test-xfail-ISO99/signal.h/linknamespace): Likewise. + (test-xfail-ISO11/signal.h/linknamespace): Likewise. + 2014-11-14 David S. Miller * sysdeps/sparc/sparc64/rtld-memcpy.c (NO_MEMPCPY_STPCPY_REDIRECT): diff --git a/conform/Makefile b/conform/Makefile index 45917a6..b2806b1 100644 --- a/conform/Makefile +++ b/conform/Makefile @@ -326,19 +326,16 @@ test-xfail-XOPEN2K8/ndbm.h/linknamespace = yes # Unsorted expected failures. test-xfail-ISO/math.h/linknamespace = yes -test-xfail-ISO/signal.h/linknamespace = yes test-xfail-ISO/stdio.h/linknamespace = yes test-xfail-ISO/time.h/linknamespace = yes test-xfail-ISO99/complex.h/linknamespace = yes test-xfail-ISO99/ctype.h/linknamespace = yes test-xfail-ISO99/math.h/linknamespace = yes -test-xfail-ISO99/signal.h/linknamespace = yes test-xfail-ISO99/stdio.h/linknamespace = yes test-xfail-ISO99/tgmath.h/linknamespace = yes test-xfail-ISO11/complex.h/linknamespace = yes test-xfail-ISO11/ctype.h/linknamespace = yes test-xfail-ISO11/math.h/linknamespace = yes -test-xfail-ISO11/signal.h/linknamespace = yes test-xfail-ISO11/stdio.h/linknamespace = yes test-xfail-ISO11/tgmath.h/linknamespace = yes test-xfail-XPG3/ctype.h/linknamespace = yes diff --git a/include/signal.h b/include/signal.h index 16a7a42..f7a9de0 100644 --- a/include/signal.h +++ b/include/signal.h @@ -10,6 +10,7 @@ libc_hidden_proto (sigfillset) libc_hidden_proto (sigaddset) libc_hidden_proto (sigdelset) libc_hidden_proto (sigismember) +extern int __sigpause (int sig_or_mask, int is_sig); libc_hidden_proto (__sigpause) libc_hidden_proto (raise) libc_hidden_proto (__libc_current_sigrtmin) @@ -49,7 +50,6 @@ extern int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact); libc_hidden_proto (__libc_sigaction) -extern int __sigpause (int sig_or_mask, int is_sig); extern int __default_sigpause (int mask); extern int __xpg_sigpause (int sig); diff --git a/signal/signal.h b/signal/signal.h index fe9fd78..f1bbad0 100644 --- a/signal/signal.h +++ b/signal/signal.h @@ -164,12 +164,12 @@ extern void psiginfo (const siginfo_t *__pinfo, const char *__s); This function is a cancellation point and therefore not marked with __THROW. */ -extern int __sigpause (int __sig_or_mask, int __is_sig); #ifdef __USE_XOPEN # ifdef __GNUC__ extern int sigpause (int __sig) __asm__ ("__xpg_sigpause"); # else +extern int __sigpause (int __sig_or_mask, int __is_sig); /* Remove a signal from the signal mask and suspend the process. */ # define sigpause(sig) __sigpause ((sig), 1) # endif -- 2.7.4