]> git.proxmox.com Git - rustc.git/blob - src/ci/docker/dist-armhf-linux/patches/glibc/ports-2.16.0/001-arm-libgcc_s_resume-used.patch
New upstream version 1.43.0+dfsg1
[rustc.git] / src / ci / docker / dist-armhf-linux / patches / glibc / ports-2.16.0 / 001-arm-libgcc_s_resume-used.patch
1 commit bdb24c2851fd5f0ad9b82d7ea1db911d334b02d2
2 Author: Joseph Myers <joseph@codesourcery.com>
3 Date: Tue May 20 21:27:13 2014 +0000
4
5 Fix ARM build with GCC trunk.
6
7 sysdeps/unix/sysv/linux/arm/unwind-resume.c and
8 sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c have static
9 variables that are written in C code but only read from toplevel asms.
10 Current GCC trunk now optimizes away such apparently write-only static
11 variables, so causing a build failure. This patch marks those
12 variables with __attribute_used__ to avoid that optimization.
13
14 Tested that this fixes the build for ARM.
15
16 * sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
17 (libgcc_s_resume): Use __attribute_used__.
18 * sysdeps/unix/sysv/linux/arm/unwind-resume.c (libgcc_s_resume):
19 Likewise.
20
21 diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
22 index 29e2c2b00b04..e848bfeffdcb 100644
23 --- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
24 +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
25 @@ -22,7 +22,8 @@
26 #include <pthreadP.h>
27
28 static void *libgcc_s_handle;
29 -static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
30 +static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
31 + __attribute_used__;
32 static _Unwind_Reason_Code (*libgcc_s_personality)
33 (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
34 static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
35 diff --git a/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c b/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
36 index 285b99b5ed0d..48d00fc83641 100644
37 --- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
38 +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
39 @@ -20,7 +20,8 @@
40 #include <stdio.h>
41 #include <unwind.h>
42
43 -static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
44 +static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
45 + __attribute_used__;
46 static _Unwind_Reason_Code (*libgcc_s_personality)
47 (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
48