From 7ef17790432ea0d08f19b71e642b4be879a66710 Mon Sep 17 00:00:00 2001 From: Petr Ovtchenkov Date: Fri, 4 Aug 2017 00:50:27 +0300 Subject: [PATCH] struct tags removed in glibc 2.26 Some struct tags are removed where the structs also have *_t typedef names. This concern struct ucontext (ucontext_t) and struct sigaltstack (stack_t). See commit d57cb31910ca5c200e4172276749a7f8bd17ae3c Author: Joseph Myers Date: Wed Jun 28 10:33:23 2017 +0000 Miscellaneous sys/ucontext.h namespace fixes (bug 21457). commit 251287734e89a52da3db682a8241eb6bccc050c9 Author: Joseph Myers Date: Mon Jun 26 22:03:58 2017 +0000 Rename struct ucontext tag (bug 21457). in glibc. --- libgcc/config/aarch64/linux-unwind.h | 2 +- libgcc/config/alpha/linux-unwind.h | 2 +- libgcc/config/bfin/linux-unwind.h | 2 +- libgcc/config/i386/linux-unwind.h | 4 ++-- libgcc/config/m68k/linux-unwind.h | 2 +- libgcc/config/mips/linux-unwind.h | 2 +- libgcc/config/nios2/linux-unwind.h | 2 +- libgcc/config/pa/linux-unwind.h | 2 +- libgcc/config/sh/linux-unwind.h | 4 ++-- libgcc/config/tilepro/linux-unwind.h | 2 +- libgcc/config/xtensa/linux-unwind.h | 2 +- libjava/include/i386-signal.h | 2 +- libjava/include/s390-signal.h | 2 +- libjava/include/sh-signal.h | 2 +- libjava/include/x86_64-signal.h | 2 +- libsanitizer/sanitizer_common/sanitizer_linux.cc | 4 ++-- libsanitizer/sanitizer_common/sanitizer_linux.h | 6 +++--- .../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | 2 +- libsanitizer/tsan/tsan_interceptors.cc | 5 ----- 19 files changed, 23 insertions(+), 28 deletions(-) diff --git a/libgcc/config/aarch64/linux-unwind.h b/libgcc/config/aarch64/linux-unwind.h index 4512efb..06de45a 100644 --- a/libgcc/config/aarch64/linux-unwind.h +++ b/libgcc/config/aarch64/linux-unwind.h @@ -52,7 +52,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context *context, struct rt_sigframe { siginfo_t info; - struct ucontext uc; + ucontext_t uc; }; struct rt_sigframe *rt_; diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h index bdbba4a..e84812e 100644 --- a/libgcc/config/alpha/linux-unwind.h +++ b/libgcc/config/alpha/linux-unwind.h @@ -51,7 +51,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context, { struct rt_sigframe { siginfo_t info; - struct ucontext uc; + ucontext_t uc; } *rt_ = context->cfa; sc = &rt_->uc.uc_mcontext; } diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h index 77b7c23..8bf5e82 100644 --- a/libgcc/config/bfin/linux-unwind.h +++ b/libgcc/config/bfin/linux-unwind.h @@ -52,7 +52,7 @@ bfin_fallback_frame_state (struct _Unwind_Context *context, void *puc; char retcode[8]; siginfo_t info; - struct ucontext uc; + ucontext_t uc; } *rt_ = context->cfa; /* The void * cast is necessary to avoid an aliasing warning. diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h index 540a0a2..29efbe3 100644 --- a/libgcc/config/i386/linux-unwind.h +++ b/libgcc/config/i386/linux-unwind.h @@ -58,7 +58,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context, if (*(unsigned char *)(pc+0) == 0x48 && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL) { - struct ucontext *uc_ = context->cfa; + ucontext_t *uc_ = context->cfa; /* The void * cast is necessary to avoid an aliasing warning. The aliasing warning is correct, but should not be a problem because it does not alias anything. */ @@ -138,7 +138,7 @@ x86_fallback_frame_state (struct _Unwind_Context *context, siginfo_t *pinfo; void *puc; siginfo_t info; - struct ucontext uc; + ucontext_t uc; } *rt_ = context->cfa; /* The void * cast is necessary to avoid an aliasing warning. The aliasing warning is correct, but should not be a problem diff --git a/libgcc/config/m68k/linux-unwind.h b/libgcc/config/m68k/linux-unwind.h index 75b7cf7..3adbca6 100644 --- a/libgcc/config/m68k/linux-unwind.h +++ b/libgcc/config/m68k/linux-unwind.h @@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* is unfortunately broken right now. */ struct uw_ucontext { unsigned long uc_flags; - struct ucontext *uc_link; + ucontext_t *uc_link; stack_t uc_stack; mcontext_t uc_mcontext; unsigned long uc_filler[80]; diff --git a/libgcc/config/mips/linux-unwind.h b/libgcc/config/mips/linux-unwind.h index bf12de5..4a16031 100644 --- a/libgcc/config/mips/linux-unwind.h +++ b/libgcc/config/mips/linux-unwind.h @@ -31,7 +31,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* The third parameter to the signal handler points to something with * this structure defined in asm/ucontext.h, but the name clashes with - * struct ucontext from sys/ucontext.h so this private copy is used. */ + * ucontext_t from sys/ucontext.h so this private copy is used. */ typedef struct _sig_ucontext { unsigned long uc_flags; struct _sig_ucontext *uc_link; diff --git a/libgcc/config/nios2/linux-unwind.h b/libgcc/config/nios2/linux-unwind.h index 2304142..9396ce6 100644 --- a/libgcc/config/nios2/linux-unwind.h +++ b/libgcc/config/nios2/linux-unwind.h @@ -38,7 +38,7 @@ struct nios2_mcontext { struct nios2_ucontext { unsigned long uc_flags; - struct ucontext *uc_link; + ucontext_t *uc_link; stack_t uc_stack; struct nios2_mcontext uc_mcontext; sigset_t uc_sigmask; /* mask last for extensibility */ diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h index 9a2657f..e47493d 100644 --- a/libgcc/config/pa/linux-unwind.h +++ b/libgcc/config/pa/linux-unwind.h @@ -80,7 +80,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context, struct sigcontext *sc; struct rt_sigframe { siginfo_t info; - struct ucontext uc; + ucontext_t uc; } *frame; /* rt_sigreturn trampoline: diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h index e389cac..7a0c6c6 100644 --- a/libgcc/config/sh/linux-unwind.h +++ b/libgcc/config/sh/linux-unwind.h @@ -83,7 +83,7 @@ shmedia_fallback_frame_state (struct _Unwind_Context *context, siginfo_t *pinfo; void *puc; siginfo_t info; - struct ucontext uc; + ucontext_t uc; } *rt_ = context->cfa; /* The void * cast is necessary to avoid an aliasing warning. The aliasing warning is correct, but should not be a problem @@ -180,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context, { struct rt_sigframe { siginfo_t info; - struct ucontext uc; + ucontext_t uc; } *rt_ = context->cfa; /* The void * cast is necessary to avoid an aliasing warning. The aliasing warning is correct, but should not be a problem diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h index 796e976..75f8890 100644 --- a/libgcc/config/tilepro/linux-unwind.h +++ b/libgcc/config/tilepro/linux-unwind.h @@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context, struct rt_sigframe { unsigned char save_area[C_ABI_SAVE_AREA_SIZE]; siginfo_t info; - struct ucontext uc; + ucontext_t uc; } *rt_; /* Return if this is not a signal handler. */ diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h index 9872492..586a9d4 100644 --- a/libgcc/config/xtensa/linux-unwind.h +++ b/libgcc/config/xtensa/linux-unwind.h @@ -67,7 +67,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context, struct rt_sigframe { siginfo_t info; - struct ucontext uc; + ucontext_t uc; } *rt_; /* movi a2, __NR_rt_sigreturn; syscall */ diff --git a/libjava/include/i386-signal.h b/libjava/include/i386-signal.h index c2409b0..5268fa1 100644 --- a/libjava/include/i386-signal.h +++ b/libjava/include/i386-signal.h @@ -29,7 +29,7 @@ static void _Jv_##_name (int, siginfo_t *, \ #define HANDLE_DIVIDE_OVERFLOW \ do \ { \ - struct ucontext *_uc = (struct ucontext *)_p; \ + ucontext_t *_uc = (ucontext_t *)_p; \ gregset_t &_gregs = _uc->uc_mcontext.gregs; \ unsigned char *_eip = (unsigned char *)_gregs[REG_EIP]; \ \ diff --git a/libjava/include/s390-signal.h b/libjava/include/s390-signal.h index 4ca4c10..9261b52 100644 --- a/libjava/include/s390-signal.h +++ b/libjava/include/s390-signal.h @@ -51,7 +51,7 @@ do \ struct \ { \ unsigned long int uc_flags; \ - struct ucontext *uc_link; \ + ucontext_t *uc_link; \ stack_t uc_stack; \ mcontext_t uc_mcontext; \ unsigned long sigmask[2]; \ diff --git a/libjava/include/sh-signal.h b/libjava/include/sh-signal.h index 3a96ce2..e400ff5 100644 --- a/libjava/include/sh-signal.h +++ b/libjava/include/sh-signal.h @@ -21,7 +21,7 @@ details. */ /* The third parameter to the signal handler points to something with * this structure defined in asm/ucontext.h, but the name clashes with - * struct ucontext from sys/ucontext.h so this private copy is used. */ + * ucontext_t from sys/ucontext.h so this private copy is used. */ typedef struct _sig_ucontext { unsigned long uc_flags; struct _sig_ucontext *uc_link; diff --git a/libjava/include/x86_64-signal.h b/libjava/include/x86_64-signal.h index 12383b5..d20fcb5 100644 --- a/libjava/include/x86_64-signal.h +++ b/libjava/include/x86_64-signal.h @@ -28,7 +28,7 @@ static void _Jv_##_name (int, siginfo_t *, \ #define HANDLE_DIVIDE_OVERFLOW \ do \ { \ - struct ucontext *_uc = (struct ucontext *)_p; \ + ucontext_t *_uc = (struct ucontext *)_p; \ gregset_t &_gregs = _uc->uc_mcontext.gregs; \ unsigned char *_rip = (unsigned char *)_gregs[REG_RIP]; \ \ diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc index 2cefa20..4acefde 100644 --- a/libsanitizer/sanitizer_common/sanitizer_linux.cc +++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc @@ -546,8 +546,8 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) { } #endif -uptr internal_sigaltstack(const struct sigaltstack *ss, - struct sigaltstack *oss) { +uptr internal_sigaltstack(const stack_t *ss, + stack_t *oss) { return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss); } diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.h b/libsanitizer/sanitizer_common/sanitizer_linux.h index 4497702..3b6b9cc 100644 --- a/libsanitizer/sanitizer_common/sanitizer_linux.h +++ b/libsanitizer/sanitizer_common/sanitizer_linux.h @@ -17,9 +17,9 @@ #include "sanitizer_internal_defs.h" #include "sanitizer_posix.h" #include "sanitizer_platform_limits_posix.h" +#include struct link_map; // Opaque type returned by dlopen(). -struct sigaltstack; namespace __sanitizer { // Dirent structure for getdents(). Note that this structure is different from @@ -28,8 +28,8 @@ struct linux_dirent; // Syscall wrappers. uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count); -uptr internal_sigaltstack(const struct sigaltstack* ss, - struct sigaltstack* oss); +uptr internal_sigaltstack(const stack_t* ss, + stack_t* oss); uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set, __sanitizer_sigset_t *oldset); void internal_sigfillset(__sanitizer_sigset_t *set); diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc index c919e4f..014162af 100644 --- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc +++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc @@ -267,7 +267,7 @@ static int TracerThread(void* argument) { // Alternate stack for signal handling. InternalScopedBuffer handler_stack_memory(kHandlerStackSize); - struct sigaltstack handler_stack; + stack_t handler_stack; internal_memset(&handler_stack, 0, sizeof(handler_stack)); handler_stack.ss_sp = handler_stack_memory.data(); handler_stack.ss_size = kHandlerStackSize; diff --git a/libsanitizer/tsan/tsan_interceptors.cc b/libsanitizer/tsan/tsan_interceptors.cc index 0c71c00..be192f5 100644 --- a/libsanitizer/tsan/tsan_interceptors.cc +++ b/libsanitizer/tsan/tsan_interceptors.cc @@ -70,11 +70,6 @@ struct my_siginfo_t { struct ucontext_t { u64 opaque[768 / sizeof(u64) + 1]; }; -#else -struct ucontext_t { - // The size is determined by looking at sizeof of real ucontext_t on linux. - u64 opaque[936 / sizeof(u64) + 1]; -}; #endif #if defined(__x86_64__) || defined(__mips__) -- 2.10.1