1 commit bdb24c2851fd5f0ad9b82d7ea1db911d334b02d2
2 Author: Joseph Myers <joseph@codesourcery.com>
3 Date: Tue May 20 21:27:13 2014 +0000
5 Fix ARM build with GCC trunk.
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.
14 Tested that this fixes the build for ARM.
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):
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
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)
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
43 -static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
44 +static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
46 static _Unwind_Reason_Code (*libgcc_s_personality)
47 (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);