943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. From c287e88cc3743bfa7e5719bc4dee327aa3950051 Mon Sep 17 00:00:00 2001
  2. From: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
  3. Date: Tue, 4 Jul 2017 10:25:10 +0000
  4. Subject: [PATCH] Use ucontext_t not struct ucontext in linux-unwind.h files.
  5. Current glibc no longer gives the ucontext_t type the tag struct
  6. ucontext, to conform with POSIX namespace rules. This requires
  7. various linux-unwind.h files in libgcc, that were previously using
  8. struct ucontext, to be fixed to use ucontext_t instead. This is
  9. similar to the removal of the struct siginfo tag from siginfo_t some
  10. years ago.
  11. This patch changes those files to use ucontext_t instead. As the
  12. standard name that should be unconditionally safe, so this is not
  13. restricted to architectures supported by glibc, or conditioned on the
  14. glibc version.
  15. Tested compilation together with current glibc with glibc's
  16. build-many-glibcs.py.
  17. * config/aarch64/linux-unwind.h (aarch64_fallback_frame_state),
  18. config/alpha/linux-unwind.h (alpha_fallback_frame_state),
  19. config/bfin/linux-unwind.h (bfin_fallback_frame_state),
  20. config/i386/linux-unwind.h (x86_64_fallback_frame_state,
  21. x86_fallback_frame_state), config/m68k/linux-unwind.h (struct
  22. uw_ucontext), config/nios2/linux-unwind.h (struct nios2_ucontext),
  23. config/pa/linux-unwind.h (pa32_fallback_frame_state),
  24. config/sh/linux-unwind.h (sh_fallback_frame_state),
  25. config/tilepro/linux-unwind.h (tile_fallback_frame_state),
  26. config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Use
  27. ucontext_t instead of struct ucontext.
  28. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@249958 138bc75d-0d04-0410-961f-82ee72b054a4
  29. (cherry picked from commit ecf0d1a107133c715763940c2b197aa814710e1b)
  30. [Romain rebase on 5.4]
  31. Signed-off-by: Romain Naour <romain.naour@gmail.com>
  32. ---
  33. libgcc/config/aarch64/linux-unwind.h | 2 +-
  34. libgcc/config/alpha/linux-unwind.h | 2 +-
  35. libgcc/config/bfin/linux-unwind.h | 2 +-
  36. libgcc/config/i386/linux-unwind.h | 4 ++--
  37. libgcc/config/m68k/linux-unwind.h | 2 +-
  38. libgcc/config/nios2/linux-unwind.h | 2 +-
  39. libgcc/config/pa/linux-unwind.h | 2 +-
  40. libgcc/config/sh/linux-unwind.h | 2 +-
  41. libgcc/config/tilepro/linux-unwind.h | 2 +-
  42. libgcc/config/xtensa/linux-unwind.h | 2 +-
  43. 10 files changed, 11 insertions(+), 11 deletions(-)
  44. diff --git a/libgcc/config/aarch64/linux-unwind.h b/libgcc/config/aarch64/linux-unwind.h
  45. index 86d17b1..909f68f 100644
  46. --- a/libgcc/config/aarch64/linux-unwind.h
  47. +++ b/libgcc/config/aarch64/linux-unwind.h
  48. @@ -52,7 +52,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context *context,
  49. struct rt_sigframe
  50. {
  51. siginfo_t info;
  52. - struct ucontext uc;
  53. + ucontext_t uc;
  54. };
  55. struct rt_sigframe *rt_;
  56. diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h
  57. index d65474f..9a226b1 100644
  58. --- a/libgcc/config/alpha/linux-unwind.h
  59. +++ b/libgcc/config/alpha/linux-unwind.h
  60. @@ -51,7 +51,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
  61. {
  62. struct rt_sigframe {
  63. siginfo_t info;
  64. - struct ucontext uc;
  65. + ucontext_t uc;
  66. } *rt_ = context->cfa;
  67. sc = &rt_->uc.uc_mcontext;
  68. }
  69. diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h
  70. index 0c270e4..7fa95d2 100644
  71. --- a/libgcc/config/bfin/linux-unwind.h
  72. +++ b/libgcc/config/bfin/linux-unwind.h
  73. @@ -52,7 +52,7 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
  74. void *puc;
  75. char retcode[8];
  76. siginfo_t info;
  77. - struct ucontext uc;
  78. + ucontext_t uc;
  79. } *rt_ = context->cfa;
  80. /* The void * cast is necessary to avoid an aliasing warning.
  81. diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h
  82. index e54bf73..d35fc45 100644
  83. --- a/libgcc/config/i386/linux-unwind.h
  84. +++ b/libgcc/config/i386/linux-unwind.h
  85. @@ -58,7 +58,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context,
  86. if (*(unsigned char *)(pc+0) == 0x48
  87. && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
  88. {
  89. - struct ucontext *uc_ = context->cfa;
  90. + ucontext_t *uc_ = context->cfa;
  91. /* The void * cast is necessary to avoid an aliasing warning.
  92. The aliasing warning is correct, but should not be a problem
  93. because it does not alias anything. */
  94. @@ -138,7 +138,7 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
  95. siginfo_t *pinfo;
  96. void *puc;
  97. siginfo_t info;
  98. - struct ucontext uc;
  99. + ucontext_t uc;
  100. } *rt_ = context->cfa;
  101. /* The void * cast is necessary to avoid an aliasing warning.
  102. The aliasing warning is correct, but should not be a problem
  103. diff --git a/libgcc/config/m68k/linux-unwind.h b/libgcc/config/m68k/linux-unwind.h
  104. index fb79a4d..b2f5ea4 100644
  105. --- a/libgcc/config/m68k/linux-unwind.h
  106. +++ b/libgcc/config/m68k/linux-unwind.h
  107. @@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  108. /* <sys/ucontext.h> is unfortunately broken right now. */
  109. struct uw_ucontext {
  110. unsigned long uc_flags;
  111. - struct ucontext *uc_link;
  112. + ucontext_t *uc_link;
  113. stack_t uc_stack;
  114. mcontext_t uc_mcontext;
  115. unsigned long uc_filler[80];
  116. diff --git a/libgcc/config/nios2/linux-unwind.h b/libgcc/config/nios2/linux-unwind.h
  117. index dff1c20..1d88afe 100644
  118. --- a/libgcc/config/nios2/linux-unwind.h
  119. +++ b/libgcc/config/nios2/linux-unwind.h
  120. @@ -38,7 +38,7 @@ struct nios2_mcontext {
  121. struct nios2_ucontext {
  122. unsigned long uc_flags;
  123. - struct ucontext *uc_link;
  124. + ucontext_t *uc_link;
  125. stack_t uc_stack;
  126. struct nios2_mcontext uc_mcontext;
  127. sigset_t uc_sigmask; /* mask last for extensibility */
  128. diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h
  129. index 0149468..9157535 100644
  130. --- a/libgcc/config/pa/linux-unwind.h
  131. +++ b/libgcc/config/pa/linux-unwind.h
  132. @@ -80,7 +80,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
  133. struct sigcontext *sc;
  134. struct rt_sigframe {
  135. siginfo_t info;
  136. - struct ucontext uc;
  137. + ucontext_t uc;
  138. } *frame;
  139. /* rt_sigreturn trampoline:
  140. diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h
  141. index e63091f..67033f0 100644
  142. --- a/libgcc/config/sh/linux-unwind.h
  143. +++ b/libgcc/config/sh/linux-unwind.h
  144. @@ -180,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
  145. {
  146. struct rt_sigframe {
  147. siginfo_t info;
  148. - struct ucontext uc;
  149. + ucontext_t uc;
  150. } *rt_ = context->cfa;
  151. /* The void * cast is necessary to avoid an aliasing warning.
  152. The aliasing warning is correct, but should not be a problem
  153. diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h
  154. index fd83ba7..e3c9ef0 100644
  155. --- a/libgcc/config/tilepro/linux-unwind.h
  156. +++ b/libgcc/config/tilepro/linux-unwind.h
  157. @@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context,
  158. struct rt_sigframe {
  159. unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
  160. siginfo_t info;
  161. - struct ucontext uc;
  162. + ucontext_t uc;
  163. } *rt_;
  164. /* Return if this is not a signal handler. */
  165. diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h
  166. index 9daf738..ff6b663 100644
  167. --- a/libgcc/config/xtensa/linux-unwind.h
  168. +++ b/libgcc/config/xtensa/linux-unwind.h
  169. @@ -64,7 +64,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
  170. struct rt_sigframe {
  171. siginfo_t info;
  172. - struct ucontext uc;
  173. + ucontext_t uc;
  174. } *rt_;
  175. /* movi a2, __NR_rt_sigreturn; syscall */
  176. --
  177. 2.9.5