lol

gcc-4.8: fix with glibc-2.26

+208 -1
+5 -1
pkgs/development/compilers/gcc/4.8/default.nix
··· 78 78 sha256 = "01jd7pdarh54ki498g6sz64ijl9a1l5f9v8q2696aaxalvh2vwzl"; 79 79 excludes = [ "gcc/cp/ChangeLog" ]; 80 80 })] 81 - ; 81 + ++ [ # glibc-2.26 82 + ../struct-ucontext-4.8.patch 83 + ../sigsegv-not-declared.patch 84 + ../res_state-not-declared.patch 85 + ]; 82 86 83 87 javaEcj = fetchurl { 84 88 # The `$(top_srcdir)/ecj.jar' file is automatically picked up at
+13
pkgs/development/compilers/gcc/res_state-not-declared.patch
··· 1 + diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc 2 + index fe69430..49f5270 100644 3 + --- a/libsanitizer/tsan/tsan_platform_linux.cc 4 + +++ b/libsanitizer/tsan/tsan_platform_linux.cc 5 + @@ -351,7 +351,7 @@ bool IsGlobalVar(uptr addr) { 6 + // closes within glibc. The code is a pure hack. 7 + int ExtractResolvFDs(void *state, int *fds, int nfd) { 8 + int cnt = 0; 9 + - __res_state *statp = (__res_state*)state; 10 + + struct __res_state *statp = (struct __res_state*)state; 11 + for (int i = 0; i < MAXNS && cnt < nfd; i++) { 12 + if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1) 13 + fds[cnt++] = statp->_u._ext.nssocks[i];
+13
pkgs/development/compilers/gcc/sigsegv-not-declared.patch
··· 1 + error: 'SIGSEGV' was not declared in this scope 2 + diff --git a/libsanitizer/asan/asan_linux.cc b/libsanitizer/asan/asan_linux.cc 3 + index 0692eb1..472f734 100644 4 + --- a/libsanitizer/asan/asan_linux.cc 5 + +++ b/libsanitizer/asan/asan_linux.cc 6 + @@ -26,6 +26,7 @@ 7 + #include <sys/types.h> 8 + #include <fcntl.h> 9 + #include <pthread.h> 10 + +#include <signal.h> 11 + #include <stdio.h> 12 + #include <unistd.h> 13 + #include <unwind.h>
+177
pkgs/development/compilers/gcc/struct-ucontext-4.8.patch
··· 1 + From b685411208e0aaa79190d54faf945763514706b8 Mon Sep 17 00:00:00 2001 2 + From: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> 3 + Date: Tue, 4 Jul 2017 10:23:57 +0000 4 + Subject: [PATCH] Use ucontext_t not struct ucontext in linux-unwind.h files. 5 + 6 + Current glibc no longer gives the ucontext_t type the tag struct 7 + ucontext, to conform with POSIX namespace rules. This requires 8 + various linux-unwind.h files in libgcc, that were previously using 9 + struct ucontext, to be fixed to use ucontext_t instead. This is 10 + similar to the removal of the struct siginfo tag from siginfo_t some 11 + years ago. 12 + 13 + This patch changes those files to use ucontext_t instead. As the 14 + standard name that should be unconditionally safe, so this is not 15 + restricted to architectures supported by glibc, or conditioned on the 16 + glibc version. 17 + 18 + Tested compilation together with current glibc with glibc's 19 + build-many-glibcs.py. 20 + 21 + * config/aarch64/linux-unwind.h (aarch64_fallback_frame_state), 22 + config/alpha/linux-unwind.h (alpha_fallback_frame_state), 23 + config/bfin/linux-unwind.h (bfin_fallback_frame_state), 24 + config/i386/linux-unwind.h (x86_64_fallback_frame_state, 25 + x86_fallback_frame_state), config/m68k/linux-unwind.h (struct 26 + uw_ucontext), config/nios2/linux-unwind.h (struct nios2_ucontext), 27 + config/pa/linux-unwind.h (pa32_fallback_frame_state), 28 + config/sh/linux-unwind.h (sh_fallback_frame_state), 29 + config/tilepro/linux-unwind.h (tile_fallback_frame_state), 30 + config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Use 31 + ucontext_t instead of struct ucontext. 32 + 33 + 34 + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@249957 138bc75d-0d04-0410-961f-82ee72b054a4 35 + --- 36 + libgcc/ChangeLog (REMOVED) | 14 ++++++++++++++ 37 + libgcc/config/aarch64/linux-unwind.h | 2 +- 38 + libgcc/config/alpha/linux-unwind.h | 2 +- 39 + libgcc/config/bfin/linux-unwind.h | 2 +- 40 + libgcc/config/i386/linux-unwind.h | 4 ++-- 41 + libgcc/config/m68k/linux-unwind.h | 2 +- 42 + libgcc/config/nios2/linux-unwind.h | 2 +- 43 + libgcc/config/pa/linux-unwind.h | 2 +- 44 + libgcc/config/sh/linux-unwind.h | 2 +- 45 + libgcc/config/tilepro/linux-unwind.h | 2 +- 46 + libgcc/config/xtensa/linux-unwind.h | 2 +- 47 + 11 files changed, 25 insertions(+), 11 deletions(-) 48 + 49 + diff --git a/libgcc/config/aarch64/linux-unwind.h b/libgcc/config/aarch64/linux-unwind.h 50 + index 4512efb..06de45a 100644 51 + --- a/libgcc/config/aarch64/linux-unwind.h 52 + +++ b/libgcc/config/aarch64/linux-unwind.h 53 + @@ -52,7 +52,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context *context, 54 + struct rt_sigframe 55 + { 56 + siginfo_t info; 57 + - struct ucontext uc; 58 + + ucontext_t uc; 59 + }; 60 + 61 + struct rt_sigframe *rt_; 62 + diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h 63 + index bdbba4a..e84812e 100644 64 + --- a/libgcc/config/alpha/linux-unwind.h 65 + +++ b/libgcc/config/alpha/linux-unwind.h 66 + @@ -51,7 +51,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context, 67 + { 68 + struct rt_sigframe { 69 + siginfo_t info; 70 + - struct ucontext uc; 71 + + ucontext_t uc; 72 + } *rt_ = context->cfa; 73 + sc = &rt_->uc.uc_mcontext; 74 + } 75 + diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h 76 + index 77b7c23..8bf5e82 100644 77 + --- a/libgcc/config/bfin/linux-unwind.h 78 + +++ b/libgcc/config/bfin/linux-unwind.h 79 + @@ -52,7 +52,7 @@ bfin_fallback_frame_state (struct _Unwind_Context *context, 80 + void *puc; 81 + char retcode[8]; 82 + siginfo_t info; 83 + - struct ucontext uc; 84 + + ucontext_t uc; 85 + } *rt_ = context->cfa; 86 + 87 + /* The void * cast is necessary to avoid an aliasing warning. 88 + diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h 89 + index 540a0a2..29efbe3 100644 90 + --- a/libgcc/config/i386/linux-unwind.h 91 + +++ b/libgcc/config/i386/linux-unwind.h 92 + @@ -58,7 +58,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context, 93 + if (*(unsigned char *)(pc+0) == 0x48 94 + && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL) 95 + { 96 + - struct ucontext *uc_ = context->cfa; 97 + + ucontext_t *uc_ = context->cfa; 98 + /* The void * cast is necessary to avoid an aliasing warning. 99 + The aliasing warning is correct, but should not be a problem 100 + because it does not alias anything. */ 101 + @@ -138,7 +138,7 @@ x86_fallback_frame_state (struct _Unwind_Context *context, 102 + siginfo_t *pinfo; 103 + void *puc; 104 + siginfo_t info; 105 + - struct ucontext uc; 106 + + ucontext_t uc; 107 + } *rt_ = context->cfa; 108 + /* The void * cast is necessary to avoid an aliasing warning. 109 + The aliasing warning is correct, but should not be a problem 110 + diff --git a/libgcc/config/m68k/linux-unwind.h b/libgcc/config/m68k/linux-unwind.h 111 + index 75b7cf7..f964e24 100644 112 + --- a/libgcc/config/m68k/linux-unwind.h 113 + +++ b/libgcc/config/m68k/linux-unwind.h 114 + @@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 115 + /* <sys/ucontext.h> is unfortunately broken right now. */ 116 + struct uw_ucontext { 117 + unsigned long uc_flags; 118 + - struct ucontext *uc_link; 119 + + ucontext_t *uc_link; 120 + stack_t uc_stack; 121 + mcontext_t uc_mcontext; 122 + unsigned long uc_filler[80]; 123 + diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h 124 + index 9a2657f..e47493d 100644 125 + --- a/libgcc/config/pa/linux-unwind.h 126 + +++ b/libgcc/config/pa/linux-unwind.h 127 + @@ -80,7 +80,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context, 128 + struct sigcontext *sc; 129 + struct rt_sigframe { 130 + siginfo_t info; 131 + - struct ucontext uc; 132 + + ucontext_t uc; 133 + } *frame; 134 + 135 + /* rt_sigreturn trampoline: 136 + diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h 137 + index e389cac..0bf43ba 100644 138 + --- a/libgcc/config/sh/linux-unwind.h 139 + +++ b/libgcc/config/sh/linux-unwind.h 140 + @@ -180,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context, 141 + { 142 + struct rt_sigframe { 143 + siginfo_t info; 144 + - struct ucontext uc; 145 + + ucontext_t uc; 146 + } *rt_ = context->cfa; 147 + /* The void * cast is necessary to avoid an aliasing warning. 148 + The aliasing warning is correct, but should not be a problem 149 + diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h 150 + index 796e976..75f8890 100644 151 + --- a/libgcc/config/tilepro/linux-unwind.h 152 + +++ b/libgcc/config/tilepro/linux-unwind.h 153 + @@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context, 154 + struct rt_sigframe { 155 + unsigned char save_area[C_ABI_SAVE_AREA_SIZE]; 156 + siginfo_t info; 157 + - struct ucontext uc; 158 + + ucontext_t uc; 159 + } *rt_; 160 + 161 + /* Return if this is not a signal handler. */ 162 + diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h 163 + index 9872492..586a9d4 100644 164 + --- a/libgcc/config/xtensa/linux-unwind.h 165 + +++ b/libgcc/config/xtensa/linux-unwind.h 166 + @@ -67,7 +67,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context, 167 + 168 + struct rt_sigframe { 169 + siginfo_t info; 170 + - struct ucontext uc; 171 + + ucontext_t uc; 172 + } *rt_; 173 + 174 + /* movi a2, __NR_rt_sigreturn; syscall */ 175 + -- 176 + 2.9.3 177 +