glibc/signal
Joseph Myers 7553131847 Fix struct sigaltstack namespace (bug 21517).
glibc defines the stack_t type with the tag struct sigaltstack.  This
is not permitted by POSIX; sigaltstack is only reserved with file
scope in the namespace of ordinary identifiers, not the tag namespace,
and in the case where stack_t is obtained from ucontext.h rather than
signal.h, it's not reserved with file scope at all.

This patch removes the tag accordingly and updates uses in glibc of
struct sigaltstack.  This is similar to the removal of the "struct
siginfo" tag a few years ago: C++ name mangling changes are an
unavoidable consequence.  A NEWS item is added to note the changed
mangling.  There is inevitably some risk of breaking builds of
anything that relies on the struct sigaltstack name (though the first
few hits I looked at from codesearch.debian.net generally seemed to
involve code that could use the stack_t name conditionally, so
depending on how they determine the conditionals they may work with
glibc not defining the struct tag anyway).

Tested for x86_64 and x86, and with build-many-glibcs.py.

	[BZ #21517]
	* bits/types/stack_t.h (stack_t): Remove struct tag.
	* sysdeps/unix/sysv/linux/bits/types/stack_t.h (stack_t):
	Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/types/stack_t.h (stack_t):
	Likewise.
	* debug/segfault.c (install_handler): Use stack_t instead of
	struct sigaltstack.
	* hurd/hurd/signal.h (struct hurd_sigstate): Likewise.
	* hurd/trampoline.c (_hurd_setup_sighandler): Likewise.
	* include/signal.h (__sigaltstack): Likwise.
	* signal/sigaltstack.c (__sigaltstack): Likewise.
	* signal/signal.h (sigaltstack): Likewise.
	* sysdeps/mach/hurd/i386/signal-defines.sym
	(SIGALTSTACK__SS_SP__OFFSET): Likewise.
	(SIGALTSTACK__SS_SIZE__OFFSET): Likewise.
	(SIGALTSTACK__SS_FLAGS__OFFSET): Likewise.
	* sysdeps/mach/hurd/sigaltstack.c (__sigaltstack): Likewise.
	* sysdeps/mach/hurd/sigstack.c (sigstack): Likewise.
	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h (struct
	elf_prstatus): Likewise.
	* sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c (CHECK_SP):
	Likewise.
	* sysdeps/unix/sysv/linux/ia64/sys/procfs.h (struct elf_prstatus):
	Likewise.
	* sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c (CHECK_SP):
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/sys/procfs.h (struct
	elf_prstatus): Likewise.
	* sysdeps/unix/sysv/linux/sh/sys/procfs.h (struct elf_prstatus):
	Likewise.
	* sysdeps/unix/sysv/linux/sys/procfs.h (struct elf_prstatus):
	Likewise.
2017-06-05 10:17:46 +00:00
..
bits/types Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
sys
Makefile Add one more header to be installed, missed from previous patch. 2017-05-21 09:50:26 -04:00
Versions Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
allocrtsig.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
kill.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
killpg.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
raise.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigaction.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigaddset.c Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
sigaltstack.c Fix struct sigaltstack namespace (bug 21517). 2017-06-05 10:17:46 +00:00
sigandset.c Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
sigblock.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigdelset.c Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
sigempty.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigfillset.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
siggetmask.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sighold.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigignore.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigintr.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigisempty.c Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
sigismem.c Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
signal.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
signal.h Fix struct sigaltstack namespace (bug 21517). 2017-06-05 10:17:46 +00:00
sigorset.c Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
sigpause.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigpending.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigprocmask.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigqueue.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigrelse.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigreturn.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigset.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigsetmask.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigsetops.c Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
sigstack.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigsuspend.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigtimedwait.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigvec.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigwait.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigwaitinfo.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sysv_signal.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-raise.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-signal.c * malloc/memusagestat.c (main): Use return instead of exit to 2000-12-31 10:52:32 +00:00
tst-sigset.c 2003-03-31 Roland McGrath <roland@redhat.com> 2003-04-01 06:49:23 +00:00
tst-sigset2.c [BZ #1951] 2006-04-23 19:05:33 +00:00
tst-sigsimple.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00