From f04b64c1e97fcacf6a6272de5a0562ced97db436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 7 Nov 2017 15:39:24 +0100 Subject: [PATCH] gcc-4.5: fixup build with glibc-2.26 The older the GCC, the easier the backporting :-) --- .../development/compilers/gcc/4.5/default.nix | 1 + .../compilers/gcc/struct-ucontext-4.5.patch | 107 ++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 pkgs/development/compilers/gcc/struct-ucontext-4.5.patch diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 5bad03d30252..41d31888bde1 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -153,6 +153,7 @@ stdenv.mkDerivation ({ # target libraries and tools. ++ optional langAda ../gnat-cflags.patch ++ optional langVhdl ./ghdl-ortho-cflags.patch + ++ [ ../struct-ucontext-4.5.patch ] # glibc-2.26 ; postPatch = diff --git a/pkgs/development/compilers/gcc/struct-ucontext-4.5.patch b/pkgs/development/compilers/gcc/struct-ucontext-4.5.patch new file mode 100644 index 000000000000..a84e9ffe2681 --- /dev/null +++ b/pkgs/development/compilers/gcc/struct-ucontext-4.5.patch @@ -0,0 +1,107 @@ +Trivally backported the upstream commit +b685411208e0aaa79190d54faf945763514706b8 +(different directory, some files not present, etc.) +We only really use x86* from those, probably, so I didn't bother much. +diff --git a/gcc/config/alpha/linux-unwind.h b/gcc/config/alpha/linux-unwind.h +index bdbba4a..e84812e 100644 +--- a/gcc/config/alpha/linux-unwind.h ++++ b/gcc/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/gcc/config/bfin/linux-unwind.h b/gcc/config/bfin/linux-unwind.h +index 77b7c23..8bf5e82 100644 +--- a/gcc/config/bfin/linux-unwind.h ++++ b/gcc/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/gcc/config/i386/linux-unwind.h b/gcc/config/i386/linux-unwind.h +index 540a0a2..29efbe3 100644 +--- a/gcc/config/i386/linux-unwind.h ++++ b/gcc/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/gcc/config/m68k/linux-unwind.h b/gcc/config/m68k/linux-unwind.h +index 75b7cf7..f964e24 100644 +--- a/gcc/config/m68k/linux-unwind.h ++++ b/gcc/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/gcc/config/pa/linux-unwind.h b/gcc/config/pa/linux-unwind.h +index 9a2657f..e47493d 100644 +--- a/gcc/config/pa/linux-unwind.h ++++ b/gcc/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/gcc/config/sh/linux-unwind.h b/gcc/config/sh/linux-unwind.h +index e389cac..0bf43ba 100644 +--- a/gcc/config/sh/linux-unwind.h ++++ b/gcc/config/sh/linux-unwind.h +@@ -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/gcc/config/xtensa/linux-unwind.h b/gcc/config/xtensa/linux-unwind.h +index 9872492..586a9d4 100644 +--- a/gcc/config/xtensa/linux-unwind.h ++++ b/gcc/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 */ +-- +2.9.3 +