diff options
author | Joseph Myers <joseph@codesourcery.com> | 2014-05-20 21:27:13 +0000 |
---|---|---|
committer | Will Newton <will.newton@linaro.org> | 2014-06-06 11:58:03 +0100 |
commit | 2bf7179f31bdade372f3fc8763a9a9a837b77c5f (patch) | |
tree | 4b32bf118245d62bd4b6466a98723bf1359c900c | |
parent | 43128471c729a06d902fbe34343ec95d3ccf2ea7 (diff) |
Fix ARM build with GCC trunk.
sysdeps/unix/sysv/linux/arm/unwind-resume.c and
sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c have static
variables that are written in C code but only read from toplevel asms.
Current GCC trunk now optimizes away such apparently write-only static
variables, so causing a build failure. This patch marks those
variables with __attribute_used__ to avoid that optimization.
Tested that this fixes the build for ARM.
* sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
(libgcc_s_resume): Use __attribute_used__.
* sysdeps/unix/sysv/linux/arm/unwind-resume.c (libgcc_s_resume):
Likewise.
-rw-r--r-- | libc/ports/ChangeLog.arm.linaro | 7 | ||||
-rw-r--r-- | libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c | 3 | ||||
-rw-r--r-- | libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c | 3 |
3 files changed, 11 insertions, 2 deletions
diff --git a/libc/ports/ChangeLog.arm.linaro b/libc/ports/ChangeLog.arm.linaro index 53b9bbf4a..47197b61d 100644 --- a/libc/ports/ChangeLog.arm.linaro +++ b/libc/ports/ChangeLog.arm.linaro @@ -1,3 +1,10 @@ +2014-05-20 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c + (libgcc_s_resume): Use __attribute_used__. + * sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c + (libgcc_s_resume): Likewise. + 2014-05-14 Wilco <wdijkstr@arm.com> * sysdeps/arm/fclrexcpt.c: Cleanup. diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c index 6ccd9b43a..660d1488e 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c +++ b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c @@ -22,7 +22,8 @@ #include <pthreadP.h> static void *libgcc_s_handle; -static void (*libgcc_s_resume) (struct _Unwind_Exception *exc); +static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) + __attribute_used__; static _Unwind_Reason_Code (*libgcc_s_personality) (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *); static _Unwind_Reason_Code (*libgcc_s_forcedunwind) diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c index bff3e2b4f..1f1eb7174 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c +++ b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c @@ -20,7 +20,8 @@ #include <stdio.h> #include <unwind.h> -static void (*libgcc_s_resume) (struct _Unwind_Exception *exc); +static void (*libgcc_s_resume) (struct _Unwind_Exception *exc) + __attribute_used__; static _Unwind_Reason_Code (*libgcc_s_personality) (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *); |